From a97964009646a121710f8a8f8bfbfe23102676eb Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 10 Jan 2021 17:23:04 +0100 Subject: [PATCH] Add attributes to realm --- api/v1alpha1/keycloakrealm_types.go | 27 +++++++++----- api/v1alpha1/zz_generated.deepcopy.go | 52 ++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 10 deletions(-) diff --git a/api/v1alpha1/keycloakrealm_types.go b/api/v1alpha1/keycloakrealm_types.go index 9ac649f..c1af23f 100644 --- a/api/v1alpha1/keycloakrealm_types.go +++ b/api/v1alpha1/keycloakrealm_types.go @@ -20,22 +20,31 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - // KeycloakRealmSpec defines the desired state of KeycloakRealm type KeycloakRealmSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file + // Name is the name of the Realm + Name string `json:"realmName"` - // Foo is an example field of KeycloakRealm. Edit KeycloakRealm_types.go to remove/update - Foo string `json:"foo,omitempty"` + // User readable names + DisplayName *string `json:"displayName,omitempty"` + DisplayNameHTML *string `json:"displayHTML,omitempty"` + + LoginTheme *string `json:"loginTheme,omitempty"` + + // Basic realm choices + LoginWithEmailAllowed *bool `json:"loginWithEmailAllowed,omitempty"` + RegistrationAllowed *bool `json:"registrationAllowed,omitempty"` + RegistrationEmailAsUsername *bool `json:"registrationEmailAsUsername,omitempty"` + ResetPasswordAllowed *bool `json:"resetPasswordAllowed,omitempty"` + DuplicateEmailsAllowed *bool `json:"duplicateEmailsAllowed,omitempty"` + VerifyEmail *bool `json:"verifyEmail,omitempty"` + RememberMe *bool `json:"rememberMe,omitempty"` } // KeycloakRealmStatus defines the observed state of KeycloakRealm type KeycloakRealmStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file + Available bool `json:"available"` + ID string `json:"id"` } // +kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 5bcbcdf..acc54cd 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -29,7 +29,7 @@ func (in *KeycloakRealm) DeepCopyInto(out *KeycloakRealm) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status } @@ -86,6 +86,56 @@ func (in *KeycloakRealmList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KeycloakRealmSpec) DeepCopyInto(out *KeycloakRealmSpec) { *out = *in + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.DisplayNameHTML != nil { + in, out := &in.DisplayNameHTML, &out.DisplayNameHTML + *out = new(string) + **out = **in + } + if in.LoginTheme != nil { + in, out := &in.LoginTheme, &out.LoginTheme + *out = new(string) + **out = **in + } + if in.LoginWithEmailAllowed != nil { + in, out := &in.LoginWithEmailAllowed, &out.LoginWithEmailAllowed + *out = new(bool) + **out = **in + } + if in.RegistrationAllowed != nil { + in, out := &in.RegistrationAllowed, &out.RegistrationAllowed + *out = new(bool) + **out = **in + } + if in.RegistrationEmailAsUsername != nil { + in, out := &in.RegistrationEmailAsUsername, &out.RegistrationEmailAsUsername + *out = new(bool) + **out = **in + } + if in.ResetPasswordAllowed != nil { + in, out := &in.ResetPasswordAllowed, &out.ResetPasswordAllowed + *out = new(bool) + **out = **in + } + if in.DuplicateEmailsAllowed != nil { + in, out := &in.DuplicateEmailsAllowed, &out.DuplicateEmailsAllowed + *out = new(bool) + **out = **in + } + if in.VerifyEmail != nil { + in, out := &in.VerifyEmail, &out.VerifyEmail + *out = new(bool) + **out = **in + } + if in.RememberMe != nil { + in, out := &in.RememberMe, &out.RememberMe + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeycloakRealmSpec.