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

fix: client default/optional scopes first apply problem #594

Merged
merged 5 commits into from
Sep 23, 2021
Merged

fix: client default/optional scopes first apply problem #594

merged 5 commits into from
Sep 23, 2021

Conversation

Vlad-Kirichenko
Copy link
Contributor

Hello @mrparkers.

Changes in this PR gonna fix problem mentioned in #498.

Best regards,
Vlad

Signed-off-by: Vlad Kirichenko <v.kirichenko@napoleongames.be>
…& added error log for not found client

Signed-off-by: Vlad Kirichenko <v.kirichenko@napoleongames.be>
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.

Overall this PR looks good, just had one question

@@ -232,7 +232,9 @@ func (keycloakClient *KeycloakClient) getOpenidClientScopes(realmId, clientId, t
var scopes []*OpenidClientScope

err := keycloakClient.get(fmt.Sprintf("/realms/%s/clients/%s/%s-client-scopes", realmId, clientId, t), &scopes, nil)
if err != nil {
if err != nil && ErrorIs404(err) {
return nil, fmt.Errorf("validation error: client with id %s does not exist", clientId)
Copy link
Contributor

Choose a reason for hiding this comment

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

was there a particular reason that this is needed? normally, we check for 404 errors within the provider package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I saw a problem in the TestAccKeycloakOpenidClientDefaultScopes_validateClientDoesNotExist test, and saw that the validation is missing when getting for scopes. Therefore, I added it.

It's strange that this check didn't work here.

@Vlad-Kirichenko Vlad-Kirichenko marked this pull request as ready for review September 20, 2021 06:50
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.

LGTM, thanks for the PR!

@mrparkers mrparkers merged commit a90b6cd into keycloak:master Sep 23, 2021
@Vlad-Kirichenko Vlad-Kirichenko deleted the fix-openid-client-scopes branch September 23, 2021 16:36
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.

2 participants