87 lines
3 KiB
Go
87 lines
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 {
|
|
// RealmName is the name and public identifier of the Realm
|
|
RealmName string `json:"realmName"`
|
|
|
|
// Secret containing SMTP configuration
|
|
SMTPSecretName string `json:"smtpSecretName,omitempty"`
|
|
|
|
// name shown to the user
|
|
DisplayName *string `json:"displayName,omitempty"`
|
|
// name including HTML tags, or representing a logo image
|
|
DisplayNameHTML *string `json:"displayHTML,omitempty"`
|
|
|
|
// the name of the Theme used for the login pages
|
|
LoginTheme *string `json:"loginTheme,omitempty"`
|
|
|
|
// if the user can use their email address in the login field
|
|
LoginWithEmailAllowed *bool `json:"loginWithEmailAllowed,omitempty"`
|
|
// if a user is allowed to self-register via the registration flow
|
|
RegistrationAllowed *bool `json:"registrationAllowed,omitempty"`
|
|
// if the user should be able to change their username after account creation
|
|
EditUsernameAllowed *bool `json:"editUsernameAllowed,omitempty"`
|
|
// if the email should be used in place of a selectable user identifier
|
|
RegistrationEmailAsUsername *bool `json:"registrationEmailAsUsername,omitempty"`
|
|
// if the user is allowed to use the reset password flow
|
|
ResetPasswordAllowed *bool `json:"resetPasswordAllowed,omitempty"`
|
|
// if emails can be registered multiple times
|
|
DuplicateEmailsAllowed *bool `json:"duplicateEmailsAllowed,omitempty"`
|
|
// if emails should be verified before the user can log into their account
|
|
VerifyEmail *bool `json:"verifyEmail,omitempty"`
|
|
// if long-lived sessions should be offered to the user upon login
|
|
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{})
|
|
}
|