keycloak-operator/api/v1alpha1/keycloakrealm_types.go
2021-01-10 17:23:04 +01:00

74 lines
2.3 KiB
Go

/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// KeycloakRealmSpec defines the desired state of KeycloakRealm
type KeycloakRealmSpec struct {
// Name is the name of the Realm
Name string `json:"realmName"`
// 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 {
Available bool `json:"available"`
ID string `json:"id"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// KeycloakRealm is the Schema for the keycloakrealms API
type KeycloakRealm struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec KeycloakRealmSpec `json:"spec,omitempty"`
Status KeycloakRealmStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// KeycloakRealmList contains a list of KeycloakRealm
type KeycloakRealmList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []KeycloakRealm `json:"items"`
}
func init() {
SchemeBuilder.Register(&KeycloakRealm{}, &KeycloakRealmList{})
}