Skip to content

Commit

Permalink
Added Realm as Ref on IdentityProviderMapping Resource
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskniep committed Mar 25, 2024
1 parent 89b6ae3 commit 3c9831a
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 6 deletions.
21 changes: 21 additions & 0 deletions apis/identityprovider/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions apis/identityprovider/v1alpha1/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config/identityprovider/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ const (
func Configure(p *config.Provider) {
p.AddResourceConfigurator("keycloak_custom_identity_provider_mapper", func(r *config.Resource) {
r.ShortGroup = Group
r.References["realm"] = config.Reference{
Type: "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm",
}
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ spec:
identityProviderAlias: my-idp
identityProviderMapper: '%s-user-attribute-idp-mapper'
name: email-attribute-importer
realm: ${keycloak_realm.realm.id}
realmSelector:
matchLabels:
testing.upbound.io/example-name: realm

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,80 @@ spec:
The name of the realm.
Realm Name
type: string
realmRef:
description: Reference to a Realm in realm to populate realm.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
realmSelector:
description: Selector for a Realm in realm to populate realm.
properties:
matchControllerRef:
description: |-
MatchControllerRef ensures an object with the same controller reference
as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
type: object
initProvider:
description: |-
Expand Down Expand Up @@ -143,6 +217,80 @@ spec:
The name of the realm.
Realm Name
type: string
realmRef:
description: Reference to a Realm in realm to populate realm.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
realmSelector:
description: Selector for a Realm in realm to populate realm.
properties:
matchControllerRef:
description: |-
MatchControllerRef ensures an object with the same controller reference
as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
type: object
managementPolicies:
default:
Expand Down Expand Up @@ -324,10 +472,6 @@ spec:
rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies
|| ''Update'' in self.managementPolicies) || has(self.forProvider.name)
|| (has(self.initProvider) && has(self.initProvider.name))'
- message: spec.forProvider.realm is a required parameter
rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies
|| ''Update'' in self.managementPolicies) || has(self.forProvider.realm)
|| (has(self.initProvider) && has(self.initProvider.realm))'
status:
description: IdentityProviderMapperStatus defines the observed state of
IdentityProviderMapper.
Expand Down

0 comments on commit 3c9831a

Please sign in to comment.