diff --git a/apis/client/v1alpha1/zz_generated.deepcopy.go b/apis/client/v1alpha1/zz_generated.deepcopy.go index 124eae7..354751e 100644 --- a/apis/client/v1alpha1/zz_generated.deepcopy.go +++ b/apis/client/v1alpha1/zz_generated.deepcopy.go @@ -101,6 +101,16 @@ func (in *ProtocolMapperParameters) DeepCopyInto(out *ProtocolMapperParameters) *out = new(string) **out = **in } + if in.ClientIDRef != nil { + in, out := &in.ClientIDRef, &out.ClientIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClientIDSelector != nil { + in, out := &in.ClientIDSelector, &out.ClientIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.ClientScopeID != nil { in, out := &in.ClientScopeID, &out.ClientScopeID *out = new(string) @@ -141,6 +151,16 @@ func (in *ProtocolMapperParameters) DeepCopyInto(out *ProtocolMapperParameters) *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProtocolMapperParameters. @@ -294,6 +314,16 @@ func (in *RoleMapperParameters) DeepCopyInto(out *RoleMapperParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.RoleID != nil { in, out := &in.RoleID, &out.RoleID *out = new(string) diff --git a/apis/client/v1alpha1/zz_generated.resolvers.go b/apis/client/v1alpha1/zz_generated.resolvers.go index 85d0ebd..c78be5e 100644 --- a/apis/client/v1alpha1/zz_generated.resolvers.go +++ b/apis/client/v1alpha1/zz_generated.resolvers.go @@ -8,12 +8,55 @@ package v1alpha1 import ( "context" v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1" - v1alpha11 "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1" + v1alpha11 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + v1alpha12 "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1" reference "github.com/crossplane/crossplane-runtime/pkg/reference" errors "github.com/pkg/errors" client "sigs.k8s.io/controller-runtime/pkg/client" ) +// ResolveReferences of this ProtocolMapper. +func (mg *ProtocolMapper) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClientID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClientIDRef, + Selector: mg.Spec.ForProvider.ClientIDSelector, + To: reference.To{ + List: &v1alpha1.ClientList{}, + Managed: &v1alpha1.Client{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClientID") + } + mg.Spec.ForProvider.ClientID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClientIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha11.RealmList{}, + Managed: &v1alpha11.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this RoleMapper. func (mg *RoleMapper) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) @@ -37,14 +80,30 @@ func (mg *RoleMapper) ResolveReferences(ctx context.Context, c client.Reader) er mg.Spec.ForProvider.ClientID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.ClientIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha11.RealmList{}, + Managed: &v1alpha11.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RoleID), Extract: reference.ExternalName(), Reference: mg.Spec.ForProvider.RoleIDRef, Selector: mg.Spec.ForProvider.RoleIDSelector, To: reference.To{ - List: &v1alpha11.RoleList{}, - Managed: &v1alpha11.Role{}, + List: &v1alpha12.RoleList{}, + Managed: &v1alpha12.Role{}, }, }) if err != nil { diff --git a/apis/client/v1alpha1/zz_protocolmapper_types.go b/apis/client/v1alpha1/zz_protocolmapper_types.go index 25cbce5..d4d00eb 100755 --- a/apis/client/v1alpha1/zz_protocolmapper_types.go +++ b/apis/client/v1alpha1/zz_protocolmapper_types.go @@ -20,9 +20,18 @@ type ProtocolMapperObservation struct { type ProtocolMapperParameters struct { // The mapper's associated client. Cannot be used at the same time as client_scope_id. + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.Client // +kubebuilder:validation:Optional ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + // Reference to a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDRef *v1.Reference `json:"clientIdRef,omitempty" tf:"-"` + + // Selector for a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDSelector *v1.Selector `json:"clientIdSelector,omitempty" tf:"-"` + // The mapper's associated client scope. Cannot be used at the same time as client_id. // +kubebuilder:validation:Optional ClientScopeID *string `json:"clientScopeId,omitempty" tf:"client_scope_id,omitempty"` @@ -43,8 +52,17 @@ type ProtocolMapperParameters struct { ProtocolMapper *string `json:"protocolMapper" tf:"protocol_mapper,omitempty"` // The realm id where the associated client or client scope exists. - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` } // ProtocolMapperSpec defines the desired state of ProtocolMapper diff --git a/apis/client/v1alpha1/zz_rolemapper_types.go b/apis/client/v1alpha1/zz_rolemapper_types.go index 077e0f4..9e3fa04 100755 --- a/apis/client/v1alpha1/zz_rolemapper_types.go +++ b/apis/client/v1alpha1/zz_rolemapper_types.go @@ -37,8 +37,17 @@ type RoleMapperParameters struct { ClientScopeID *string `json:"clientScopeId,omitempty" tf:"client_scope_id,omitempty"` // The realm id where the associated client or client scope exists. - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` // Id of the role to assign // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1.Role diff --git a/apis/group/v1alpha1/zz_generated.deepcopy.go b/apis/group/v1alpha1/zz_generated.deepcopy.go index 2d84535..5f0c02b 100644 --- a/apis/group/v1alpha1/zz_generated.deepcopy.go +++ b/apis/group/v1alpha1/zz_generated.deepcopy.go @@ -131,6 +131,16 @@ func (in *GroupParameters) DeepCopyInto(out *GroupParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupParameters. @@ -290,6 +300,16 @@ func (in *MembershipsParameters) DeepCopyInto(out *MembershipsParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MembershipsParameters. @@ -443,6 +463,16 @@ func (in *RolesParameters) DeepCopyInto(out *RolesParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.RoleIds != nil { in, out := &in.RoleIds, &out.RoleIds *out = make([]*string, len(*in)) diff --git a/apis/group/v1alpha1/zz_generated.resolvers.go b/apis/group/v1alpha1/zz_generated.resolvers.go index b813d01..3292cae 100644 --- a/apis/group/v1alpha1/zz_generated.resolvers.go +++ b/apis/group/v1alpha1/zz_generated.resolvers.go @@ -7,12 +7,39 @@ package v1alpha1 import ( "context" - v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + v1alpha11 "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1" reference "github.com/crossplane/crossplane-runtime/pkg/reference" errors "github.com/pkg/errors" client "sigs.k8s.io/controller-runtime/pkg/client" ) +// ResolveReferences of this Group. +func (mg *Group) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha1.RealmList{}, + Managed: &v1alpha1.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this Memberships. func (mg *Memberships) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) @@ -36,6 +63,22 @@ func (mg *Memberships) ResolveReferences(ctx context.Context, c client.Reader) e mg.Spec.ForProvider.GroupID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.GroupIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha1.RealmList{}, + Managed: &v1alpha1.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + return nil } @@ -63,14 +106,30 @@ func (mg *Roles) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.GroupID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.GroupIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha1.RealmList{}, + Managed: &v1alpha1.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.RoleIds), Extract: reference.ExternalName(), References: mg.Spec.ForProvider.RoleIdsRefs, Selector: mg.Spec.ForProvider.RoleIdsSelector, To: reference.To{ - List: &v1alpha1.RoleList{}, - Managed: &v1alpha1.Role{}, + List: &v1alpha11.RoleList{}, + Managed: &v1alpha11.Role{}, }, }) if err != nil { diff --git a/apis/group/v1alpha1/zz_group_types.go b/apis/group/v1alpha1/zz_group_types.go index 02bee16..aa12ec7 100755 --- a/apis/group/v1alpha1/zz_group_types.go +++ b/apis/group/v1alpha1/zz_group_types.go @@ -30,8 +30,17 @@ type GroupParameters struct { // +kubebuilder:validation:Optional ParentID *string `json:"parentId,omitempty" tf:"parent_id,omitempty"` - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` } // GroupSpec defines the desired state of Group diff --git a/apis/group/v1alpha1/zz_memberships_types.go b/apis/group/v1alpha1/zz_memberships_types.go index ab68779..9b05277 100755 --- a/apis/group/v1alpha1/zz_memberships_types.go +++ b/apis/group/v1alpha1/zz_memberships_types.go @@ -34,8 +34,17 @@ type MembershipsParameters struct { // +kubebuilder:validation:Required Members []*string `json:"members" tf:"members,omitempty"` - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` } // MembershipsSpec defines the desired state of Memberships diff --git a/apis/group/v1alpha1/zz_roles_types.go b/apis/group/v1alpha1/zz_roles_types.go index 28a4115..0d71764 100755 --- a/apis/group/v1alpha1/zz_roles_types.go +++ b/apis/group/v1alpha1/zz_roles_types.go @@ -34,8 +34,17 @@ type RolesParameters struct { // +kubebuilder:validation:Optional GroupIDSelector *v1.Selector `json:"groupIdSelector,omitempty" tf:"-"` - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1.Role // +kubebuilder:validation:Optional diff --git a/apis/openidclient/v1alpha1/zz_client_types.go b/apis/openidclient/v1alpha1/zz_client_types.go index d506d41..f4ba043 100755 --- a/apis/openidclient/v1alpha1/zz_client_types.go +++ b/apis/openidclient/v1alpha1/zz_client_types.go @@ -83,8 +83,17 @@ type ClientParameters struct { // +kubebuilder:validation:Optional ClientAuthenticatorType *string `json:"clientAuthenticatorType,omitempty" tf:"client_authenticator_type,omitempty"` - // +kubebuilder:validation:Required - ClientID *string `json:"clientId" tf:"client_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.Client + // +kubebuilder:validation:Optional + ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + + // Reference to a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDRef *v1.Reference `json:"clientIdRef,omitempty" tf:"-"` + + // Selector for a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDSelector *v1.Selector `json:"clientIdSelector,omitempty" tf:"-"` // +kubebuilder:validation:Optional ClientOfflineSessionIdleTimeout *string `json:"clientOfflineSessionIdleTimeout,omitempty" tf:"client_offline_session_idle_timeout,omitempty"` @@ -158,8 +167,17 @@ type ClientParameters struct { // +kubebuilder:validation:Optional PkceCodeChallengeMethod *string `json:"pkceCodeChallengeMethod,omitempty" tf:"pkce_code_challenge_method,omitempty"` - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` // +kubebuilder:validation:Optional RootURL *string `json:"rootUrl,omitempty" tf:"root_url,omitempty"` diff --git a/apis/openidclient/v1alpha1/zz_clientdefaultscopes_types.go b/apis/openidclient/v1alpha1/zz_clientdefaultscopes_types.go new file mode 100755 index 0000000..fa67b87 --- /dev/null +++ b/apis/openidclient/v1alpha1/zz_clientdefaultscopes_types.go @@ -0,0 +1,97 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ClientDefaultScopesObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type ClientDefaultScopesParameters struct { + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.Client + // +kubebuilder:validation:Optional + ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + + // Reference to a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDRef *v1.Reference `json:"clientIdRef,omitempty" tf:"-"` + + // Selector for a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDSelector *v1.Selector `json:"clientIdSelector,omitempty" tf:"-"` + + // +kubebuilder:validation:Required + DefaultScopes []*string `json:"defaultScopes" tf:"default_scopes,omitempty"` + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` +} + +// ClientDefaultScopesSpec defines the desired state of ClientDefaultScopes +type ClientDefaultScopesSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ClientDefaultScopesParameters `json:"forProvider"` +} + +// ClientDefaultScopesStatus defines the observed state of ClientDefaultScopes. +type ClientDefaultScopesStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ClientDefaultScopesObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClientDefaultScopes is the Schema for the ClientDefaultScopess API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type ClientDefaultScopes struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ClientDefaultScopesSpec `json:"spec"` + Status ClientDefaultScopesStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClientDefaultScopesList contains a list of ClientDefaultScopess +type ClientDefaultScopesList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClientDefaultScopes `json:"items"` +} + +// Repository type metadata. +var ( + ClientDefaultScopes_Kind = "ClientDefaultScopes" + ClientDefaultScopes_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ClientDefaultScopes_Kind}.String() + ClientDefaultScopes_KindAPIVersion = ClientDefaultScopes_Kind + "." + CRDGroupVersion.String() + ClientDefaultScopes_GroupVersionKind = CRDGroupVersion.WithKind(ClientDefaultScopes_Kind) +) + +func init() { + SchemeBuilder.Register(&ClientDefaultScopes{}, &ClientDefaultScopesList{}) +} diff --git a/apis/openidclient/v1alpha1/zz_clientscope_types.go b/apis/openidclient/v1alpha1/zz_clientscope_types.go new file mode 100755 index 0000000..75c989e --- /dev/null +++ b/apis/openidclient/v1alpha1/zz_clientscope_types.go @@ -0,0 +1,97 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ClientScopeObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type ClientScopeParameters struct { + + // +kubebuilder:validation:Optional + ConsentScreenText *string `json:"consentScreenText,omitempty" tf:"consent_screen_text,omitempty"` + + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // +kubebuilder:validation:Optional + GuiOrder *float64 `json:"guiOrder,omitempty" tf:"gui_order,omitempty"` + + // +kubebuilder:validation:Optional + IncludeInTokenScope *bool `json:"includeInTokenScope,omitempty" tf:"include_in_token_scope,omitempty"` + + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` +} + +// ClientScopeSpec defines the desired state of ClientScope +type ClientScopeSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ClientScopeParameters `json:"forProvider"` +} + +// ClientScopeStatus defines the observed state of ClientScope. +type ClientScopeStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ClientScopeObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClientScope is the Schema for the ClientScopes API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type ClientScope struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ClientScopeSpec `json:"spec"` + Status ClientScopeStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClientScopeList contains a list of ClientScopes +type ClientScopeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClientScope `json:"items"` +} + +// Repository type metadata. +var ( + ClientScope_Kind = "ClientScope" + ClientScope_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ClientScope_Kind}.String() + ClientScope_KindAPIVersion = ClientScope_Kind + "." + CRDGroupVersion.String() + ClientScope_GroupVersionKind = CRDGroupVersion.WithKind(ClientScope_Kind) +) + +func init() { + SchemeBuilder.Register(&ClientScope{}, &ClientScopeList{}) +} diff --git a/apis/openidclient/v1alpha1/zz_generated.deepcopy.go b/apis/openidclient/v1alpha1/zz_generated.deepcopy.go index 709d0ad..88a023c 100644 --- a/apis/openidclient/v1alpha1/zz_generated.deepcopy.go +++ b/apis/openidclient/v1alpha1/zz_generated.deepcopy.go @@ -131,6 +131,175 @@ func (in *Client) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientDefaultScopes) DeepCopyInto(out *ClientDefaultScopes) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientDefaultScopes. +func (in *ClientDefaultScopes) DeepCopy() *ClientDefaultScopes { + if in == nil { + return nil + } + out := new(ClientDefaultScopes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClientDefaultScopes) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientDefaultScopesList) DeepCopyInto(out *ClientDefaultScopesList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClientDefaultScopes, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientDefaultScopesList. +func (in *ClientDefaultScopesList) DeepCopy() *ClientDefaultScopesList { + if in == nil { + return nil + } + out := new(ClientDefaultScopesList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClientDefaultScopesList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientDefaultScopesObservation) DeepCopyInto(out *ClientDefaultScopesObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientDefaultScopesObservation. +func (in *ClientDefaultScopesObservation) DeepCopy() *ClientDefaultScopesObservation { + if in == nil { + return nil + } + out := new(ClientDefaultScopesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientDefaultScopesParameters) DeepCopyInto(out *ClientDefaultScopesParameters) { + *out = *in + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ClientIDRef != nil { + in, out := &in.ClientIDRef, &out.ClientIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClientIDSelector != nil { + in, out := &in.ClientIDSelector, &out.ClientIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.DefaultScopes != nil { + in, out := &in.DefaultScopes, &out.DefaultScopes + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientDefaultScopesParameters. +func (in *ClientDefaultScopesParameters) DeepCopy() *ClientDefaultScopesParameters { + if in == nil { + return nil + } + out := new(ClientDefaultScopesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientDefaultScopesSpec) DeepCopyInto(out *ClientDefaultScopesSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientDefaultScopesSpec. +func (in *ClientDefaultScopesSpec) DeepCopy() *ClientDefaultScopesSpec { + if in == nil { + return nil + } + out := new(ClientDefaultScopesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientDefaultScopesStatus) DeepCopyInto(out *ClientDefaultScopesStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientDefaultScopesStatus. +func (in *ClientDefaultScopesStatus) DeepCopy() *ClientDefaultScopesStatus { + if in == nil { + return nil + } + out := new(ClientDefaultScopesStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClientList) DeepCopyInto(out *ClientList) { *out = *in @@ -255,6 +424,16 @@ func (in *ClientParameters) DeepCopyInto(out *ClientParameters) { *out = new(string) **out = **in } + if in.ClientIDRef != nil { + in, out := &in.ClientIDRef, &out.ClientIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClientIDSelector != nil { + in, out := &in.ClientIDSelector, &out.ClientIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.ClientOfflineSessionIdleTimeout != nil { in, out := &in.ClientOfflineSessionIdleTimeout, &out.ClientOfflineSessionIdleTimeout *out = new(string) @@ -390,6 +569,16 @@ func (in *ClientParameters) DeepCopyInto(out *ClientParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.RootURL != nil { in, out := &in.RootURL, &out.RootURL *out = new(string) @@ -460,6 +649,174 @@ func (in *ClientParameters) DeepCopy() *ClientParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientScope) DeepCopyInto(out *ClientScope) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientScope. +func (in *ClientScope) DeepCopy() *ClientScope { + if in == nil { + return nil + } + out := new(ClientScope) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClientScope) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientScopeList) DeepCopyInto(out *ClientScopeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClientScope, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientScopeList. +func (in *ClientScopeList) DeepCopy() *ClientScopeList { + if in == nil { + return nil + } + out := new(ClientScopeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClientScopeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientScopeObservation) DeepCopyInto(out *ClientScopeObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientScopeObservation. +func (in *ClientScopeObservation) DeepCopy() *ClientScopeObservation { + if in == nil { + return nil + } + out := new(ClientScopeObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientScopeParameters) DeepCopyInto(out *ClientScopeParameters) { + *out = *in + if in.ConsentScreenText != nil { + in, out := &in.ConsentScreenText, &out.ConsentScreenText + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.GuiOrder != nil { + in, out := &in.GuiOrder, &out.GuiOrder + *out = new(float64) + **out = **in + } + if in.IncludeInTokenScope != nil { + in, out := &in.IncludeInTokenScope, &out.IncludeInTokenScope + *out = new(bool) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientScopeParameters. +func (in *ClientScopeParameters) DeepCopy() *ClientScopeParameters { + if in == nil { + return nil + } + out := new(ClientScopeParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientScopeSpec) DeepCopyInto(out *ClientScopeSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientScopeSpec. +func (in *ClientScopeSpec) DeepCopy() *ClientScopeSpec { + if in == nil { + return nil + } + out := new(ClientScopeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientScopeStatus) DeepCopyInto(out *ClientScopeStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientScopeStatus. +func (in *ClientScopeStatus) DeepCopy() *ClientScopeStatus { + if in == nil { + return nil + } + out := new(ClientScopeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClientSpec) DeepCopyInto(out *ClientSpec) { *out = *in diff --git a/apis/openidclient/v1alpha1/zz_generated.managed.go b/apis/openidclient/v1alpha1/zz_generated.managed.go index deca390..90a9d7a 100644 --- a/apis/openidclient/v1alpha1/zz_generated.managed.go +++ b/apis/openidclient/v1alpha1/zz_generated.managed.go @@ -82,3 +82,155 @@ func (mg *Client) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetails func (mg *Client) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this ClientDefaultScopes. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *ClientDefaultScopes) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this ClientDefaultScopes. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *ClientDefaultScopes) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this ClientScope. +func (mg *ClientScope) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ClientScope. +func (mg *ClientScope) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this ClientScope. +func (mg *ClientScope) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this ClientScope. +func (mg *ClientScope) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this ClientScope. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *ClientScope) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this ClientScope. +func (mg *ClientScope) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ClientScope. +func (mg *ClientScope) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ClientScope. +func (mg *ClientScope) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ClientScope. +func (mg *ClientScope) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this ClientScope. +func (mg *ClientScope) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this ClientScope. +func (mg *ClientScope) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this ClientScope. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *ClientScope) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this ClientScope. +func (mg *ClientScope) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ClientScope. +func (mg *ClientScope) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/openidclient/v1alpha1/zz_generated.managedlist.go b/apis/openidclient/v1alpha1/zz_generated.managedlist.go index e6636db..a96d30a 100644 --- a/apis/openidclient/v1alpha1/zz_generated.managedlist.go +++ b/apis/openidclient/v1alpha1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this ClientDefaultScopesList. +func (l *ClientDefaultScopesList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this ClientList. func (l *ClientList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) @@ -15,3 +24,12 @@ func (l *ClientList) GetItems() []resource.Managed { } return items } + +// GetItems of this ClientScopeList. +func (l *ClientScopeList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/openidclient/v1alpha1/zz_generated.resolvers.go b/apis/openidclient/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..75e7085 --- /dev/null +++ b/apis/openidclient/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,124 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this Client. +func (mg *Client) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClientID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClientIDRef, + Selector: mg.Spec.ForProvider.ClientIDSelector, + To: reference.To{ + List: &ClientList{}, + Managed: &Client{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClientID") + } + mg.Spec.ForProvider.ClientID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClientIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha1.RealmList{}, + Managed: &v1alpha1.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this ClientDefaultScopes. +func (mg *ClientDefaultScopes) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClientID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClientIDRef, + Selector: mg.Spec.ForProvider.ClientIDSelector, + To: reference.To{ + List: &ClientList{}, + Managed: &Client{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClientID") + } + mg.Spec.ForProvider.ClientID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClientIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha1.RealmList{}, + Managed: &v1alpha1.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this ClientScope. +func (mg *ClientScope) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha1.RealmList{}, + Managed: &v1alpha1.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/openidclient/v1alpha1/zz_generated_terraformed.go b/apis/openidclient/v1alpha1/zz_generated_terraformed.go index 741a6ae..7bd487e 100755 --- a/apis/openidclient/v1alpha1/zz_generated_terraformed.go +++ b/apis/openidclient/v1alpha1/zz_generated_terraformed.go @@ -86,3 +86,151 @@ func (tr *Client) LateInitialize(attrs []byte) (bool, error) { func (tr *Client) GetTerraformSchemaVersion() int { return 0 } + +// GetTerraformResourceType returns Terraform resource type for this ClientDefaultScopes +func (mg *ClientDefaultScopes) GetTerraformResourceType() string { + return "keycloak_openid_client_default_scopes" +} + +// GetConnectionDetailsMapping for this ClientDefaultScopes +func (tr *ClientDefaultScopes) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this ClientDefaultScopes +func (tr *ClientDefaultScopes) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this ClientDefaultScopes +func (tr *ClientDefaultScopes) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this ClientDefaultScopes +func (tr *ClientDefaultScopes) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ClientDefaultScopes +func (tr *ClientDefaultScopes) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this ClientDefaultScopes +func (tr *ClientDefaultScopes) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this ClientDefaultScopes using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ClientDefaultScopes) LateInitialize(attrs []byte) (bool, error) { + params := &ClientDefaultScopesParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *ClientDefaultScopes) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this ClientScope +func (mg *ClientScope) GetTerraformResourceType() string { + return "keycloak_openid_client_scope" +} + +// GetConnectionDetailsMapping for this ClientScope +func (tr *ClientScope) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this ClientScope +func (tr *ClientScope) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this ClientScope +func (tr *ClientScope) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this ClientScope +func (tr *ClientScope) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ClientScope +func (tr *ClientScope) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this ClientScope +func (tr *ClientScope) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this ClientScope using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ClientScope) LateInitialize(attrs []byte) (bool, error) { + params := &ClientScopeParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *ClientScope) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/openidgroup/v1alpha1/zz_generated.deepcopy.go b/apis/openidgroup/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..be8e069 --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,208 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupMembershipProtocolMapper) DeepCopyInto(out *GroupMembershipProtocolMapper) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMembershipProtocolMapper. +func (in *GroupMembershipProtocolMapper) DeepCopy() *GroupMembershipProtocolMapper { + if in == nil { + return nil + } + out := new(GroupMembershipProtocolMapper) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GroupMembershipProtocolMapper) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupMembershipProtocolMapperList) DeepCopyInto(out *GroupMembershipProtocolMapperList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GroupMembershipProtocolMapper, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMembershipProtocolMapperList. +func (in *GroupMembershipProtocolMapperList) DeepCopy() *GroupMembershipProtocolMapperList { + if in == nil { + return nil + } + out := new(GroupMembershipProtocolMapperList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GroupMembershipProtocolMapperList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupMembershipProtocolMapperObservation) DeepCopyInto(out *GroupMembershipProtocolMapperObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMembershipProtocolMapperObservation. +func (in *GroupMembershipProtocolMapperObservation) DeepCopy() *GroupMembershipProtocolMapperObservation { + if in == nil { + return nil + } + out := new(GroupMembershipProtocolMapperObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupMembershipProtocolMapperParameters) DeepCopyInto(out *GroupMembershipProtocolMapperParameters) { + *out = *in + if in.AddToAccessToken != nil { + in, out := &in.AddToAccessToken, &out.AddToAccessToken + *out = new(bool) + **out = **in + } + if in.AddToIDToken != nil { + in, out := &in.AddToIDToken, &out.AddToIDToken + *out = new(bool) + **out = **in + } + if in.AddToUserinfo != nil { + in, out := &in.AddToUserinfo, &out.AddToUserinfo + *out = new(bool) + **out = **in + } + if in.ClaimName != nil { + in, out := &in.ClaimName, &out.ClaimName + *out = new(string) + **out = **in + } + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ClientIDRef != nil { + in, out := &in.ClientIDRef, &out.ClientIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClientIDSelector != nil { + in, out := &in.ClientIDSelector, &out.ClientIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.ClientScopeID != nil { + in, out := &in.ClientScopeID, &out.ClientScopeID + *out = new(string) + **out = **in + } + if in.FullPath != nil { + in, out := &in.FullPath, &out.FullPath + *out = new(bool) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMembershipProtocolMapperParameters. +func (in *GroupMembershipProtocolMapperParameters) DeepCopy() *GroupMembershipProtocolMapperParameters { + if in == nil { + return nil + } + out := new(GroupMembershipProtocolMapperParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupMembershipProtocolMapperSpec) DeepCopyInto(out *GroupMembershipProtocolMapperSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMembershipProtocolMapperSpec. +func (in *GroupMembershipProtocolMapperSpec) DeepCopy() *GroupMembershipProtocolMapperSpec { + if in == nil { + return nil + } + out := new(GroupMembershipProtocolMapperSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupMembershipProtocolMapperStatus) DeepCopyInto(out *GroupMembershipProtocolMapperStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMembershipProtocolMapperStatus. +func (in *GroupMembershipProtocolMapperStatus) DeepCopy() *GroupMembershipProtocolMapperStatus { + if in == nil { + return nil + } + out := new(GroupMembershipProtocolMapperStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/openidgroup/v1alpha1/zz_generated.managed.go b/apis/openidgroup/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..a30753d --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_generated.managed.go @@ -0,0 +1,84 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this GroupMembershipProtocolMapper. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *GroupMembershipProtocolMapper) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this GroupMembershipProtocolMapper. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *GroupMembershipProtocolMapper) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/openidgroup/v1alpha1/zz_generated.managedlist.go b/apis/openidgroup/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..cc84690 --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,17 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this GroupMembershipProtocolMapperList. +func (l *GroupMembershipProtocolMapperList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/openidgroup/v1alpha1/zz_generated.resolvers.go b/apis/openidgroup/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..456c975 --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,57 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1" + v1alpha11 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this GroupMembershipProtocolMapper. +func (mg *GroupMembershipProtocolMapper) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClientID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClientIDRef, + Selector: mg.Spec.ForProvider.ClientIDSelector, + To: reference.To{ + List: &v1alpha1.ClientList{}, + Managed: &v1alpha1.Client{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClientID") + } + mg.Spec.ForProvider.ClientID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClientIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha11.RealmList{}, + Managed: &v1alpha11.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/openidgroup/v1alpha1/zz_generated_terraformed.go b/apis/openidgroup/v1alpha1/zz_generated_terraformed.go new file mode 100755 index 0000000..62c9982 --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_generated_terraformed.go @@ -0,0 +1,88 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/pkg/errors" + + "github.com/upbound/upjet/pkg/resource" + "github.com/upbound/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this GroupMembershipProtocolMapper +func (mg *GroupMembershipProtocolMapper) GetTerraformResourceType() string { + return "keycloak_openid_group_membership_protocol_mapper" +} + +// GetConnectionDetailsMapping for this GroupMembershipProtocolMapper +func (tr *GroupMembershipProtocolMapper) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this GroupMembershipProtocolMapper +func (tr *GroupMembershipProtocolMapper) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this GroupMembershipProtocolMapper +func (tr *GroupMembershipProtocolMapper) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this GroupMembershipProtocolMapper +func (tr *GroupMembershipProtocolMapper) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this GroupMembershipProtocolMapper +func (tr *GroupMembershipProtocolMapper) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this GroupMembershipProtocolMapper +func (tr *GroupMembershipProtocolMapper) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this GroupMembershipProtocolMapper using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *GroupMembershipProtocolMapper) LateInitialize(attrs []byte) (bool, error) { + params := &GroupMembershipProtocolMapperParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *GroupMembershipProtocolMapper) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/openidgroup/v1alpha1/zz_groupmembershipprotocolmapper_types.go b/apis/openidgroup/v1alpha1/zz_groupmembershipprotocolmapper_types.go new file mode 100755 index 0000000..bf98740 --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_groupmembershipprotocolmapper_types.go @@ -0,0 +1,119 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type GroupMembershipProtocolMapperObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type GroupMembershipProtocolMapperParameters struct { + + // +kubebuilder:validation:Optional + AddToAccessToken *bool `json:"addToAccessToken,omitempty" tf:"add_to_access_token,omitempty"` + + // +kubebuilder:validation:Optional + AddToIDToken *bool `json:"addToIdToken,omitempty" tf:"add_to_id_token,omitempty"` + + // +kubebuilder:validation:Optional + AddToUserinfo *bool `json:"addToUserinfo,omitempty" tf:"add_to_userinfo,omitempty"` + + // +kubebuilder:validation:Required + ClaimName *string `json:"claimName" tf:"claim_name,omitempty"` + + // The mapper's associated client. Cannot be used at the same time as client_scope_id. + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.Client + // +kubebuilder:validation:Optional + ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + + // Reference to a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDRef *v1.Reference `json:"clientIdRef,omitempty" tf:"-"` + + // Selector for a Client in openidclient to populate clientId. + // +kubebuilder:validation:Optional + ClientIDSelector *v1.Selector `json:"clientIdSelector,omitempty" tf:"-"` + + // The mapper's associated client scope. Cannot be used at the same time as client_id. + // +kubebuilder:validation:Optional + ClientScopeID *string `json:"clientScopeId,omitempty" tf:"client_scope_id,omitempty"` + + // +kubebuilder:validation:Optional + FullPath *bool `json:"fullPath,omitempty" tf:"full_path,omitempty"` + + // A human-friendly name that will appear in the Keycloak console. + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // The realm id where the associated client or client scope exists. + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` +} + +// GroupMembershipProtocolMapperSpec defines the desired state of GroupMembershipProtocolMapper +type GroupMembershipProtocolMapperSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider GroupMembershipProtocolMapperParameters `json:"forProvider"` +} + +// GroupMembershipProtocolMapperStatus defines the observed state of GroupMembershipProtocolMapper. +type GroupMembershipProtocolMapperStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider GroupMembershipProtocolMapperObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// GroupMembershipProtocolMapper is the Schema for the GroupMembershipProtocolMappers API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type GroupMembershipProtocolMapper struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec GroupMembershipProtocolMapperSpec `json:"spec"` + Status GroupMembershipProtocolMapperStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GroupMembershipProtocolMapperList contains a list of GroupMembershipProtocolMappers +type GroupMembershipProtocolMapperList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GroupMembershipProtocolMapper `json:"items"` +} + +// Repository type metadata. +var ( + GroupMembershipProtocolMapper_Kind = "GroupMembershipProtocolMapper" + GroupMembershipProtocolMapper_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: GroupMembershipProtocolMapper_Kind}.String() + GroupMembershipProtocolMapper_KindAPIVersion = GroupMembershipProtocolMapper_Kind + "." + CRDGroupVersion.String() + GroupMembershipProtocolMapper_GroupVersionKind = CRDGroupVersion.WithKind(GroupMembershipProtocolMapper_Kind) +) + +func init() { + SchemeBuilder.Register(&GroupMembershipProtocolMapper{}, &GroupMembershipProtocolMapperList{}) +} diff --git a/apis/openidgroup/v1alpha1/zz_groupversion_info.go b/apis/openidgroup/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..243e160 --- /dev/null +++ b/apis/openidgroup/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=openidgroup.keycloak.crossplane.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "openidgroup.keycloak.crossplane.io" + CRDVersion = "v1alpha1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/role/v1alpha1/zz_generated.deepcopy.go b/apis/role/v1alpha1/zz_generated.deepcopy.go index 2828017..5311f7f 100644 --- a/apis/role/v1alpha1/zz_generated.deepcopy.go +++ b/apis/role/v1alpha1/zz_generated.deepcopy.go @@ -164,6 +164,16 @@ func (in *RoleParameters) DeepCopyInto(out *RoleParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleParameters. diff --git a/apis/role/v1alpha1/zz_generated.resolvers.go b/apis/role/v1alpha1/zz_generated.resolvers.go index 352ed79..5a51a63 100644 --- a/apis/role/v1alpha1/zz_generated.resolvers.go +++ b/apis/role/v1alpha1/zz_generated.resolvers.go @@ -8,6 +8,7 @@ package v1alpha1 import ( "context" v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1" + v1alpha11 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" reference "github.com/crossplane/crossplane-runtime/pkg/reference" errors "github.com/pkg/errors" client "sigs.k8s.io/controller-runtime/pkg/client" @@ -53,5 +54,21 @@ func (mg *Role) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.CompositeRoles = reference.ToPtrValues(mrsp.ResolvedValues) mg.Spec.ForProvider.CompositeRolesRefs = mrsp.ResolvedReferences + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha11.RealmList{}, + Managed: &v1alpha11.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/role/v1alpha1/zz_role_types.go b/apis/role/v1alpha1/zz_role_types.go index 7860b11..259021b 100755 --- a/apis/role/v1alpha1/zz_role_types.go +++ b/apis/role/v1alpha1/zz_role_types.go @@ -52,8 +52,17 @@ type RoleParameters struct { // +kubebuilder:validation:Required Name *string `json:"name" tf:"name,omitempty"` - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` } // RoleSpec defines the desired state of Role diff --git a/apis/user/v1alpha1/zz_generated.deepcopy.go b/apis/user/v1alpha1/zz_generated.deepcopy.go index 2989457..11054f1 100644 --- a/apis/user/v1alpha1/zz_generated.deepcopy.go +++ b/apis/user/v1alpha1/zz_generated.deepcopy.go @@ -10,6 +10,7 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -58,6 +59,192 @@ func (in *FederatedIdentityParameters) DeepCopy() *FederatedIdentityParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Groups) DeepCopyInto(out *Groups) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Groups. +func (in *Groups) DeepCopy() *Groups { + if in == nil { + return nil + } + out := new(Groups) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Groups) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupsList) DeepCopyInto(out *GroupsList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Groups, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupsList. +func (in *GroupsList) DeepCopy() *GroupsList { + if in == nil { + return nil + } + out := new(GroupsList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GroupsList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupsObservation) DeepCopyInto(out *GroupsObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupsObservation. +func (in *GroupsObservation) DeepCopy() *GroupsObservation { + if in == nil { + return nil + } + out := new(GroupsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupsParameters) DeepCopyInto(out *GroupsParameters) { + *out = *in + if in.Exhaustive != nil { + in, out := &in.Exhaustive, &out.Exhaustive + *out = new(bool) + **out = **in + } + if in.GroupIds != nil { + in, out := &in.GroupIds, &out.GroupIds + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.GroupIdsRefs != nil { + in, out := &in.GroupIdsRefs, &out.GroupIdsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.GroupIdsSelector != nil { + in, out := &in.GroupIdsSelector, &out.GroupIdsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.UserID != nil { + in, out := &in.UserID, &out.UserID + *out = new(string) + **out = **in + } + if in.UserIDRef != nil { + in, out := &in.UserIDRef, &out.UserIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.UserIDSelector != nil { + in, out := &in.UserIDSelector, &out.UserIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupsParameters. +func (in *GroupsParameters) DeepCopy() *GroupsParameters { + if in == nil { + return nil + } + out := new(GroupsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupsSpec) DeepCopyInto(out *GroupsSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupsSpec. +func (in *GroupsSpec) DeepCopy() *GroupsSpec { + if in == nil { + return nil + } + out := new(GroupsSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupsStatus) DeepCopyInto(out *GroupsStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupsStatus. +func (in *GroupsStatus) DeepCopy() *GroupsStatus { + if in == nil { + return nil + } + out := new(GroupsStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InitialPasswordObservation) DeepCopyInto(out *InitialPasswordObservation) { *out = *in @@ -235,6 +422,16 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { *out = new(string) **out = **in } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Username != nil { in, out := &in.Username, &out.Username *out = new(string) diff --git a/apis/user/v1alpha1/zz_generated.managed.go b/apis/user/v1alpha1/zz_generated.managed.go index 69c0512..4ae4579 100644 --- a/apis/user/v1alpha1/zz_generated.managed.go +++ b/apis/user/v1alpha1/zz_generated.managed.go @@ -7,6 +7,82 @@ package v1alpha1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this Groups. +func (mg *Groups) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Groups. +func (mg *Groups) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Groups. +func (mg *Groups) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Groups. +func (mg *Groups) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Groups. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Groups) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Groups. +func (mg *Groups) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Groups. +func (mg *Groups) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Groups. +func (mg *Groups) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Groups. +func (mg *Groups) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Groups. +func (mg *Groups) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Groups. +func (mg *Groups) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Groups. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Groups) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Groups. +func (mg *Groups) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Groups. +func (mg *Groups) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this User. func (mg *User) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/user/v1alpha1/zz_generated.managedlist.go b/apis/user/v1alpha1/zz_generated.managedlist.go index 04d8084..235a75c 100644 --- a/apis/user/v1alpha1/zz_generated.managedlist.go +++ b/apis/user/v1alpha1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this GroupsList. +func (l *GroupsList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this UserList. func (l *UserList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/user/v1alpha1/zz_generated.resolvers.go b/apis/user/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..3690998 --- /dev/null +++ b/apis/user/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,100 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/group/v1alpha1" + v1alpha11 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this Groups. +func (mg *Groups) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse + var err error + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.GroupIds), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.GroupIdsRefs, + Selector: mg.Spec.ForProvider.GroupIdsSelector, + To: reference.To{ + List: &v1alpha1.GroupList{}, + Managed: &v1alpha1.Group{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.GroupIds") + } + mg.Spec.ForProvider.GroupIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.GroupIdsRefs = mrsp.ResolvedReferences + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha11.RealmList{}, + Managed: &v1alpha11.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.UserID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.UserIDRef, + Selector: mg.Spec.ForProvider.UserIDSelector, + To: reference.To{ + List: &UserList{}, + Managed: &User{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.UserID") + } + mg.Spec.ForProvider.UserID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.UserIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this User. +func (mg *User) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &v1alpha11.RealmList{}, + Managed: &v1alpha11.Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/user/v1alpha1/zz_generated_terraformed.go b/apis/user/v1alpha1/zz_generated_terraformed.go index 341f415..5b5ef2d 100755 --- a/apis/user/v1alpha1/zz_generated_terraformed.go +++ b/apis/user/v1alpha1/zz_generated_terraformed.go @@ -86,3 +86,77 @@ func (tr *User) LateInitialize(attrs []byte) (bool, error) { func (tr *User) GetTerraformSchemaVersion() int { return 0 } + +// GetTerraformResourceType returns Terraform resource type for this Groups +func (mg *Groups) GetTerraformResourceType() string { + return "keycloak_user_groups" +} + +// GetConnectionDetailsMapping for this Groups +func (tr *Groups) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Groups +func (tr *Groups) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Groups +func (tr *Groups) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Groups +func (tr *Groups) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Groups +func (tr *Groups) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Groups +func (tr *Groups) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Groups using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Groups) LateInitialize(attrs []byte) (bool, error) { + params := &GroupsParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Groups) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/user/v1alpha1/zz_groups_types.go b/apis/user/v1alpha1/zz_groups_types.go new file mode 100755 index 0000000..0f87cdb --- /dev/null +++ b/apis/user/v1alpha1/zz_groups_types.go @@ -0,0 +1,109 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type GroupsObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type GroupsParameters struct { + + // +kubebuilder:validation:Optional + Exhaustive *bool `json:"exhaustive,omitempty" tf:"exhaustive,omitempty"` + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/group/v1alpha1.Group + // +kubebuilder:validation:Optional + GroupIds []*string `json:"groupIds,omitempty" tf:"group_ids,omitempty"` + + // References to Group in group to populate groupIds. + // +kubebuilder:validation:Optional + GroupIdsRefs []v1.Reference `json:"groupIdsRefs,omitempty" tf:"-"` + + // Selector for a list of Group in group to populate groupIds. + // +kubebuilder:validation:Optional + GroupIdsSelector *v1.Selector `json:"groupIdsSelector,omitempty" tf:"-"` + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` + + // +crossplane:generate:reference:type=User + // +kubebuilder:validation:Optional + UserID *string `json:"userId,omitempty" tf:"user_id,omitempty"` + + // Reference to a User to populate userId. + // +kubebuilder:validation:Optional + UserIDRef *v1.Reference `json:"userIdRef,omitempty" tf:"-"` + + // Selector for a User to populate userId. + // +kubebuilder:validation:Optional + UserIDSelector *v1.Selector `json:"userIdSelector,omitempty" tf:"-"` +} + +// GroupsSpec defines the desired state of Groups +type GroupsSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider GroupsParameters `json:"forProvider"` +} + +// GroupsStatus defines the observed state of Groups. +type GroupsStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider GroupsObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Groups is the Schema for the Groupss API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type Groups struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec GroupsSpec `json:"spec"` + Status GroupsStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GroupsList contains a list of Groupss +type GroupsList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Groups `json:"items"` +} + +// Repository type metadata. +var ( + Groups_Kind = "Groups" + Groups_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Groups_Kind}.String() + Groups_KindAPIVersion = Groups_Kind + "." + CRDGroupVersion.String() + Groups_GroupVersionKind = CRDGroupVersion.WithKind(Groups_Kind) +) + +func init() { + SchemeBuilder.Register(&Groups{}, &GroupsList{}) +} diff --git a/apis/user/v1alpha1/zz_user_types.go b/apis/user/v1alpha1/zz_user_types.go index db51a67..0aeb961 100755 --- a/apis/user/v1alpha1/zz_user_types.go +++ b/apis/user/v1alpha1/zz_user_types.go @@ -70,8 +70,17 @@ type UserParameters struct { // +kubebuilder:validation:Optional LastName *string `json:"lastName,omitempty" tf:"last_name,omitempty"` - // +kubebuilder:validation:Required - RealmID *string `json:"realmId" tf:"realm_id,omitempty"` + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` // +kubebuilder:validation:Required Username *string `json:"username" tf:"username,omitempty"` diff --git a/apis/zz_register.go b/apis/zz_register.go index ade1299..c497b2a 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -13,6 +13,7 @@ import ( v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/client/v1alpha1" v1alpha1group "github.com/crossplane-contrib/provider-keycloak/apis/group/v1alpha1" v1alpha1openidclient "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1" + v1alpha1openidgroup "github.com/crossplane-contrib/provider-keycloak/apis/openidgroup/v1alpha1" v1alpha1realm "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" v1alpha1role "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1" v1alpha1user "github.com/crossplane-contrib/provider-keycloak/apis/user/v1alpha1" @@ -26,6 +27,7 @@ func init() { v1alpha1.SchemeBuilder.AddToScheme, v1alpha1group.SchemeBuilder.AddToScheme, v1alpha1openidclient.SchemeBuilder.AddToScheme, + v1alpha1openidgroup.SchemeBuilder.AddToScheme, v1alpha1realm.SchemeBuilder.AddToScheme, v1alpha1role.SchemeBuilder.AddToScheme, v1alpha1user.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index c520a42..bb557e5 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -10,15 +10,19 @@ import "github.com/upbound/upjet/pkg/config" // provider. var ExternalNameConfigs = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: nl-2e21sda - "keycloak_group": config.IdentifierFromProvider, - "keycloak_group_memberships": config.IdentifierFromProvider, - "keycloak_group_roles": config.IdentifierFromProvider, - "keycloak_openid_client": config.IdentifierFromProvider, - "keycloak_realm": config.IdentifierFromProvider, - "keycloak_role": config.IdentifierFromProvider, - "keycloak_generic_protocol_mapper": config.IdentifierFromProvider, - "keycloak_generic_role_mapper": config.IdentifierFromProvider, - "keycloak_user": config.IdentifierFromProvider, + "keycloak_generic_protocol_mapper": config.IdentifierFromProvider, + "keycloak_generic_role_mapper": config.IdentifierFromProvider, + "keycloak_group_memberships": config.IdentifierFromProvider, + "keycloak_group_roles": config.IdentifierFromProvider, + "keycloak_group": config.IdentifierFromProvider, + "keycloak_openid_client_default_scopes": config.IdentifierFromProvider, + "keycloak_openid_client_scope": config.IdentifierFromProvider, + "keycloak_openid_client": config.IdentifierFromProvider, + "keycloak_openid_group_membership_protocol_mapper": config.IdentifierFromProvider, + "keycloak_realm": config.IdentifierFromProvider, + "keycloak_role": config.IdentifierFromProvider, + "keycloak_user_groups": config.IdentifierFromProvider, + "keycloak_user": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/mapper/config.go b/config/mapper/config.go index f30bdf3..0149f34 100644 --- a/config/mapper/config.go +++ b/config/mapper/config.go @@ -11,10 +11,6 @@ func Configure(p *config.Provider) { p.AddResourceConfigurator("keycloak_generic_role_mapper", func(r *config.Resource) { r.ShortGroup = "client" - r.References["client_id"] = config.Reference{ - Type: "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.Client", - } - r.References["role_id"] = config.Reference{ Type: "github.com/crossplane-contrib/provider-keycloak/apis/role/v1alpha1.Role", } diff --git a/config/openidclient/config.go b/config/openidclient/config.go index d343726..df2fa29 100644 --- a/config/openidclient/config.go +++ b/config/openidclient/config.go @@ -8,4 +8,14 @@ func Configure(p *config.Provider) { // We need to override the default group that upjet generated for r.ShortGroup = "openidclient" }) + + p.AddResourceConfigurator("keycloak_openid_client_default_scopes", func(r *config.Resource) { + // We need to override the default group that upjet generated for + r.ShortGroup = "openidclient" + }) + + p.AddResourceConfigurator("keycloak_openid_client_scope", func(r *config.Resource) { + // We need to override the default group that upjet generated for + r.ShortGroup = "openidclient" + }) } diff --git a/config/openidgroup/config.go b/config/openidgroup/config.go new file mode 100644 index 0000000..a6b1738 --- /dev/null +++ b/config/openidgroup/config.go @@ -0,0 +1,11 @@ +package openidgroup + +import "github.com/upbound/upjet/pkg/config" + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("keycloak_openid_group_membership_protocol_mapper", func(r *config.Resource) { + // We need to override the default group that upjet generated for + r.ShortGroup = "openidgroup" + }) +} diff --git a/config/provider.go b/config/provider.go index b41db4f..1f672eb 100644 --- a/config/provider.go +++ b/config/provider.go @@ -8,11 +8,13 @@ import ( // Note(turkenh): we are importing this to embed provider schema document _ "embed" + "github.com/upbound/upjet/pkg/config" ujconfig "github.com/upbound/upjet/pkg/config" "github.com/crossplane-contrib/provider-keycloak/config/group" "github.com/crossplane-contrib/provider-keycloak/config/mapper" "github.com/crossplane-contrib/provider-keycloak/config/openidclient" + "github.com/crossplane-contrib/provider-keycloak/config/openidgroup" "github.com/crossplane-contrib/provider-keycloak/config/realm" "github.com/crossplane-contrib/provider-keycloak/config/role" "github.com/crossplane-contrib/provider-keycloak/config/user" @@ -34,7 +36,10 @@ var providerMetadata string func GetProvider() *ujconfig.Provider { pc := ujconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), ujconfig.WithIncludeList(ExternalNameConfigured()), - ujconfig.WithDefaultResourceOptions(ExternalNameConfigurations()), + ujconfig.WithDefaultResourceOptions( + ExternalNameConfigurations(), + KnownReferencers(), + ), ujconfig.WithRootGroup(rootGroup)) for _, configure := range []func(provider *ujconfig.Provider){ @@ -43,6 +48,7 @@ func GetProvider() *ujconfig.Provider { group.Configure, role.Configure, openidclient.Configure, + openidgroup.Configure, mapper.Configure, user.Configure, } { @@ -52,3 +58,27 @@ func GetProvider() *ujconfig.Provider { pc.ConfigureResources() return pc } + +// KnownReferencers adds referencers for fields that are known and common among +// more than a few resources. +func KnownReferencers() config.ResourceOption { //nolint:gocyclo + return func(r *config.Resource) { + for k, s := range r.TerraformResource.Schema { + // We shouldn't add referencers for status fields and sensitive fields + // since they already have secret referencer. + if (s.Computed && !s.Optional) || s.Sensitive { + continue + } + switch k { + case "realm_id": + r.References["realm_id"] = config.Reference{ + Type: "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm", + } + case "client_id": + r.References["client_id"] = config.Reference{ + Type: "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1.Client", + } + } + } + } +} diff --git a/config/user/config.go b/config/user/config.go index 6a45696..51699d0 100644 --- a/config/user/config.go +++ b/config/user/config.go @@ -7,4 +7,16 @@ func Configure(p *config.Provider) { p.AddResourceConfigurator("keycloak_user", func(r *config.Resource) { r.ShortGroup = "user" }) + + p.AddResourceConfigurator("keycloak_user_groups", func(r *config.Resource) { + r.ShortGroup = "user" + + r.References["user_id"] = config.Reference{ + Type: "User", + } + + r.References["group_ids"] = config.Reference{ + Type: "github.com/crossplane-contrib/provider-keycloak/apis/group/v1alpha1.Group", + } + }) } diff --git a/internal/controller/openidclient/clientdefaultscopes/zz_controller.go b/internal/controller/openidclient/clientdefaultscopes/zz_controller.go new file mode 100755 index 0000000..32fd4df --- /dev/null +++ b/internal/controller/openidclient/clientdefaultscopes/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package clientdefaultscopes + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1" +) + +// Setup adds a controller that reconciles ClientDefaultScopes managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.ClientDefaultScopes_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha1.ClientDefaultScopes_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["keycloak_openid_client_default_scopes"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ClientDefaultScopes_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.ClientDefaultScopes{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/openidclient/clientscope/zz_controller.go b/internal/controller/openidclient/clientscope/zz_controller.go new file mode 100755 index 0000000..f0937a1 --- /dev/null +++ b/internal/controller/openidclient/clientscope/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package clientscope + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/openidclient/v1alpha1" +) + +// Setup adds a controller that reconciles ClientScope managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.ClientScope_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha1.ClientScope_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["keycloak_openid_client_scope"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ClientScope_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.ClientScope{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/openidgroup/groupmembershipprotocolmapper/zz_controller.go b/internal/controller/openidgroup/groupmembershipprotocolmapper/zz_controller.go new file mode 100755 index 0000000..8b2a23b --- /dev/null +++ b/internal/controller/openidgroup/groupmembershipprotocolmapper/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package groupmembershipprotocolmapper + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/openidgroup/v1alpha1" +) + +// Setup adds a controller that reconciles GroupMembershipProtocolMapper managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.GroupMembershipProtocolMapper_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha1.GroupMembershipProtocolMapper_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["keycloak_openid_group_membership_protocol_mapper"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.GroupMembershipProtocolMapper_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.GroupMembershipProtocolMapper{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/user/groups/zz_controller.go b/internal/controller/user/groups/zz_controller.go new file mode 100755 index 0000000..4402805 --- /dev/null +++ b/internal/controller/user/groups/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package groups + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/user/v1alpha1" +) + +// Setup adds a controller that reconciles Groups managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Groups_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha1.Groups_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["keycloak_user_groups"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Groups_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Groups{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 0a26f68..5b228fb 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -15,9 +15,13 @@ import ( memberships "github.com/crossplane-contrib/provider-keycloak/internal/controller/group/memberships" roles "github.com/crossplane-contrib/provider-keycloak/internal/controller/group/roles" client "github.com/crossplane-contrib/provider-keycloak/internal/controller/openidclient/client" + clientdefaultscopes "github.com/crossplane-contrib/provider-keycloak/internal/controller/openidclient/clientdefaultscopes" + clientscope "github.com/crossplane-contrib/provider-keycloak/internal/controller/openidclient/clientscope" + groupmembershipprotocolmapper "github.com/crossplane-contrib/provider-keycloak/internal/controller/openidgroup/groupmembershipprotocolmapper" providerconfig "github.com/crossplane-contrib/provider-keycloak/internal/controller/providerconfig" realm "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/realm" role "github.com/crossplane-contrib/provider-keycloak/internal/controller/role/role" + groups "github.com/crossplane-contrib/provider-keycloak/internal/controller/user/groups" user "github.com/crossplane-contrib/provider-keycloak/internal/controller/user/user" ) @@ -31,9 +35,13 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { memberships.Setup, roles.Setup, client.Setup, + clientdefaultscopes.Setup, + clientscope.Setup, + groupmembershipprotocolmapper.Setup, providerconfig.Setup, realm.Setup, role.Setup, + groups.Setup, user.Setup, } { if err := setup(mgr, o); err != nil { diff --git a/package/crds/client.keycloak.crossplane.io_protocolmappers.yaml b/package/crds/client.keycloak.crossplane.io_protocolmappers.yaml index ad8c8e1..66b05ff 100644 --- a/package/crds/client.keycloak.crossplane.io_protocolmappers.yaml +++ b/package/crds/client.keycloak.crossplane.io_protocolmappers.yaml @@ -71,6 +71,81 @@ spec: description: The mapper's associated client. Cannot be used at the same time as client_scope_id. type: string + clientIdRef: + description: Reference to a Client in openidclient to populate + clientId. + 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 + clientIdSelector: + description: Selector for a Client in openidclient to populate + clientId. + 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 clientScopeId: description: The mapper's associated client scope. Cannot be used at the same time as client_id. @@ -93,12 +168,84 @@ spec: description: The realm id where the associated client or client scope exists. type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 required: - config - name - protocol - protocolMapper - - realmId type: object managementPolicies: default: diff --git a/package/crds/client.keycloak.crossplane.io_rolemappers.yaml b/package/crds/client.keycloak.crossplane.io_rolemappers.yaml index 7eadb98..2466e18 100644 --- a/package/crds/client.keycloak.crossplane.io_rolemappers.yaml +++ b/package/crds/client.keycloak.crossplane.io_rolemappers.yaml @@ -153,6 +153,79 @@ spec: description: The realm id where the associated client or client scope exists. type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 roleId: description: Id of the role to assign type: string @@ -229,8 +302,6 @@ spec: type: string type: object type: object - required: - - realmId type: object managementPolicies: default: diff --git a/package/crds/group.keycloak.crossplane.io_groups.yaml b/package/crds/group.keycloak.crossplane.io_groups.yaml index 63af2aa..9bc17d3 100644 --- a/package/crds/group.keycloak.crossplane.io_groups.yaml +++ b/package/crds/group.keycloak.crossplane.io_groups.yaml @@ -76,9 +76,81 @@ spec: type: string realmId: type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 required: - name - - realmId type: object managementPolicies: default: diff --git a/package/crds/group.keycloak.crossplane.io_memberships.yaml b/package/crds/group.keycloak.crossplane.io_memberships.yaml index c75477f..bcec3c7 100644 --- a/package/crds/group.keycloak.crossplane.io_memberships.yaml +++ b/package/crds/group.keycloak.crossplane.io_memberships.yaml @@ -147,9 +147,81 @@ spec: type: array realmId: type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 required: - members - - realmId type: object managementPolicies: default: diff --git a/package/crds/group.keycloak.crossplane.io_roles.yaml b/package/crds/group.keycloak.crossplane.io_roles.yaml index a23005e..b53438b 100644 --- a/package/crds/group.keycloak.crossplane.io_roles.yaml +++ b/package/crds/group.keycloak.crossplane.io_roles.yaml @@ -145,6 +145,79 @@ spec: type: object realmId: type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 roleIds: items: type: string @@ -225,8 +298,6 @@ spec: type: string type: object type: object - required: - - realmId type: object managementPolicies: default: diff --git a/package/crds/openidclient.keycloak.crossplane.io_clientdefaultscopes.yaml b/package/crds/openidclient.keycloak.crossplane.io_clientdefaultscopes.yaml new file mode 100644 index 0000000..14bc146 --- /dev/null +++ b/package/crds/openidclient.keycloak.crossplane.io_clientdefaultscopes.yaml @@ -0,0 +1,474 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.12.1 + name: clientdefaultscopes.openidclient.keycloak.crossplane.io +spec: + group: openidclient.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: ClientDefaultScopes + listKind: ClientDefaultScopesList + plural: clientdefaultscopes + singular: clientdefaultscopes + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: ClientDefaultScopes is the Schema for the ClientDefaultScopess + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClientDefaultScopesSpec defines the desired state of ClientDefaultScopes + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + clientId: + type: string + clientIdRef: + description: Reference to a Client in openidclient to populate + clientId. + 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 + clientIdSelector: + description: Selector for a Client in openidclient to populate + clientId. + 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 + defaultScopes: + items: + type: string + type: array + realmId: + type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 + required: + - defaultScopes + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: ClientDefaultScopesStatus defines the observed state of ClientDefaultScopes. + properties: + atProvider: + properties: + id: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/openidclient.keycloak.crossplane.io_clients.yaml b/package/crds/openidclient.keycloak.crossplane.io_clients.yaml index 10a55e5..c74ec88 100644 --- a/package/crds/openidclient.keycloak.crossplane.io_clients.yaml +++ b/package/crds/openidclient.keycloak.crossplane.io_clients.yaml @@ -108,6 +108,81 @@ spec: type: string clientId: type: string + clientIdRef: + description: Reference to a Client in openidclient to populate + clientId. + 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 + clientIdSelector: + description: Selector for a Client in openidclient to populate + clientId. + 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 clientOfflineSessionIdleTimeout: type: string clientOfflineSessionMaxLifespan: @@ -176,6 +251,79 @@ spec: type: string realmId: type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 rootUrl: type: string serviceAccountsEnabled: @@ -200,8 +348,6 @@ spec: type: array required: - accessType - - clientId - - realmId type: object managementPolicies: default: diff --git a/package/crds/openidclient.keycloak.crossplane.io_clientscopes.yaml b/package/crds/openidclient.keycloak.crossplane.io_clientscopes.yaml new file mode 100644 index 0000000..6c68b74 --- /dev/null +++ b/package/crds/openidclient.keycloak.crossplane.io_clientscopes.yaml @@ -0,0 +1,402 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.12.1 + name: clientscopes.openidclient.keycloak.crossplane.io +spec: + group: openidclient.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: ClientScope + listKind: ClientScopeList + plural: clientscopes + singular: clientscope + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: ClientScope is the Schema for the ClientScopes API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClientScopeSpec defines the desired state of ClientScope + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + consentScreenText: + type: string + description: + type: string + guiOrder: + type: number + includeInTokenScope: + type: boolean + name: + type: string + realmId: + type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 + required: + - name + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: ClientScopeStatus defines the observed state of ClientScope. + properties: + atProvider: + properties: + id: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/openidgroup.keycloak.crossplane.io_groupmembershipprotocolmappers.yaml b/package/crds/openidgroup.keycloak.crossplane.io_groupmembershipprotocolmappers.yaml new file mode 100644 index 0000000..2f55cd4 --- /dev/null +++ b/package/crds/openidgroup.keycloak.crossplane.io_groupmembershipprotocolmappers.yaml @@ -0,0 +1,495 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.12.1 + name: groupmembershipprotocolmappers.openidgroup.keycloak.crossplane.io +spec: + group: openidgroup.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: GroupMembershipProtocolMapper + listKind: GroupMembershipProtocolMapperList + plural: groupmembershipprotocolmappers + singular: groupmembershipprotocolmapper + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: GroupMembershipProtocolMapper is the Schema for the GroupMembershipProtocolMappers + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: GroupMembershipProtocolMapperSpec defines the desired state + of GroupMembershipProtocolMapper + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + addToAccessToken: + type: boolean + addToIdToken: + type: boolean + addToUserinfo: + type: boolean + claimName: + type: string + clientId: + description: The mapper's associated client. Cannot be used at + the same time as client_scope_id. + type: string + clientIdRef: + description: Reference to a Client in openidclient to populate + clientId. + 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 + clientIdSelector: + description: Selector for a Client in openidclient to populate + clientId. + 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 + clientScopeId: + description: The mapper's associated client scope. Cannot be used + at the same time as client_id. + type: string + fullPath: + type: boolean + name: + description: A human-friendly name that will appear in the Keycloak + console. + type: string + realmId: + description: The realm id where the associated client or client + scope exists. + type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 + required: + - claimName + - name + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: GroupMembershipProtocolMapperStatus defines the observed + state of GroupMembershipProtocolMapper. + properties: + atProvider: + properties: + id: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/role.keycloak.crossplane.io_roles.yaml b/package/crds/role.keycloak.crossplane.io_roles.yaml index 32b5ad9..8a9da10 100644 --- a/package/crds/role.keycloak.crossplane.io_roles.yaml +++ b/package/crds/role.keycloak.crossplane.io_roles.yaml @@ -233,9 +233,81 @@ spec: type: string realmId: type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 required: - name - - realmId type: object managementPolicies: default: diff --git a/package/crds/user.keycloak.crossplane.io_groups.yaml b/package/crds/user.keycloak.crossplane.io_groups.yaml new file mode 100644 index 0000000..4dd0b7b --- /dev/null +++ b/package/crds/user.keycloak.crossplane.io_groups.yaml @@ -0,0 +1,548 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.12.1 + name: groups.user.keycloak.crossplane.io +spec: + group: user.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: Groups + listKind: GroupsList + plural: groups + singular: groups + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Groups is the Schema for the Groupss API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: GroupsSpec defines the desired state of Groups + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + exhaustive: + type: boolean + groupIds: + items: + type: string + type: array + groupIdsRefs: + description: References to Group in group to populate groupIds. + items: + description: A Reference to a named object. + 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 + type: array + groupIdsSelector: + description: Selector for a list of Group in group to populate + groupIds. + 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 + realmId: + type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 + userId: + type: string + userIdRef: + description: Reference to a User to populate userId. + 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 + userIdSelector: + description: Selector for a User to populate userId. + 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: + - '*' + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: GroupsStatus defines the observed state of Groups. + properties: + atProvider: + properties: + id: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/user.keycloak.crossplane.io_users.yaml b/package/crds/user.keycloak.crossplane.io_users.yaml index 80670eb..e35b83b 100644 --- a/package/crds/user.keycloak.crossplane.io_users.yaml +++ b/package/crds/user.keycloak.crossplane.io_users.yaml @@ -124,10 +124,82 @@ spec: type: string realmId: type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + 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 + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + 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 username: type: string required: - - realmId - username type: object managementPolicies: