-
Notifications
You must be signed in to change notification settings - Fork 324
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
1073 add organization setting to realm #1076
base: main
Are you sure you want to change the base?
1073 add organization setting to realm #1076
Conversation
Signed-off-by: Sebastian Schuster <[email protected]>
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.
Thanks for your PR. I'd instead use organizations_enabled
rather than just organizations.
This explains the intent more clearly.
We also should exclude the attribute in tests <= KC24 .
@@ -29,6 +29,7 @@ type Realm struct { | |||
DisplayName string `json:"displayName"` | |||
DisplayNameHtml string `json:"displayNameHtml"` | |||
UserManagedAccess bool `json:"userManagedAccessAllowed"` | |||
Organizations bool `json:"organizationsEnabled"` |
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.
Organizations bool `json:"organizationsEnabled"` | |
OrganizationsEnabled bool `json:"organizationsEnabled"` |
@@ -116,6 +116,10 @@ func dataSourceKeycloakRealm() *schema.Resource { | |||
Type: schema.TypeBool, | |||
Computed: true, | |||
}, | |||
"organizations": { |
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.
"organizations": { | |
"organizations_enabled": { |
@@ -179,6 +179,11 @@ func resourceKeycloakRealm() *schema.Resource { | |||
Optional: true, | |||
Default: false, | |||
}, | |||
"organizations": { |
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.
"organizations": { | |
"organizations_enabled": { |
@@ -745,6 +750,7 @@ func getRealmFromData(data *schema.ResourceData) (*keycloak.Realm, error) { | |||
DisplayName: data.Get("display_name").(string), | |||
DisplayNameHtml: data.Get("display_name_html").(string), | |||
UserManagedAccess: data.Get("user_managed_access").(bool), | |||
Organizations: data.Get("organizations").(bool), |
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.
Organizations: data.Get("organizations").(bool), | |
OrganizationsEnabled: data.Get("organizations_enabled").(bool), |
@@ -1179,6 +1185,7 @@ func setRealmData(data *schema.ResourceData, realm *keycloak.Realm) { | |||
data.Set("display_name", realm.DisplayName) | |||
data.Set("display_name_html", realm.DisplayNameHtml) | |||
data.Set("user_managed_access", realm.UserManagedAccess) | |||
data.Set("organizations", realm.Organizations) |
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.
data.Set("organizations", realm.Organizations) | |
data.Set("organizations_enabled", realm.OrganizationsEnabled) |
@@ -83,6 +83,7 @@ resource "keycloak_realm" "realm" { | |||
- `display_name` - (Optional) The display name for the realm that is shown when logging in to the admin console. | |||
- `display_name_html` - (Optional) The display name for the realm that is rendered as HTML on the screen when logging in to the admin console. | |||
- `user_managed_access` - (Optional) When `true`, users are allowed to manage their own resources. Defaults to `false`. | |||
- `organizations` - (Optional) When `true`, organization support is enabled. Defaults to `false`. |
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.
- `organizations` - (Optional) When `true`, organization support is enabled. Defaults to `false`. | |
- `organizations_enabled` - (Optional) When `true`, organization support is enabled. Defaults to `false`. |
Closes #1073