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

added default realm, added password grant type #88

Merged
merged 24 commits into from
Feb 13, 2019
Merged

added default realm, added password grant type #88

merged 24 commits into from
Feb 13, 2019

Conversation

AndrewChubatiuk
Copy link
Contributor

Restored #64 PR

Copy link
Owner

@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.

Thanks again for the PR! I only have a few small comments this time around.

After addressing these, I also want to look into writing some tests to ensure that the default realm (when provided) is respected when creating new resources and importing existing resources. To be honest, I am not quite sure how to approach this, but if you allow me to push changes to your fork, I can try to work on them this weekend.

httpClient := &http.Client{
Timeout: time.Second * 5,
}
if defaultRealm != "" {
defaultRealm = realm
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we should make this assumption here. The provider should only set a default realm for resources if the user explicitly set default_realm as a provider attribute instead of defaulting to the realm used for auth.

defaultRealm = realm
}
var clientCredentials *ClientCredentials
if clientId != "" {
Copy link
Owner

Choose a reason for hiding this comment

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

This check shouldn't be needed since client_id is a required provider attribute.

realmId = parts[0]
id = parts[1]
default:
return nil, fmt.Errorf("Resouce %s cannot be imported", d.Id())
Copy link
Owner

Choose a reason for hiding this comment

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

This error message isn't accurate, since this resource can be imported. This should be changed to tell the user the supported formats for tf import.

Copy link
Owner

Choose a reason for hiding this comment

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

This comment applies to a lot of other places in this PR as well.

@mrparkers mrparkers mentioned this pull request Feb 8, 2019
@AndrewChubatiuk
Copy link
Contributor Author

AndrewChubatiuk commented Feb 10, 2019

@mrparkers fixed all your PR comments and added 2 pipelines to test different keycloak providers configs. Gave you an access to push to my fork.

@AndrewChubatiuk
Copy link
Contributor Author

Removed default_realm from provider configuration, cause it doesn't work as expected.

KEYCLOAK_URL: http://localhost:8080
KEYCLOAK_REALM: master
KEYCLOAK_USER: keycloak
KEYCLOAK_PASSWORD: password
Copy link
Owner

Choose a reason for hiding this comment

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

I like this idea. I'll have to update the branch protection to require these new statuses set by CircleCI.

Copy link
Owner

@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.

Just one small comment, everything else looks good. Thanks!

@@ -25,7 +26,7 @@ func resourceKeycloakCustomUserFederation() *schema.Resource {
},
"realm_id": {
Type: schema.TypeString,
Required: true,
Optional: true,
Copy link
Owner

Choose a reason for hiding this comment

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

Since default realm was removed, this should be changed back.

@mrparkers
Copy link
Owner

After the comment is addressed, I'll merge this and update the docs to explain the new provider attributes and auth type. Once that is done, I'll cut a release so you can start using this.

Thanks again for the contribution!

@AndrewChubatiuk
Copy link
Contributor Author

Oh, forgot to revert this change as well

@AndrewChubatiuk
Copy link
Contributor Author

Everything is ready now

@mrparkers mrparkers merged commit 47648ca into mrparkers:master Feb 13, 2019
@mrparkers mrparkers deleted the default-realm-password-grant branch February 13, 2019 15:00
@mrparkers mrparkers restored the default-realm-password-grant branch February 13, 2019 15:00
@mrparkers
Copy link
Owner

@AndrewChubatiuk I'll try and get the docs updated in the next couple of days and cut a release for you.

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