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

Support ClientScopeId at GenericClientProtocolMapper #229

Merged
merged 3 commits into from
Feb 25, 2020
Merged

Support ClientScopeId at GenericClientProtocolMapper #229

merged 3 commits into from
Feb 25, 2020

Conversation

BernhardBerbuir
Copy link
Contributor

@BernhardBerbuir BernhardBerbuir commented Feb 19, 2020

fixes #225

- use only tabs at release-targets.json
- document missing environment variable for local test execution
- use helper function protocolMapperPath()
- add function Validate()
- make client_id optional at schema
- use same function names as resourceKeycloakOpenIdUserPropertyProtocolMapper
- add missing clientScopeId at several functions
- ensure that either ClientId or ClientScopeId is set, but not both
- fix description of attribute realm_id
@BernhardBerbuir BernhardBerbuir changed the title Minor cleanups Support ClientScopeId at GenericClientProtocolMapper Feb 19, 2020
@BernhardBerbuir BernhardBerbuir marked this pull request as ready for review February 19, 2020 16:00
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 great, thanks for the PR!

@mrparkers mrparkers merged commit ad8e687 into keycloak:master Feb 25, 2020
chopshop1 pushed a commit to ware2go/terraform-provider-keycloak that referenced this pull request Mar 3, 2020
@trois-six
Copy link
Contributor

Please revert the change on GetGenericClientProtocolMappers, that breaks my terraformer provider.

@BernhardBerbuir
Copy link
Contributor Author

@trois-six : Could you please provide more information why this patch is problematic. Do you have a test case which currently fails, but should work?

@trois-six
Copy link
Contributor

trois-six commented Mar 24, 2020

The only place where it's used (I created that function with that goal in mind) is here: https://github.com/GoogleCloudPlatform/terraformer/blob/master/providers/keycloak/openid_client.go#L157

@BernhardBerbuir
Copy link
Contributor Author

BernhardBerbuir commented Mar 24, 2020

I'm not sure, if I understand the problem. The function GetGenericClientProtocolMappers(realmId string, clientId string) has two shortcomings:

  • it returns only one GenericClientProtocolMapper instead of an array of GenericClientProtocolMapper (there could be more than one GenericClientProtocolMapper)
  • the function does not return GenericClientProtocolMappers which are bound to a client_scope instead of a client

If this is the problem, then I can create a PR, but this would change the signature of the function (remove parameter mapperId, return value becomes an array)
=> this breaks all current usages of the function

@trois-six
Copy link
Contributor

trois-six commented Mar 24, 2020

It returns a OpenidClientWithGenericClientProtocolMappers, with an array of mappers associated to the oidc client. The idea is to get an inventory of all the mappers associated to the oidc client.

@BernhardBerbuir
Copy link
Contributor Author

Ok, I see the array of mappers is hidden in the struct OpenidClientWithGenericClientProtocolMappers (side note: the name is not optimal as also SAML clients can use GenericClientProtocolMappers)
=> no change of the return value is required

I have seen that not a complete revert of this pull request has been done but a bug fix instead. So I'm absolutely o with the current situation.

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 client_scope_id in generic_client_protocol_mapper
3 participants