-
Notifications
You must be signed in to change notification settings - Fork 315
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
Add WebAuth{, Passwordwordless} Policy #356
Conversation
This comment has been minimized.
This comment has been minimized.
Why is this failing CI? Sadly I can't see the result on CircleCI somehow. I'd like to note that without this PR, it's really annoying to operate this provider with an active WebAuthn config as every time the realm is modified via this Terraform provider, the WebAuthn config is reset to defaults which is really tricky if you forget about it and quite the security risk too. |
This comment has been minimized.
This comment has been minimized.
@mrparkers CI is green now (I just did a squash of all the commits, but he code didn't change), any chance you could have a look? :) |
Sorry for the delayed review here. Overall the code looks fine, but I think the schema could potentially be improved by aggregating each of these attributes underneath resource "keycloak_realm" "test" {
name = "test"
web_authn_policy {
rp_entity_name = "keycloak"
}
web_authn_passwordless_policy {
rp_entity_name = "keycloak"
}
} This would let you mark attributes such as What do you think about this? |
Sounds good to me, it is a bit easier to manage.
Do we want it to be required? |
I saw that it was required in the GUI, so that's why I mentioned it. But I've never actually used this feature of Keycloak before, so I'll defer to your judgement about whether or not it should be. The only thing I wanted to mention is that this approach would allow us to have a WebAuthn attribute marked as required if we wanted to. |
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just had a few comments about the schema, but overall it looks good.
I do want to add these attributes to an existing test case, or add some new test cases altogether. if you'd prefer, I can work on this and push it to your branch, or you could give it a shot.
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the schema for the data source, none of these attributes should have Optional: true
or Default
, and all of them should have Computed: true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this? Should web_authn_policy
have Optional: true
?
provider/resource_keycloak_realm.go
Outdated
Type: schema.TypeString, | ||
Description: "Either none, indirect or direct", | ||
Optional: true, | ||
Default: "not specified", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really hate how the Keycloak API uses this as the nil value. I'm not sure how I feel about setting this as the default within the provider package. However, I don't feel strongly enough about this to force you to change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The javascript code check if it is not specfied
, so... :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use the WebAuthn defaults though. Ex for attestation_conveyance_preference
the default is none
, any opinions?
Feel free to take a stab at it :) The schema should be fixed now and CI is green. |
I should have left this comment previously, but I missed it. What would you think about being more explicit with the |
This comment has been minimized.
This comment has been minimized.
It reduces code duplication.
Done and rebased. |
There was a problem hiding this 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!
Fix #355