diff --git a/README.md b/README.md index 27e24959..cb4f4490 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ You can explore the available custom resources: ### Functions and Compositions: -- [function-keycloak-builtin-objects](https://gitlab.com/corewire/images/crossplane/function-keycloak-builtin-objects) - The function is used to import the builtin objects of a keycloak, e.g. clients and roles. Everything you need to know is in the README of the repository. +- [function-keycloak-builtin-objects](https://gitlab.com/corewire/images/crossplane/function-keycloak-builtin-objects) - The function is used to import the builtin objects of a keycloak, e.g. clients and roles. Since v3.0 it also offers the possibility to adapt some default config. Everything you need to know is in the README of the repository. diff --git a/apis/realm/v1alpha1/zz_generated.conversion_hubs.go b/apis/realm/v1alpha1/zz_generated.conversion_hubs.go index 060751da..7b9b0aca 100755 --- a/apis/realm/v1alpha1/zz_generated.conversion_hubs.go +++ b/apis/realm/v1alpha1/zz_generated.conversion_hubs.go @@ -12,5 +12,11 @@ func (tr *KeystoreRsa) Hub() {} // Hub marks this type as a conversion hub. func (tr *Realm) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *RealmEvents) Hub() {} + // Hub marks this type as a conversion hub. func (tr *RequiredAction) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *UserProfile) Hub() {} diff --git a/apis/realm/v1alpha1/zz_generated.deepcopy.go b/apis/realm/v1alpha1/zz_generated.deepcopy.go index 5ebcb2d8..ab9637ee 100644 --- a/apis/realm/v1alpha1/zz_generated.deepcopy.go +++ b/apis/realm/v1alpha1/zz_generated.deepcopy.go @@ -13,6 +13,285 @@ import ( 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 *AttributeInitParameters) DeepCopyInto(out *AttributeInitParameters) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EnabledWhenScope != nil { + in, out := &in.EnabledWhenScope, &out.EnabledWhenScope + *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.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = make([]PermissionsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequiredForRoles != nil { + in, out := &in.RequiredForRoles, &out.RequiredForRoles + *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.RequiredForScopes != nil { + in, out := &in.RequiredForScopes, &out.RequiredForScopes + *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.Validator != nil { + in, out := &in.Validator, &out.Validator + *out = make([]ValidatorInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttributeInitParameters. +func (in *AttributeInitParameters) DeepCopy() *AttributeInitParameters { + if in == nil { + return nil + } + out := new(AttributeInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttributeObservation) DeepCopyInto(out *AttributeObservation) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EnabledWhenScope != nil { + in, out := &in.EnabledWhenScope, &out.EnabledWhenScope + *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.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = make([]PermissionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequiredForRoles != nil { + in, out := &in.RequiredForRoles, &out.RequiredForRoles + *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.RequiredForScopes != nil { + in, out := &in.RequiredForScopes, &out.RequiredForScopes + *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.Validator != nil { + in, out := &in.Validator, &out.Validator + *out = make([]ValidatorObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttributeObservation. +func (in *AttributeObservation) DeepCopy() *AttributeObservation { + if in == nil { + return nil + } + out := new(AttributeObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttributeParameters) DeepCopyInto(out *AttributeParameters) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EnabledWhenScope != nil { + in, out := &in.EnabledWhenScope, &out.EnabledWhenScope + *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.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = make([]PermissionsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequiredForRoles != nil { + in, out := &in.RequiredForRoles, &out.RequiredForRoles + *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.RequiredForScopes != nil { + in, out := &in.RequiredForScopes, &out.RequiredForScopes + *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.Validator != nil { + in, out := &in.Validator, &out.Validator + *out = make([]ValidatorParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttributeParameters. +func (in *AttributeParameters) DeepCopy() *AttributeParameters { + if in == nil { + return nil + } + out := new(AttributeParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthInitParameters) DeepCopyInto(out *AuthInitParameters) { *out = *in @@ -226,36 +505,174 @@ func (in *BruteForceDetectionParameters) DeepCopy() *BruteForceDetectionParamete } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HeadersInitParameters) DeepCopyInto(out *HeadersInitParameters) { +func (in *GroupInitParameters) DeepCopyInto(out *GroupInitParameters) { *out = *in - if in.ContentSecurityPolicy != nil { - in, out := &in.ContentSecurityPolicy, &out.ContentSecurityPolicy - *out = new(string) - **out = **in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } } - if in.ContentSecurityPolicyReportOnly != nil { - in, out := &in.ContentSecurityPolicyReportOnly, &out.ContentSecurityPolicyReportOnly + if in.DisplayDescription != nil { + in, out := &in.DisplayDescription, &out.DisplayDescription *out = new(string) **out = **in } - if in.ReferrerPolicy != nil { - in, out := &in.ReferrerPolicy, &out.ReferrerPolicy + if in.DisplayHeader != nil { + in, out := &in.DisplayHeader, &out.DisplayHeader *out = new(string) **out = **in } - if in.StrictTransportSecurity != nil { - in, out := &in.StrictTransportSecurity, &out.StrictTransportSecurity + if in.Name != nil { + in, out := &in.Name, &out.Name *out = new(string) **out = **in } - if in.XContentTypeOptions != nil { - in, out := &in.XContentTypeOptions, &out.XContentTypeOptions - *out = new(string) - **out = **in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupInitParameters. +func (in *GroupInitParameters) DeepCopy() *GroupInitParameters { + if in == nil { + return nil } - if in.XFrameOptions != nil { - in, out := &in.XFrameOptions, &out.XFrameOptions - *out = new(string) + out := new(GroupInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupObservation) DeepCopyInto(out *GroupObservation) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.DisplayDescription != nil { + in, out := &in.DisplayDescription, &out.DisplayDescription + *out = new(string) + **out = **in + } + if in.DisplayHeader != nil { + in, out := &in.DisplayHeader, &out.DisplayHeader + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupObservation. +func (in *GroupObservation) DeepCopy() *GroupObservation { + if in == nil { + return nil + } + out := new(GroupObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupParameters) DeepCopyInto(out *GroupParameters) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.DisplayDescription != nil { + in, out := &in.DisplayDescription, &out.DisplayDescription + *out = new(string) + **out = **in + } + if in.DisplayHeader != nil { + in, out := &in.DisplayHeader, &out.DisplayHeader + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupParameters. +func (in *GroupParameters) DeepCopy() *GroupParameters { + if in == nil { + return nil + } + out := new(GroupParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HeadersInitParameters) DeepCopyInto(out *HeadersInitParameters) { + *out = *in + if in.ContentSecurityPolicy != nil { + in, out := &in.ContentSecurityPolicy, &out.ContentSecurityPolicy + *out = new(string) + **out = **in + } + if in.ContentSecurityPolicyReportOnly != nil { + in, out := &in.ContentSecurityPolicyReportOnly, &out.ContentSecurityPolicyReportOnly + *out = new(string) + **out = **in + } + if in.ReferrerPolicy != nil { + in, out := &in.ReferrerPolicy, &out.ReferrerPolicy + *out = new(string) + **out = **in + } + if in.StrictTransportSecurity != nil { + in, out := &in.StrictTransportSecurity, &out.StrictTransportSecurity + *out = new(string) + **out = **in + } + if in.XContentTypeOptions != nil { + in, out := &in.XContentTypeOptions, &out.XContentTypeOptions + *out = new(string) + **out = **in + } + if in.XFrameOptions != nil { + in, out := &in.XFrameOptions, &out.XFrameOptions + *out = new(string) **out = **in } if in.XRobotsTag != nil { @@ -891,6 +1308,117 @@ func (in *OtpPolicyParameters) DeepCopy() *OtpPolicyParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PermissionsInitParameters) DeepCopyInto(out *PermissionsInitParameters) { + *out = *in + if in.Edit != nil { + in, out := &in.Edit, &out.Edit + *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.View != nil { + in, out := &in.View, &out.View + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionsInitParameters. +func (in *PermissionsInitParameters) DeepCopy() *PermissionsInitParameters { + if in == nil { + return nil + } + out := new(PermissionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PermissionsObservation) DeepCopyInto(out *PermissionsObservation) { + *out = *in + if in.Edit != nil { + in, out := &in.Edit, &out.Edit + *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.View != nil { + in, out := &in.View, &out.View + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionsObservation. +func (in *PermissionsObservation) DeepCopy() *PermissionsObservation { + if in == nil { + return nil + } + out := new(PermissionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PermissionsParameters) DeepCopyInto(out *PermissionsParameters) { + *out = *in + if in.Edit != nil { + in, out := &in.Edit, &out.Edit + *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.View != nil { + in, out := &in.View, &out.View + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionsParameters. +func (in *PermissionsParameters) DeepCopy() *PermissionsParameters { + if in == nil { + return nil + } + out := new(PermissionsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Realm) DeepCopyInto(out *Realm) { *out = *in @@ -919,46 +1447,351 @@ func (in *Realm) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RealmInitParameters) DeepCopyInto(out *RealmInitParameters) { +func (in *RealmEvents) DeepCopyInto(out *RealmEvents) { *out = *in - if in.AccessCodeLifespan != nil { - in, out := &in.AccessCodeLifespan, &out.AccessCodeLifespan - *out = new(string) - **out = **in - } - if in.AccessCodeLifespanLogin != nil { - in, out := &in.AccessCodeLifespanLogin, &out.AccessCodeLifespanLogin - *out = new(string) - **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 RealmEvents. +func (in *RealmEvents) DeepCopy() *RealmEvents { + if in == nil { + return nil } - if in.AccessCodeLifespanUserAction != nil { - in, out := &in.AccessCodeLifespanUserAction, &out.AccessCodeLifespanUserAction - *out = new(string) - **out = **in + out := new(RealmEvents) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RealmEvents) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c } - if in.AccessTokenLifespan != nil { - in, out := &in.AccessTokenLifespan, &out.AccessTokenLifespan - *out = new(string) + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RealmEventsInitParameters) DeepCopyInto(out *RealmEventsInitParameters) { + *out = *in + if in.AdminEventsDetailsEnabled != nil { + in, out := &in.AdminEventsDetailsEnabled, &out.AdminEventsDetailsEnabled + *out = new(bool) **out = **in } - if in.AccessTokenLifespanForImplicitFlow != nil { - in, out := &in.AccessTokenLifespanForImplicitFlow, &out.AccessTokenLifespanForImplicitFlow - *out = new(string) + if in.AdminEventsEnabled != nil { + in, out := &in.AdminEventsEnabled, &out.AdminEventsEnabled + *out = new(bool) **out = **in } - if in.AccountTheme != nil { - in, out := &in.AccountTheme, &out.AccountTheme - *out = new(string) - **out = **in + if in.EnabledEventTypes != nil { + in, out := &in.EnabledEventTypes, &out.EnabledEventTypes + *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.ActionTokenGeneratedByAdminLifespan != nil { - in, out := &in.ActionTokenGeneratedByAdminLifespan, &out.ActionTokenGeneratedByAdminLifespan - *out = new(string) + if in.EventsEnabled != nil { + in, out := &in.EventsEnabled, &out.EventsEnabled + *out = new(bool) **out = **in } - if in.ActionTokenGeneratedByUserLifespan != nil { - in, out := &in.ActionTokenGeneratedByUserLifespan, &out.ActionTokenGeneratedByUserLifespan - *out = new(string) + if in.EventsExpiration != nil { + in, out := &in.EventsExpiration, &out.EventsExpiration + *out = new(float64) + **out = **in + } + if in.EventsListeners != nil { + in, out := &in.EventsListeners, &out.EventsListeners + *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 RealmEventsInitParameters. +func (in *RealmEventsInitParameters) DeepCopy() *RealmEventsInitParameters { + if in == nil { + return nil + } + out := new(RealmEventsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RealmEventsList) DeepCopyInto(out *RealmEventsList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RealmEvents, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RealmEventsList. +func (in *RealmEventsList) DeepCopy() *RealmEventsList { + if in == nil { + return nil + } + out := new(RealmEventsList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RealmEventsList) 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 *RealmEventsObservation) DeepCopyInto(out *RealmEventsObservation) { + *out = *in + if in.AdminEventsDetailsEnabled != nil { + in, out := &in.AdminEventsDetailsEnabled, &out.AdminEventsDetailsEnabled + *out = new(bool) + **out = **in + } + if in.AdminEventsEnabled != nil { + in, out := &in.AdminEventsEnabled, &out.AdminEventsEnabled + *out = new(bool) + **out = **in + } + if in.EnabledEventTypes != nil { + in, out := &in.EnabledEventTypes, &out.EnabledEventTypes + *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.EventsEnabled != nil { + in, out := &in.EventsEnabled, &out.EventsEnabled + *out = new(bool) + **out = **in + } + if in.EventsExpiration != nil { + in, out := &in.EventsExpiration, &out.EventsExpiration + *out = new(float64) + **out = **in + } + if in.EventsListeners != nil { + in, out := &in.EventsListeners, &out.EventsListeners + *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.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RealmEventsObservation. +func (in *RealmEventsObservation) DeepCopy() *RealmEventsObservation { + if in == nil { + return nil + } + out := new(RealmEventsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RealmEventsParameters) DeepCopyInto(out *RealmEventsParameters) { + *out = *in + if in.AdminEventsDetailsEnabled != nil { + in, out := &in.AdminEventsDetailsEnabled, &out.AdminEventsDetailsEnabled + *out = new(bool) + **out = **in + } + if in.AdminEventsEnabled != nil { + in, out := &in.AdminEventsEnabled, &out.AdminEventsEnabled + *out = new(bool) + **out = **in + } + if in.EnabledEventTypes != nil { + in, out := &in.EnabledEventTypes, &out.EnabledEventTypes + *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.EventsEnabled != nil { + in, out := &in.EventsEnabled, &out.EventsEnabled + *out = new(bool) + **out = **in + } + if in.EventsExpiration != nil { + in, out := &in.EventsExpiration, &out.EventsExpiration + *out = new(float64) + **out = **in + } + if in.EventsListeners != nil { + in, out := &in.EventsListeners, &out.EventsListeners + *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 RealmEventsParameters. +func (in *RealmEventsParameters) DeepCopy() *RealmEventsParameters { + if in == nil { + return nil + } + out := new(RealmEventsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RealmEventsSpec) DeepCopyInto(out *RealmEventsSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RealmEventsSpec. +func (in *RealmEventsSpec) DeepCopy() *RealmEventsSpec { + if in == nil { + return nil + } + out := new(RealmEventsSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RealmEventsStatus) DeepCopyInto(out *RealmEventsStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RealmEventsStatus. +func (in *RealmEventsStatus) DeepCopy() *RealmEventsStatus { + if in == nil { + return nil + } + out := new(RealmEventsStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RealmInitParameters) DeepCopyInto(out *RealmInitParameters) { + *out = *in + if in.AccessCodeLifespan != nil { + in, out := &in.AccessCodeLifespan, &out.AccessCodeLifespan + *out = new(string) + **out = **in + } + if in.AccessCodeLifespanLogin != nil { + in, out := &in.AccessCodeLifespanLogin, &out.AccessCodeLifespanLogin + *out = new(string) + **out = **in + } + if in.AccessCodeLifespanUserAction != nil { + in, out := &in.AccessCodeLifespanUserAction, &out.AccessCodeLifespanUserAction + *out = new(string) + **out = **in + } + if in.AccessTokenLifespan != nil { + in, out := &in.AccessTokenLifespan, &out.AccessTokenLifespan + *out = new(string) + **out = **in + } + if in.AccessTokenLifespanForImplicitFlow != nil { + in, out := &in.AccessTokenLifespanForImplicitFlow, &out.AccessTokenLifespanForImplicitFlow + *out = new(string) + **out = **in + } + if in.AccountTheme != nil { + in, out := &in.AccountTheme, &out.AccountTheme + *out = new(string) + **out = **in + } + if in.ActionTokenGeneratedByAdminLifespan != nil { + in, out := &in.ActionTokenGeneratedByAdminLifespan, &out.ActionTokenGeneratedByAdminLifespan + *out = new(string) + **out = **in + } + if in.ActionTokenGeneratedByUserLifespan != nil { + in, out := &in.ActionTokenGeneratedByUserLifespan, &out.ActionTokenGeneratedByUserLifespan + *out = new(string) **out = **in } if in.AdminTheme != nil { @@ -2522,6 +3355,335 @@ func (in *SecurityDefensesParameters) DeepCopy() *SecurityDefensesParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserProfile) DeepCopyInto(out *UserProfile) { + *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 UserProfile. +func (in *UserProfile) DeepCopy() *UserProfile { + if in == nil { + return nil + } + out := new(UserProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserProfile) 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 *UserProfileInitParameters) DeepCopyInto(out *UserProfileInitParameters) { + *out = *in + if in.Attribute != nil { + in, out := &in.Attribute, &out.Attribute + *out = make([]AttributeInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = make([]GroupInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + 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 UserProfileInitParameters. +func (in *UserProfileInitParameters) DeepCopy() *UserProfileInitParameters { + if in == nil { + return nil + } + out := new(UserProfileInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserProfileList) DeepCopyInto(out *UserProfileList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UserProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserProfileList. +func (in *UserProfileList) DeepCopy() *UserProfileList { + if in == nil { + return nil + } + out := new(UserProfileList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserProfileList) 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 *UserProfileObservation) DeepCopyInto(out *UserProfileObservation) { + *out = *in + if in.Attribute != nil { + in, out := &in.Attribute, &out.Attribute + *out = make([]AttributeObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = make([]GroupObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserProfileObservation. +func (in *UserProfileObservation) DeepCopy() *UserProfileObservation { + if in == nil { + return nil + } + out := new(UserProfileObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserProfileParameters) DeepCopyInto(out *UserProfileParameters) { + *out = *in + if in.Attribute != nil { + in, out := &in.Attribute, &out.Attribute + *out = make([]AttributeParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = make([]GroupParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + 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 UserProfileParameters. +func (in *UserProfileParameters) DeepCopy() *UserProfileParameters { + if in == nil { + return nil + } + out := new(UserProfileParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserProfileSpec) DeepCopyInto(out *UserProfileSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserProfileSpec. +func (in *UserProfileSpec) DeepCopy() *UserProfileSpec { + if in == nil { + return nil + } + out := new(UserProfileSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserProfileStatus) DeepCopyInto(out *UserProfileStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserProfileStatus. +func (in *UserProfileStatus) DeepCopy() *UserProfileStatus { + if in == nil { + return nil + } + out := new(UserProfileStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidatorInitParameters) DeepCopyInto(out *ValidatorInitParameters) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatorInitParameters. +func (in *ValidatorInitParameters) DeepCopy() *ValidatorInitParameters { + if in == nil { + return nil + } + out := new(ValidatorInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidatorObservation) DeepCopyInto(out *ValidatorObservation) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatorObservation. +func (in *ValidatorObservation) DeepCopy() *ValidatorObservation { + if in == nil { + return nil + } + out := new(ValidatorObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidatorParameters) DeepCopyInto(out *ValidatorParameters) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatorParameters. +func (in *ValidatorParameters) DeepCopy() *ValidatorParameters { + if in == nil { + return nil + } + out := new(ValidatorParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WebAuthnPasswordlessPolicyInitParameters) DeepCopyInto(out *WebAuthnPasswordlessPolicyInitParameters) { *out = *in diff --git a/apis/realm/v1alpha1/zz_generated.managed.go b/apis/realm/v1alpha1/zz_generated.managed.go index 188cc197..2fc5c119 100644 --- a/apis/realm/v1alpha1/zz_generated.managed.go +++ b/apis/realm/v1alpha1/zz_generated.managed.go @@ -127,6 +127,66 @@ func (mg *Realm) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this RealmEvents. +func (mg *RealmEvents) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this RealmEvents. +func (mg *RealmEvents) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this RealmEvents. +func (mg *RealmEvents) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this RealmEvents. +func (mg *RealmEvents) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this RealmEvents. +func (mg *RealmEvents) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this RealmEvents. +func (mg *RealmEvents) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this RealmEvents. +func (mg *RealmEvents) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this RealmEvents. +func (mg *RealmEvents) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this RealmEvents. +func (mg *RealmEvents) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this RealmEvents. +func (mg *RealmEvents) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this RealmEvents. +func (mg *RealmEvents) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this RealmEvents. +func (mg *RealmEvents) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this RequiredAction. func (mg *RequiredAction) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) @@ -186,3 +246,63 @@ func (mg *RequiredAction) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectio func (mg *RequiredAction) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this UserProfile. +func (mg *UserProfile) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this UserProfile. +func (mg *UserProfile) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this UserProfile. +func (mg *UserProfile) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this UserProfile. +func (mg *UserProfile) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this UserProfile. +func (mg *UserProfile) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this UserProfile. +func (mg *UserProfile) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this UserProfile. +func (mg *UserProfile) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this UserProfile. +func (mg *UserProfile) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this UserProfile. +func (mg *UserProfile) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this UserProfile. +func (mg *UserProfile) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this UserProfile. +func (mg *UserProfile) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this UserProfile. +func (mg *UserProfile) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/realm/v1alpha1/zz_generated.managedlist.go b/apis/realm/v1alpha1/zz_generated.managedlist.go index 496db233..0fb15b84 100644 --- a/apis/realm/v1alpha1/zz_generated.managedlist.go +++ b/apis/realm/v1alpha1/zz_generated.managedlist.go @@ -16,6 +16,15 @@ func (l *KeystoreRsaList) GetItems() []resource.Managed { return items } +// GetItems of this RealmEventsList. +func (l *RealmEventsList) 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 RealmList. func (l *RealmList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) @@ -33,3 +42,12 @@ func (l *RequiredActionList) GetItems() []resource.Managed { } return items } + +// GetItems of this UserProfileList. +func (l *UserProfileList) 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/realm/v1alpha1/zz_generated.resolvers.go b/apis/realm/v1alpha1/zz_generated.resolvers.go index e891bcf5..28deb224 100644 --- a/apis/realm/v1alpha1/zz_generated.resolvers.go +++ b/apis/realm/v1alpha1/zz_generated.resolvers.go @@ -66,6 +66,56 @@ func (mg *KeystoreRsa) ResolveReferences(ctx context.Context, c client.Reader) e return nil } +// ResolveReferences of this RealmEvents. +func (mg *RealmEvents) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + { + m, l, err = apisresolver.GetManagedResource("realm.keycloak.crossplane.io", "v1alpha1", "Realm", "RealmList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + 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: l, Managed: m}, + }) + } + 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 + { + m, l, err = apisresolver.GetManagedResource("realm.keycloak.crossplane.io", "v1alpha1", "Realm", "RealmList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.RealmIDRef, + Selector: mg.Spec.InitProvider.RealmIDSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.RealmID") + } + mg.Spec.InitProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this RequiredAction. func (mg *RequiredAction) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed @@ -115,3 +165,53 @@ func (mg *RequiredAction) ResolveReferences(ctx context.Context, c client.Reader return nil } + +// ResolveReferences of this UserProfile. +func (mg *UserProfile) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + { + m, l, err = apisresolver.GetManagedResource("realm.keycloak.crossplane.io", "v1alpha1", "Realm", "RealmList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + 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: l, Managed: m}, + }) + } + 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 + { + m, l, err = apisresolver.GetManagedResource("realm.keycloak.crossplane.io", "v1alpha1", "Realm", "RealmList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.RealmIDRef, + Selector: mg.Spec.InitProvider.RealmIDSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.RealmID") + } + mg.Spec.InitProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/realm/v1alpha1/zz_realmevents_terraformed.go b/apis/realm/v1alpha1/zz_realmevents_terraformed.go new file mode 100755 index 00000000..fbd3aa15 --- /dev/null +++ b/apis/realm/v1alpha1/zz_realmevents_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this RealmEvents +func (mg *RealmEvents) GetTerraformResourceType() string { + return "keycloak_realm_events" +} + +// GetConnectionDetailsMapping for this RealmEvents +func (tr *RealmEvents) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this RealmEvents +func (tr *RealmEvents) 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 RealmEvents +func (tr *RealmEvents) 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 RealmEvents +func (tr *RealmEvents) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this RealmEvents +func (tr *RealmEvents) 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 RealmEvents +func (tr *RealmEvents) 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) +} + +// GetInitParameters of this RealmEvents +func (tr *RealmEvents) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this RealmEvents +func (tr *RealmEvents) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this RealmEvents using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *RealmEvents) LateInitialize(attrs []byte) (bool, error) { + params := &RealmEventsParameters{} + 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 *RealmEvents) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/realm/v1alpha1/zz_realmevents_types.go b/apis/realm/v1alpha1/zz_realmevents_types.go new file mode 100755 index 00000000..f67599a7 --- /dev/null +++ b/apis/realm/v1alpha1/zz_realmevents_types.go @@ -0,0 +1,180 @@ +/* +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 RealmEventsInitParameters struct { + + // When true, saved admin events will included detailed information for create/update requests. Defaults to false. + AdminEventsDetailsEnabled *bool `json:"adminEventsDetailsEnabled,omitempty" tf:"admin_events_details_enabled,omitempty"` + + // When true, admin events are saved to the database, making them available through the admin console. Defaults to false. + AdminEventsEnabled *bool `json:"adminEventsEnabled,omitempty" tf:"admin_events_enabled,omitempty"` + + // The event types that will be saved to the database. Omitting this field enables all event types. Defaults to [] or all event types. + // +listType=set + EnabledEventTypes []*string `json:"enabledEventTypes,omitempty" tf:"enabled_event_types,omitempty"` + + // When true, events from enabled_event_types are saved to the database, making them available through the admin console. Defaults to false. + EventsEnabled *bool `json:"eventsEnabled,omitempty" tf:"events_enabled,omitempty"` + + // The amount of time in seconds events will be saved in the database. Defaults to 0 or never. + EventsExpiration *float64 `json:"eventsExpiration,omitempty" tf:"events_expiration,omitempty"` + + // The event listeners that events should be sent to. Defaults to [] or none. Note that new realms enable the jboss-logging listener by default, and this resource will remove that unless it is specified. + // +listType=set + EventsListeners []*string `json:"eventsListeners,omitempty" tf:"events_listeners,omitempty"` + + // The name of the realm the event settings apply to. + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + 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:"-"` +} + +type RealmEventsObservation struct { + + // When true, saved admin events will included detailed information for create/update requests. Defaults to false. + AdminEventsDetailsEnabled *bool `json:"adminEventsDetailsEnabled,omitempty" tf:"admin_events_details_enabled,omitempty"` + + // When true, admin events are saved to the database, making them available through the admin console. Defaults to false. + AdminEventsEnabled *bool `json:"adminEventsEnabled,omitempty" tf:"admin_events_enabled,omitempty"` + + // The event types that will be saved to the database. Omitting this field enables all event types. Defaults to [] or all event types. + // +listType=set + EnabledEventTypes []*string `json:"enabledEventTypes,omitempty" tf:"enabled_event_types,omitempty"` + + // When true, events from enabled_event_types are saved to the database, making them available through the admin console. Defaults to false. + EventsEnabled *bool `json:"eventsEnabled,omitempty" tf:"events_enabled,omitempty"` + + // The amount of time in seconds events will be saved in the database. Defaults to 0 or never. + EventsExpiration *float64 `json:"eventsExpiration,omitempty" tf:"events_expiration,omitempty"` + + // The event listeners that events should be sent to. Defaults to [] or none. Note that new realms enable the jboss-logging listener by default, and this resource will remove that unless it is specified. + // +listType=set + EventsListeners []*string `json:"eventsListeners,omitempty" tf:"events_listeners,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The name of the realm the event settings apply to. + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` +} + +type RealmEventsParameters struct { + + // When true, saved admin events will included detailed information for create/update requests. Defaults to false. + // +kubebuilder:validation:Optional + AdminEventsDetailsEnabled *bool `json:"adminEventsDetailsEnabled,omitempty" tf:"admin_events_details_enabled,omitempty"` + + // When true, admin events are saved to the database, making them available through the admin console. Defaults to false. + // +kubebuilder:validation:Optional + AdminEventsEnabled *bool `json:"adminEventsEnabled,omitempty" tf:"admin_events_enabled,omitempty"` + + // The event types that will be saved to the database. Omitting this field enables all event types. Defaults to [] or all event types. + // +kubebuilder:validation:Optional + // +listType=set + EnabledEventTypes []*string `json:"enabledEventTypes,omitempty" tf:"enabled_event_types,omitempty"` + + // When true, events from enabled_event_types are saved to the database, making them available through the admin console. Defaults to false. + // +kubebuilder:validation:Optional + EventsEnabled *bool `json:"eventsEnabled,omitempty" tf:"events_enabled,omitempty"` + + // The amount of time in seconds events will be saved in the database. Defaults to 0 or never. + // +kubebuilder:validation:Optional + EventsExpiration *float64 `json:"eventsExpiration,omitempty" tf:"events_expiration,omitempty"` + + // The event listeners that events should be sent to. Defaults to [] or none. Note that new realms enable the jboss-logging listener by default, and this resource will remove that unless it is specified. + // +kubebuilder:validation:Optional + // +listType=set + EventsListeners []*string `json:"eventsListeners,omitempty" tf:"events_listeners,omitempty"` + + // The name of the realm the event settings apply to. + // +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:"-"` +} + +// RealmEventsSpec defines the desired state of RealmEvents +type RealmEventsSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider RealmEventsParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider RealmEventsInitParameters `json:"initProvider,omitempty"` +} + +// RealmEventsStatus defines the observed state of RealmEvents. +type RealmEventsStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider RealmEventsObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// RealmEvents is the Schema for the RealmEventss API. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type RealmEvents struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec RealmEventsSpec `json:"spec"` + Status RealmEventsStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// RealmEventsList contains a list of RealmEventss +type RealmEventsList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RealmEvents `json:"items"` +} + +// Repository type metadata. +var ( + RealmEvents_Kind = "RealmEvents" + RealmEvents_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: RealmEvents_Kind}.String() + RealmEvents_KindAPIVersion = RealmEvents_Kind + "." + CRDGroupVersion.String() + RealmEvents_GroupVersionKind = CRDGroupVersion.WithKind(RealmEvents_Kind) +) + +func init() { + SchemeBuilder.Register(&RealmEvents{}, &RealmEventsList{}) +} diff --git a/apis/realm/v1alpha1/zz_userprofile_terraformed.go b/apis/realm/v1alpha1/zz_userprofile_terraformed.go new file mode 100755 index 00000000..570dd917 --- /dev/null +++ b/apis/realm/v1alpha1/zz_userprofile_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this UserProfile +func (mg *UserProfile) GetTerraformResourceType() string { + return "keycloak_realm_user_profile" +} + +// GetConnectionDetailsMapping for this UserProfile +func (tr *UserProfile) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this UserProfile +func (tr *UserProfile) 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 UserProfile +func (tr *UserProfile) 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 UserProfile +func (tr *UserProfile) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this UserProfile +func (tr *UserProfile) 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 UserProfile +func (tr *UserProfile) 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) +} + +// GetInitParameters of this UserProfile +func (tr *UserProfile) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this UserProfile +func (tr *UserProfile) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this UserProfile using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *UserProfile) LateInitialize(attrs []byte) (bool, error) { + params := &UserProfileParameters{} + 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 *UserProfile) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/realm/v1alpha1/zz_userprofile_types.go b/apis/realm/v1alpha1/zz_userprofile_types.go new file mode 100755 index 00000000..c6f5b4e5 --- /dev/null +++ b/apis/realm/v1alpha1/zz_userprofile_types.go @@ -0,0 +1,364 @@ +/* +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 AttributeInitParameters struct { + + // A map of annotations for the attribute. Values can be a String or a json object. + // +mapType=granular + Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` + + // The display name of the attribute. + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // A list of scopes. The attribute will only be enabled when these scopes are requested by clients. + // +listType=set + EnabledWhenScope []*string `json:"enabledWhenScope,omitempty" tf:"enabled_when_scope,omitempty"` + + // A list of groups. + Group *string `json:"group,omitempty" tf:"group,omitempty"` + + // The name of the attribute. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The permissions configuration information. + Permissions []PermissionsInitParameters `json:"permissions,omitempty" tf:"permissions,omitempty"` + + // A list of roles for which the attribute will be required. + // +listType=set + RequiredForRoles []*string `json:"requiredForRoles,omitempty" tf:"required_for_roles,omitempty"` + + // A list of scopes for which the attribute will be required. + // +listType=set + RequiredForScopes []*string `json:"requiredForScopes,omitempty" tf:"required_for_scopes,omitempty"` + + // A list of validators for the attribute. + Validator []ValidatorInitParameters `json:"validator,omitempty" tf:"validator,omitempty"` +} + +type AttributeObservation struct { + + // A map of annotations for the attribute. Values can be a String or a json object. + // +mapType=granular + Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` + + // The display name of the attribute. + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // A list of scopes. The attribute will only be enabled when these scopes are requested by clients. + // +listType=set + EnabledWhenScope []*string `json:"enabledWhenScope,omitempty" tf:"enabled_when_scope,omitempty"` + + // A list of groups. + Group *string `json:"group,omitempty" tf:"group,omitempty"` + + // The name of the attribute. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The permissions configuration information. + Permissions []PermissionsObservation `json:"permissions,omitempty" tf:"permissions,omitempty"` + + // A list of roles for which the attribute will be required. + // +listType=set + RequiredForRoles []*string `json:"requiredForRoles,omitempty" tf:"required_for_roles,omitempty"` + + // A list of scopes for which the attribute will be required. + // +listType=set + RequiredForScopes []*string `json:"requiredForScopes,omitempty" tf:"required_for_scopes,omitempty"` + + // A list of validators for the attribute. + Validator []ValidatorObservation `json:"validator,omitempty" tf:"validator,omitempty"` +} + +type AttributeParameters struct { + + // A map of annotations for the attribute. Values can be a String or a json object. + // +kubebuilder:validation:Optional + // +mapType=granular + Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` + + // The display name of the attribute. + // +kubebuilder:validation:Optional + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // A list of scopes. The attribute will only be enabled when these scopes are requested by clients. + // +kubebuilder:validation:Optional + // +listType=set + EnabledWhenScope []*string `json:"enabledWhenScope,omitempty" tf:"enabled_when_scope,omitempty"` + + // A list of groups. + // +kubebuilder:validation:Optional + Group *string `json:"group,omitempty" tf:"group,omitempty"` + + // The name of the attribute. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` + + // The permissions configuration information. + // +kubebuilder:validation:Optional + Permissions []PermissionsParameters `json:"permissions,omitempty" tf:"permissions,omitempty"` + + // A list of roles for which the attribute will be required. + // +kubebuilder:validation:Optional + // +listType=set + RequiredForRoles []*string `json:"requiredForRoles,omitempty" tf:"required_for_roles,omitempty"` + + // A list of scopes for which the attribute will be required. + // +kubebuilder:validation:Optional + // +listType=set + RequiredForScopes []*string `json:"requiredForScopes,omitempty" tf:"required_for_scopes,omitempty"` + + // A list of validators for the attribute. + // +kubebuilder:validation:Optional + Validator []ValidatorParameters `json:"validator,omitempty" tf:"validator,omitempty"` +} + +type GroupInitParameters struct { + + // A map of annotations for the attribute. Values can be a String or a json object. + // +mapType=granular + Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` + + // The display description of the group. + DisplayDescription *string `json:"displayDescription,omitempty" tf:"display_description,omitempty"` + + // The display header of the group. + DisplayHeader *string `json:"displayHeader,omitempty" tf:"display_header,omitempty"` + + // The name of the attribute. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type GroupObservation struct { + + // A map of annotations for the attribute. Values can be a String or a json object. + // +mapType=granular + Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` + + // The display description of the group. + DisplayDescription *string `json:"displayDescription,omitempty" tf:"display_description,omitempty"` + + // The display header of the group. + DisplayHeader *string `json:"displayHeader,omitempty" tf:"display_header,omitempty"` + + // The name of the attribute. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type GroupParameters struct { + + // A map of annotations for the attribute. Values can be a String or a json object. + // +kubebuilder:validation:Optional + // +mapType=granular + Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` + + // The display description of the group. + // +kubebuilder:validation:Optional + DisplayDescription *string `json:"displayDescription,omitempty" tf:"display_description,omitempty"` + + // The display header of the group. + // +kubebuilder:validation:Optional + DisplayHeader *string `json:"displayHeader,omitempty" tf:"display_header,omitempty"` + + // The name of the attribute. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` +} + +type PermissionsInitParameters struct { + + // A list of profiles that will be able to edit the attribute. One of admin, user. + // +listType=set + Edit []*string `json:"edit,omitempty" tf:"edit,omitempty"` + + // A list of profiles that will be able to view the attribute. One of admin, user. + // +listType=set + View []*string `json:"view,omitempty" tf:"view,omitempty"` +} + +type PermissionsObservation struct { + + // A list of profiles that will be able to edit the attribute. One of admin, user. + // +listType=set + Edit []*string `json:"edit,omitempty" tf:"edit,omitempty"` + + // A list of profiles that will be able to view the attribute. One of admin, user. + // +listType=set + View []*string `json:"view,omitempty" tf:"view,omitempty"` +} + +type PermissionsParameters struct { + + // A list of profiles that will be able to edit the attribute. One of admin, user. + // +kubebuilder:validation:Optional + // +listType=set + Edit []*string `json:"edit" tf:"edit,omitempty"` + + // A list of profiles that will be able to view the attribute. One of admin, user. + // +kubebuilder:validation:Optional + // +listType=set + View []*string `json:"view" tf:"view,omitempty"` +} + +type UserProfileInitParameters struct { + + // An ordered list of attributes. + Attribute []AttributeInitParameters `json:"attribute,omitempty" tf:"attribute,omitempty"` + + // A list of groups. + Group []GroupInitParameters `json:"group,omitempty" tf:"group,omitempty"` + + // The ID of the realm the user profile applies to. + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + 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:"-"` +} + +type UserProfileObservation struct { + + // An ordered list of attributes. + Attribute []AttributeObservation `json:"attribute,omitempty" tf:"attribute,omitempty"` + + // A list of groups. + Group []GroupObservation `json:"group,omitempty" tf:"group,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The ID of the realm the user profile applies to. + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` +} + +type UserProfileParameters struct { + + // An ordered list of attributes. + // +kubebuilder:validation:Optional + Attribute []AttributeParameters `json:"attribute,omitempty" tf:"attribute,omitempty"` + + // A list of groups. + // +kubebuilder:validation:Optional + Group []GroupParameters `json:"group,omitempty" tf:"group,omitempty"` + + // The ID of the realm the user profile applies to. + // +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:"-"` +} + +type ValidatorInitParameters struct { + + // A map defining the configuration of the validator. Values can be a String or a json object. + // +mapType=granular + Config map[string]*string `json:"config,omitempty" tf:"config,omitempty"` + + // The name of the attribute. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type ValidatorObservation struct { + + // A map defining the configuration of the validator. Values can be a String or a json object. + // +mapType=granular + Config map[string]*string `json:"config,omitempty" tf:"config,omitempty"` + + // The name of the attribute. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type ValidatorParameters struct { + + // A map defining the configuration of the validator. Values can be a String or a json object. + // +kubebuilder:validation:Optional + // +mapType=granular + Config map[string]*string `json:"config,omitempty" tf:"config,omitempty"` + + // The name of the attribute. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` +} + +// UserProfileSpec defines the desired state of UserProfile +type UserProfileSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider UserProfileParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider UserProfileInitParameters `json:"initProvider,omitempty"` +} + +// UserProfileStatus defines the observed state of UserProfile. +type UserProfileStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider UserProfileObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// UserProfile is the Schema for the UserProfiles API. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type UserProfile struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec UserProfileSpec `json:"spec"` + Status UserProfileStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// UserProfileList contains a list of UserProfiles +type UserProfileList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []UserProfile `json:"items"` +} + +// Repository type metadata. +var ( + UserProfile_Kind = "UserProfile" + UserProfile_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: UserProfile_Kind}.String() + UserProfile_KindAPIVersion = UserProfile_Kind + "." + CRDGroupVersion.String() + UserProfile_GroupVersionKind = CRDGroupVersion.WithKind(UserProfile_Kind) +) + +func init() { + SchemeBuilder.Register(&UserProfile{}, &UserProfileList{}) +} diff --git a/config/external_name.go b/config/external_name.go index 1e435da0..ca7be99c 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -41,6 +41,8 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "keycloak_saml_client_default_scopes": config.IdentifierFromProvider, "keycloak_saml_client_scope": config.IdentifierFromProvider, "keycloak_realm_keystore_rsa": config.IdentifierFromProvider, + "keycloak_realm_user_profile": config.IdentifierFromProvider, + "keycloak_realm_events": config.IdentifierFromProvider, "keycloak_authentication_flow": config.IdentifierFromProvider, "keycloak_authentication_subflow": config.IdentifierFromProvider, "keycloak_authentication_execution": config.IdentifierFromProvider, diff --git a/config/realm/config.go b/config/realm/config.go index 17a37c65..f1dac5c1 100644 --- a/config/realm/config.go +++ b/config/realm/config.go @@ -1,24 +1,29 @@ package realm -import "github.com/crossplane/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" +) + +// Group is the short group name for the resources in this package +var Group = "realm" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("keycloak_realm", func(r *config.Resource) { // We need to override the default group that upjet generated for // this resource, which would be "github" - r.ShortGroup = "realm" + r.ShortGroup = Group }) p.AddResourceConfigurator("keycloak_required_action", func(r *config.Resource) { - r.ShortGroup = "realm" + r.ShortGroup = Group r.Kind = "RequiredAction" }) p.AddResourceConfigurator("keycloak_realm_keystore_rsa", func(r *config.Resource) { // We need to override the default group that upjet generated for // this resource, which would be "github" - r.ShortGroup = "realm" + r.ShortGroup = Group if s, ok := r.TerraformResource.Schema["private_key"]; ok { s.Sensitive = true } @@ -26,4 +31,13 @@ func Configure(p *config.Provider) { s.Sensitive = true } }) + + p.AddResourceConfigurator("keycloak_realm_user_profile", func(r *config.Resource) { + r.ShortGroup = Group + }) + + p.AddResourceConfigurator("keycloak_realm_events", func(r *config.Resource) { + r.ShortGroup = Group + r.Kind = "RealmEvents" + }) } diff --git a/examples-generated/realm/v1alpha1/realmevents.yaml b/examples-generated/realm/v1alpha1/realmevents.yaml new file mode 100644 index 00000000..2ae7e20d --- /dev/null +++ b/examples-generated/realm/v1alpha1/realmevents.yaml @@ -0,0 +1,37 @@ +apiVersion: realm.keycloak.crossplane.io/v1alpha1 +kind: RealmEvents +metadata: + annotations: + meta.upbound.io/example-id: realm/v1alpha1/realmevents + labels: + testing.upbound.io/example-name: realm_events + name: realm-events +spec: + forProvider: + adminEventsDetailsEnabled: true + adminEventsEnabled: true + enabledEventTypes: + - LOGIN + - LOGOUT + eventsEnabled: true + eventsExpiration: 3600 + eventsListeners: + - jboss-logging + realmIdSelector: + matchLabels: + testing.upbound.io/example-name: realm + +--- + +apiVersion: realm.keycloak.crossplane.io/v1alpha1 +kind: Realm +metadata: + annotations: + meta.upbound.io/example-id: realm/v1alpha1/realmevents + labels: + testing.upbound.io/example-name: realm + name: realm +spec: + forProvider: + enabled: true + realm: my-realm diff --git a/examples-generated/realm/v1alpha1/userprofile.yaml b/examples-generated/realm/v1alpha1/userprofile.yaml new file mode 100644 index 00000000..36bfa994 --- /dev/null +++ b/examples-generated/realm/v1alpha1/userprofile.yaml @@ -0,0 +1,69 @@ +apiVersion: realm.keycloak.crossplane.io/v1alpha1 +kind: UserProfile +metadata: + annotations: + meta.upbound.io/example-id: realm/v1alpha1/userprofile + labels: + testing.upbound.io/example-name: userprofile + name: userprofile +spec: + forProvider: + attribute: + - annotations: + foo: bar + displayName: Field 1 + enabledWhenScope: + - offline_access + group: group1 + name: field1 + permissions: + - edit: + - admin + - user + view: + - admin + - user + requiredForRoles: + - user + requiredForScopes: + - offline_access + validator: + - name: person-name-prohibited-characters + - config: + error-message: Nope + pattern: ^[a-z]+$ + name: pattern + - annotations: + foo: '${jsonencode ( {"key": "val" } )}' + name: field2 + validator: + - config: + options: ${jsonencode ( [ "opt1" ])} + name: options + group: + - annotations: + foo: bar + foo2: '${jsonencode ( { "key": "val" } )}' + displayDescription: A first group + displayHeader: Group 1 + name: group1 + - name: group2 + realmIdSelector: + matchLabels: + testing.upbound.io/example-name: my_realm + +--- + +apiVersion: realm.keycloak.crossplane.io/v1alpha1 +kind: Realm +metadata: + annotations: + meta.upbound.io/example-id: realm/v1alpha1/userprofile + labels: + testing.upbound.io/example-name: realm + name: realm +spec: + forProvider: + attributes: + userProfileEnabled: true + realm: my-realm diff --git a/examples/realmuserprofile.yaml b/examples/realmuserprofile.yaml new file mode 100644 index 00000000..399389a0 --- /dev/null +++ b/examples/realmuserprofile.yaml @@ -0,0 +1,56 @@ +# Example 1: Keep only email and username and add new field field2 +# Generated example does not work because it would remove email and username +apiVersion: realm.keycloak.crossplane.io/v1alpha1 +kind: UserProfile +metadata: + name: basic-userprofile +spec: + forProvider: + attribute: + - annotations: + foo: '${jsonencode ( {"key": "val" } )}' + name: field2 + validator: + - config: + options: ${jsonencode ( [ "opt1" ])} + name: options + - name: email + displayName: "${email}" + permissions: + - edit: + - admin + - user + - view: + - admin + - user + validator: + - name: length + config: + max: "255" + - name: email + requiredForRoles: + - "user" + - name: username + displayName: "${username}" + permissions: + - edit: + - admin + - user + - view: + - admin + - user + validator: + - name: length + config: + max: "255" + min: "3" + - name: up-username-not-idn-homograph + - name: username-prohibited-characters + group: + - name: "user-metadata" + displayHeader: "User metadata" + displayDescription: "Attributes, which refer to user metadata" + realmId: my-realm # Replace with your realm ID + providerConfigRef: + name: "keycloak-provider-config" + diff --git a/internal/controller/realm/realmevents/zz_controller.go b/internal/controller/realm/realmevents/zz_controller.go new file mode 100755 index 00000000..c4cf5980 --- /dev/null +++ b/internal/controller/realm/realmevents/zz_controller.go @@ -0,0 +1,91 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package realmevents + +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" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + features "github.com/crossplane-contrib/provider-keycloak/internal/features" +) + +// Setup adds a controller that reconciles RealmEvents managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.RealmEvents_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, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.RealmEvents_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.RealmEvents_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["keycloak_realm_events"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.RealmEvents_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.RealmEvents + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.RealmEvents{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.RealmEvents") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.RealmEventsList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.RealmEventsList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.RealmEvents_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.RealmEvents{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/realm/userprofile/zz_controller.go b/internal/controller/realm/userprofile/zz_controller.go new file mode 100755 index 00000000..88bfa073 --- /dev/null +++ b/internal/controller/realm/userprofile/zz_controller.go @@ -0,0 +1,91 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package userprofile + +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" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" + features "github.com/crossplane-contrib/provider-keycloak/internal/features" +) + +// Setup adds a controller that reconciles UserProfile managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.UserProfile_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, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.UserProfile_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.UserProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["keycloak_realm_user_profile"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.UserProfile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.UserProfile + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.UserProfile{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.UserProfile") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.UserProfileList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.UserProfileList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.UserProfile_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.UserProfile{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 4fcca6c6..990ebbeb 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -49,7 +49,9 @@ import ( providerconfig "github.com/crossplane-contrib/provider-keycloak/internal/controller/providerconfig" keystorersa "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/keystorersa" realm "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/realm" + realmevents "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/realmevents" requiredaction "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/requiredaction" + userprofile "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/userprofile" role "github.com/crossplane-contrib/provider-keycloak/internal/controller/role/role" identityprovidersaml "github.com/crossplane-contrib/provider-keycloak/internal/controller/saml/identityprovider" clientsamlclient "github.com/crossplane-contrib/provider-keycloak/internal/controller/samlclient/client" @@ -105,7 +107,9 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { providerconfig.Setup, keystorersa.Setup, realm.Setup, + realmevents.Setup, requiredaction.Setup, + userprofile.Setup, role.Setup, identityprovidersaml.Setup, clientsamlclient.Setup, diff --git a/package/crds/realm.keycloak.crossplane.io_realmevents.yaml b/package/crds/realm.keycloak.crossplane.io_realmevents.yaml new file mode 100644 index 00000000..38beebb6 --- /dev/null +++ b/package/crds/realm.keycloak.crossplane.io_realmevents.yaml @@ -0,0 +1,587 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: realmevents.realm.keycloak.crossplane.io +spec: + group: realm.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: RealmEvents + listKind: RealmEventsList + plural: realmevents + singular: realmevents + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + 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: RealmEvents is the Schema for the RealmEventss 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: RealmEventsSpec defines the desired state of RealmEvents + 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: + adminEventsDetailsEnabled: + description: When true, saved admin events will included detailed + information for create/update requests. Defaults to false. + type: boolean + adminEventsEnabled: + description: When true, admin events are saved to the database, + making them available through the admin console. Defaults to + false. + type: boolean + enabledEventTypes: + description: The event types that will be saved to the database. + Omitting this field enables all event types. Defaults to [] + or all event types. + items: + type: string + type: array + x-kubernetes-list-type: set + eventsEnabled: + description: When true, events from enabled_event_types are saved + to the database, making them available through the admin console. + Defaults to false. + type: boolean + eventsExpiration: + description: The amount of time in seconds events will be saved + in the database. Defaults to 0 or never. + type: number + eventsListeners: + description: The event listeners that events should be sent to. + Defaults to [] or none. Note that new realms enable the jboss-logging + listener by default, and this resource will remove that unless + it is specified. + items: + type: string + type: array + x-kubernetes-list-type: set + realmId: + description: The name of the realm the event settings apply to. + 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 + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + adminEventsDetailsEnabled: + description: When true, saved admin events will included detailed + information for create/update requests. Defaults to false. + type: boolean + adminEventsEnabled: + description: When true, admin events are saved to the database, + making them available through the admin console. Defaults to + false. + type: boolean + enabledEventTypes: + description: The event types that will be saved to the database. + Omitting this field enables all event types. Defaults to [] + or all event types. + items: + type: string + type: array + x-kubernetes-list-type: set + eventsEnabled: + description: When true, events from enabled_event_types are saved + to the database, making them available through the admin console. + Defaults to false. + type: boolean + eventsExpiration: + description: The amount of time in seconds events will be saved + in the database. Defaults to 0 or never. + type: number + eventsListeners: + description: The event listeners that events should be sent to. + Defaults to [] or none. Note that new realms enable the jboss-logging + listener by default, and this resource will remove that unless + it is specified. + items: + type: string + type: array + x-kubernetes-list-type: set + realmId: + description: The name of the realm the event settings apply to. + 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 + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + 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 + 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: RealmEventsStatus defines the observed state of RealmEvents. + properties: + atProvider: + properties: + adminEventsDetailsEnabled: + description: When true, saved admin events will included detailed + information for create/update requests. Defaults to false. + type: boolean + adminEventsEnabled: + description: When true, admin events are saved to the database, + making them available through the admin console. Defaults to + false. + type: boolean + enabledEventTypes: + description: The event types that will be saved to the database. + Omitting this field enables all event types. Defaults to [] + or all event types. + items: + type: string + type: array + x-kubernetes-list-type: set + eventsEnabled: + description: When true, events from enabled_event_types are saved + to the database, making them available through the admin console. + Defaults to false. + type: boolean + eventsExpiration: + description: The amount of time in seconds events will be saved + in the database. Defaults to 0 or never. + type: number + eventsListeners: + description: The event listeners that events should be sent to. + Defaults to [] or none. Note that new realms enable the jboss-logging + listener by default, and this resource will remove that unless + it is specified. + items: + type: string + type: array + x-kubernetes-list-type: set + id: + type: string + realmId: + description: The name of the realm the event settings apply to. + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/realm.keycloak.crossplane.io_userprofiles.yaml b/package/crds/realm.keycloak.crossplane.io_userprofiles.yaml new file mode 100644 index 00000000..b09113e2 --- /dev/null +++ b/package/crds/realm.keycloak.crossplane.io_userprofiles.yaml @@ -0,0 +1,785 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: userprofiles.realm.keycloak.crossplane.io +spec: + group: realm.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: UserProfile + listKind: UserProfileList + plural: userprofiles + singular: userprofile + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + 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: UserProfile is the Schema for the UserProfiles 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: UserProfileSpec defines the desired state of UserProfile + 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: + attribute: + description: An ordered list of attributes. + items: + properties: + annotations: + additionalProperties: + type: string + description: A map of annotations for the attribute. Values + can be a String or a json object. + type: object + x-kubernetes-map-type: granular + displayName: + description: The display name of the attribute. + type: string + enabledWhenScope: + description: A list of scopes. The attribute will only be + enabled when these scopes are requested by clients. + items: + type: string + type: array + x-kubernetes-list-type: set + group: + description: A list of groups. + type: string + name: + description: The name of the attribute. + type: string + permissions: + description: The permissions configuration information. + items: + properties: + edit: + description: A list of profiles that will be able + to edit the attribute. One of admin, user. + items: + type: string + type: array + x-kubernetes-list-type: set + view: + description: A list of profiles that will be able + to view the attribute. One of admin, user. + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + type: array + requiredForRoles: + description: A list of roles for which the attribute will + be required. + items: + type: string + type: array + x-kubernetes-list-type: set + requiredForScopes: + description: A list of scopes for which the attribute will + be required. + items: + type: string + type: array + x-kubernetes-list-type: set + validator: + description: A list of validators for the attribute. + items: + properties: + config: + additionalProperties: + type: string + description: A map defining the configuration of the + validator. Values can be a String or a json object. + type: object + x-kubernetes-map-type: granular + name: + description: The name of the attribute. + type: string + type: object + type: array + type: object + type: array + group: + description: A list of groups. + items: + properties: + annotations: + additionalProperties: + type: string + description: A map of annotations for the attribute. Values + can be a String or a json object. + type: object + x-kubernetes-map-type: granular + displayDescription: + description: The display description of the group. + type: string + displayHeader: + description: The display header of the group. + type: string + name: + description: The name of the attribute. + type: string + type: object + type: array + realmId: + description: The ID of the realm the user profile applies to. + 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 + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + attribute: + description: An ordered list of attributes. + items: + properties: + annotations: + additionalProperties: + type: string + description: A map of annotations for the attribute. Values + can be a String or a json object. + type: object + x-kubernetes-map-type: granular + displayName: + description: The display name of the attribute. + type: string + enabledWhenScope: + description: A list of scopes. The attribute will only be + enabled when these scopes are requested by clients. + items: + type: string + type: array + x-kubernetes-list-type: set + group: + description: A list of groups. + type: string + name: + description: The name of the attribute. + type: string + permissions: + description: The permissions configuration information. + items: + properties: + edit: + description: A list of profiles that will be able + to edit the attribute. One of admin, user. + items: + type: string + type: array + x-kubernetes-list-type: set + view: + description: A list of profiles that will be able + to view the attribute. One of admin, user. + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + type: array + requiredForRoles: + description: A list of roles for which the attribute will + be required. + items: + type: string + type: array + x-kubernetes-list-type: set + requiredForScopes: + description: A list of scopes for which the attribute will + be required. + items: + type: string + type: array + x-kubernetes-list-type: set + validator: + description: A list of validators for the attribute. + items: + properties: + config: + additionalProperties: + type: string + description: A map defining the configuration of the + validator. Values can be a String or a json object. + type: object + x-kubernetes-map-type: granular + name: + description: The name of the attribute. + type: string + type: object + type: array + type: object + type: array + group: + description: A list of groups. + items: + properties: + annotations: + additionalProperties: + type: string + description: A map of annotations for the attribute. Values + can be a String or a json object. + type: object + x-kubernetes-map-type: granular + displayDescription: + description: The display description of the group. + type: string + displayHeader: + description: The display header of the group. + type: string + name: + description: The name of the attribute. + type: string + type: object + type: array + realmId: + description: The ID of the realm the user profile applies to. + 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 + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + 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 + 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: UserProfileStatus defines the observed state of UserProfile. + properties: + atProvider: + properties: + attribute: + description: An ordered list of attributes. + items: + properties: + annotations: + additionalProperties: + type: string + description: A map of annotations for the attribute. Values + can be a String or a json object. + type: object + x-kubernetes-map-type: granular + displayName: + description: The display name of the attribute. + type: string + enabledWhenScope: + description: A list of scopes. The attribute will only be + enabled when these scopes are requested by clients. + items: + type: string + type: array + x-kubernetes-list-type: set + group: + description: A list of groups. + type: string + name: + description: The name of the attribute. + type: string + permissions: + description: The permissions configuration information. + items: + properties: + edit: + description: A list of profiles that will be able + to edit the attribute. One of admin, user. + items: + type: string + type: array + x-kubernetes-list-type: set + view: + description: A list of profiles that will be able + to view the attribute. One of admin, user. + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + type: array + requiredForRoles: + description: A list of roles for which the attribute will + be required. + items: + type: string + type: array + x-kubernetes-list-type: set + requiredForScopes: + description: A list of scopes for which the attribute will + be required. + items: + type: string + type: array + x-kubernetes-list-type: set + validator: + description: A list of validators for the attribute. + items: + properties: + config: + additionalProperties: + type: string + description: A map defining the configuration of the + validator. Values can be a String or a json object. + type: object + x-kubernetes-map-type: granular + name: + description: The name of the attribute. + type: string + type: object + type: array + type: object + type: array + group: + description: A list of groups. + items: + properties: + annotations: + additionalProperties: + type: string + description: A map of annotations for the attribute. Values + can be a String or a json object. + type: object + x-kubernetes-map-type: granular + displayDescription: + description: The display description of the group. + type: string + displayHeader: + description: The display header of the group. + type: string + name: + description: The name of the attribute. + type: string + type: object + type: array + id: + type: string + realmId: + description: The ID of the realm the user profile applies to. + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}