Skip to content

Commit

Permalink
Add reference for ClientScopeID
Browse files Browse the repository at this point in the history
  • Loading branch information
Breee committed May 20, 2024
1 parent 2759b66 commit 72cb516
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 2 deletions.
20 changes: 20 additions & 0 deletions apis/client/v1alpha1/zz_generated.deepcopy.go

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

32 changes: 32 additions & 0 deletions apis/client/v1alpha1/zz_generated.resolvers.go

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

18 changes: 18 additions & 0 deletions apis/client/v1alpha1/zz_protocolmapper_types.go

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

7 changes: 5 additions & 2 deletions config/mapper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import "github.com/crossplane/upjet/pkg/config"
// Configure configures individual resources by adding custom ResourceConfigurators.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("keycloak_generic_protocol_mapper", func(r *config.Resource) {
// We need to override the default group that upjet generated for
r.ShortGroup = "client"
r.References["client_scope_id"] = config.Reference{
Type: "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.ClientScope",
}
})

p.AddResourceConfigurator("keycloak_generic_role_mapper", func(r *config.Resource) {
r.ShortGroup = "client"

r.References["role_id"] = config.Reference{
Type: "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1.Role",
}

})
}
152 changes: 152 additions & 0 deletions package/crds/client.keycloak.crossplane.io_protocolmappers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,82 @@ spec:
The ID of the client scope this protocol mapper should be added to. Conflicts with client_id. This argument is required if client_id is not set.
The mapper's associated client scope. Cannot be used at the same time as client_id.
type: string
clientScopeIdRef:
description: Reference to a ClientScope in openidclient to populate
clientScopeId.
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
clientScopeIdSelector:
description: Selector for a ClientScope in openidclient to populate
clientScopeId.
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
config:
additionalProperties:
type: string
Expand Down Expand Up @@ -360,6 +436,82 @@ spec:
The ID of the client scope this protocol mapper should be added to. Conflicts with client_id. This argument is required if client_id is not set.
The mapper's associated client scope. Cannot be used at the same time as client_id.
type: string
clientScopeIdRef:
description: Reference to a ClientScope in openidclient to populate
clientScopeId.
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
clientScopeIdSelector:
description: Selector for a ClientScope in openidclient to populate
clientScopeId.
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
config:
additionalProperties:
type: string
Expand Down

0 comments on commit 72cb516

Please sign in to comment.