Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement keycloak_ldap_hardcoded_role_mapper resource #195

Merged
merged 4 commits into from
Jan 8, 2020
Merged

Implement keycloak_ldap_hardcoded_role_mapper resource #195

merged 4 commits into from
Jan 8, 2020

Conversation

madddi
Copy link
Contributor

@madddi madddi commented Jan 7, 2020

This adds a resource for the hardcoded-ldap-role-mapper. Fixes #109

@madddi madddi changed the title Implement keycloak_ldap_hardcoded_role_mapper Implement keycloak_ldap_hardcoded_role_mapper resource Jan 7, 2020
@madddi madddi marked this pull request as ready for review January 7, 2020 14:19
@madddi
Copy link
Contributor Author

madddi commented Jan 7, 2020

Hey @mrparkers, I tested the new resource with a real KeyCloak test setup and it works fine - the tests are failing though. I can't really figure out why, can you give me a hint?

@mrparkers
Copy link
Contributor

Sure - you can use the TF_LOG=DEBUG environment variable to get extra logging to see why the request failed:

TF_LOG=DEBUG make testacc TESTARGS="-run TestAccKeycloakLdapHardcodedRoleMapper_basic"

From that, I saw the response payload for the bad request:

{"errorMessage":"There is no role corresponding to configured value"}

It looks like your test assumes the role admin exists in the test realm. Perhaps the version of Keycloak you're testing against creates that role by default on new realms, but version 8.0.0 (the version CI is testing against) does not?

@madddi
Copy link
Contributor Author

madddi commented Jan 7, 2020

Oh... 🤦‍♂️ Sure, this role only exists in the master realm by default. I'll just update the tests to create a role and use this. Thank you!

By the way: I noticed that KeyCloak, Terraform, Go and openldap are out of date in your test suite. I'd update them in a separate PR if you think that makes sense.

Copy link
Contributor

@mrparkers mrparkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the PR!

@mrparkers mrparkers merged commit 8d55d78 into keycloak:master Jan 8, 2020
@mrparkers
Copy link
Contributor

Also, if you'd like to submit a PR to update versions and switch the usage of HCL to HCL2 that would be great!

@madddi madddi deleted the issue-109-hardcoded-ldap-role-mapper branch January 8, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support hardcoded-ldap-role-mapper LDAP Mapper
2 participants