terraform-provider-nexus icon indicating copy to clipboard operation
terraform-provider-nexus copied to clipboard

Missing field "source" in nexus_security_role. Error while creating nexus_security_role for external role.

Open dyusupov-express42 opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.2

Nexus Provider Version

1.21.0

Nexus Version

3.39.0

Affected Resource(s)/Data Source(s)

nexus_security_role

Terraform Configuration Files

resource "nexus_security_role" "keycloak_role_map" {
  roleid = "RealmGroup:/${var.external_role}"
  description = "RealmGroup:/${var.external_role}"
  name        = "RealmGroup:/${var.external_role}"
  privileges  = [
    "nx-all",
  ]
  roles       = []
}

WHERE ${var.external_role} = admins

resource "nexus_security_realms" "keycloak_realm" {
  active = var.active_realms
}

WHERE var.active_realms = ["NexusAuthenticatingRealm", "NexusAuthorizingRealm", "org.github.flytreeleft.nexus3.keycloak.plugin.KeycloakAuthenticatingRealm"]

Debug Output/Panic Output

Error: Empty Summary: This is always a bug in the provider and should be reported to the provider developers.
│ 
│   with nexus_security_role.keycloak_role_map,
│   on roles.tf line 1, in resource "nexus_security_role" "keycloak_role_map":
│    1: resource "nexus_security_role" "keycloak_role_map" {
│

Expected Behaviour

No response

Actual Behaviour

  • I am using a plugin to set up integration with Keycloak.
  • The resource is created but eventually an error is thrown. Because of this error, the terraform destroy command cannot be called. External integration with Keycloak works, authorization passes.
  • There are no errors when using the REST API.
curl -u admin:admin123 -X POST \
    "http://localhost:8081/service/rest/beta/security/roles" \
    -H "Content-Type: application/json" \
    -H "accept: application/json" \
    -d "{ \"id\": \"RealmGroup:/admins\", \"source\": \"default\", \"name\": \"RealmGroup:/admins\", \"description\": \"RealmGroup:/admins\", \"privileges\": [ \"nx-all\" ], \"roles\": [ ]}"
  • And why is the "source" field missing from the "nexus_security_role" resource? I think it would be nice to add this field.

P.S.

I did not find anything in issues for the words "nexus_security_role" and "source".

Steps to Reproduce

No response

References

No response

dyusupov-express42 avatar Jul 26 '22 19:07 dyusupov-express42

fixed https://github.com/datadrivers/go-nexus-client/pull/102

stempher avatar Aug 20 '22 17:08 stempher

@stempher

can you test the release v1.21.2? If the bug is fixed, we can relabel this issue to an enhancement

anmoel avatar Oct 17 '22 16:10 anmoel

in release v1.21.2 the resource "nexus_security_role" works correctly

stempher avatar Oct 19 '22 11:10 stempher

@dyusupov-express42 is your problem fixed?

anmoel avatar Oct 19 '22 11:10 anmoel

the missing argument "source" will implemented soon

anmoel avatar Oct 19 '22 11:10 anmoel

This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 7 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] avatar Jan 18 '23 08:01 github-actions[bot]

source

Is this coming? As it stands, there doesn't seem to be a way to perform external role mapping (LDAP and SAML)?

jfversent avatar Nov 01 '23 00:11 jfversent