model

package
v0.0.0-...-f0b2224 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationName                      = "keycloak"
	MonitoringKey                        = "middleware"
	DatabaseSecretName                   = ApplicationName + "-db-secret"
	PostgresqlPersistentVolumeName       = ApplicationName + "-postgresql-claim"
	PostgresqlBackupPersistentVolumeName = ApplicationName + "-backup"
	PostgresqlDeploymentName             = ApplicationName + "-postgresql"
	KeycloakProbesName                   = ApplicationName + "-probes"
	KeycloakMetricsRouteName             = ApplicationName + "-metrics-rewrite"
	KeycloakMetricsRoutePath             = "/auth/realms/master/metrics"
	KeycloakMetricsRouteRewritePath      = "/auth/realms/master"
	PostgresqlDeploymentComponent        = "database"
	PostgresqlServiceName                = ApplicationName + "-postgresql"
	KeycloakDiscoveryServiceName         = ApplicationName + "-discovery"
	KeycloakMonitoringServiceName        = ApplicationName + "-monitoring"
	KeycloakDeploymentName               = ApplicationName
	KeycloakDeploymentComponent          = "keycloak"
	PostgresqlBackupComponent            = "database-backup"
	PostgresqlDatabase                   = "root"
	PostgresqlUsername                   = ApplicationName
	PostgresqlPasswordLength             = 32
	PostgresqlPersistentVolumeCapacity   = "1Gi"
	PostgresqlPersistentVolumeMountPath  = "/var/lib/pgsql/data"
	DatabaseSecretUsernameProperty       = "POSTGRES_USERNAME" // nolint
	DatabaseSecretPasswordProperty       = "POSTGRES_PASSWORD" // nolint
	// Required by the Integreately Backup Image
	DatabaseSecretHostProperty = "POSTGRES_HOST" // nolint
	// Required by the Integreately Backup Image
	DatabaseSecretDatabaseProperty = "POSTGRES_DATABASE" // nolint
	// Required by the Integreately Backup Image
	DatabaseSecretVersionProperty              = "POSTGRES_VERSION"          // nolint
	DatabaseSecretExternalAddressProperty      = "POSTGRES_EXTERNAL_ADDRESS" // nolint
	DatabaseSecretExternalPortProperty         = "POSTGRES_EXTERNAL_PORT"    // nolint
	KeycloakServicePort                        = 8443
	PostgresDefaultPort                        = 5432
	AdminUsernameProperty                      = "ADMIN_USERNAME"
	AdminPasswordProperty                      = "ADMIN_PASSWORD"
	ServingCertSecretName                      = "sso-x509-https-secret" // nolint
	LivenessProbeProperty                      = "liveness_probe.sh"
	ReadinessProbeProperty                     = "readiness_probe.sh"
	RouteLoadBalancingStrategy                 = "source"
	IngressDefaultHost                         = "keycloak.local"
	PostgresqlBackupServiceAccountName         = "keycloak-realm-operator"
	KeycloakExtensionEnvVar                    = "KEYCLOAK_EXTENSIONS"
	KeycloakExtensionPath                      = "/opt/jboss/keycloak/standalone/deployments"
	KeycloakExtensionsInitContainerPath        = "/opt/extensions"
	RhssoExtensionPath                         = "/opt/eap/standalone/deployments"
	ClientSecretName                           = ApplicationName + "-client-secret"
	ClientSecretClientIDProperty               = "CLIENT_ID"
	ClientSecretClientSecretProperty           = "CLIENT_SECRET"
	MaxUnavailableNumberOfPods                 = 1
	ServiceMonitorName                         = ApplicationName + "-service-monitor"
	MigrateBackupName                          = "migrate-backup"
	DatabaseSecretSslModeProperty              = "SSLMODE"
	DatabaseSecretSslCert                      = ApplicationName + "-db-ssl-cert-secret"
	RhssoDatabaseXAConnectionParamsProperty    = "DB_XA_CONNECTION_PROPERTY"
	RhssoDatabaseNONXAConnectionParamsProperty = "DB_CONNECTION_PROPERTY"
	KeycloakDatabaseConnectionParamsProperty   = "JDBC_PARAMS"
	KeycloakCertificatePath                    = "/opt/jboss/.postgresql"
	RhssoCertificatePath                       = "/home/jboss/.postgresql"
)

Constants for a community Keycloak installation

Variables

View Source
var PodLabels = map[string]string{}

Functions

func ClientScopeDifferenceIntersection

FIXME Find a better way to refactor this code with role difference part above returned clientScopes are always from a

func ClientSecret

func ClientSecret(cr *v1alpha1.KeycloakClient) *v1.Secret

func ClientSecretReconciled

func ClientSecretReconciled(cr *v1alpha1.KeycloakClient, currentState *v1.Secret) *v1.Secret

func ClientSecretSelector

func ClientSecretSelector(cr *v1alpha1.KeycloakClient) client.ObjectKey

func DeprecatedClientSecret

func DeprecatedClientSecret(cr *v1alpha1.KeycloakClient) *v1.Secret

func DeprecatedClientSecretSelector

func DeprecatedClientSecretSelector(cr *v1alpha1.KeycloakClient) client.ObjectKey

func FilterClientScopesByNames

func FilterClientScopesByNames(clientScopes []v1alpha1.KeycloakClientScope, names []string) (filteredScopes []v1alpha1.KeycloakClientScope)

func GenerateRandomBytes

func GenerateRandomBytes(n int) []byte

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateRandomString

func GenerateRandomString(s int) string

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GetExternalDatabaseHost

func GetExternalDatabaseHost(secret *v1.Secret) string

func GetExternalDatabaseName

func GetExternalDatabaseName(secret *v1.Secret) string

func GetExternalDatabasePort

func GetExternalDatabasePort(secret *v1.Secret) int32

func GetRealmUserSecretName

func GetRealmUserSecretName(keycloakNamespace, realmName, userName string) string

func IsIP

func IsIP(host []byte) bool

func KeycloakAdminSecret

func KeycloakAdminSecret(cr *v1alpha1.ExternalKeycloak) *v1.Secret

func KeycloakAdminSecretReconciled

func KeycloakAdminSecretReconciled(cr *v1alpha1.ExternalKeycloak, currentState *v1.Secret) *v1.Secret

func KeycloakAdminSecretSelector

func KeycloakAdminSecretSelector(cr *v1alpha1.ExternalKeycloak) client.ObjectKey

func MergeEnvs

func MergeEnvs(a []v1.EnvVar, b []v1.EnvVar) []v1.EnvVar

This function favors values in "a".

func RealmCredentialSecret

func RealmCredentialSecret(cr *v1alpha1.KeycloakRealm, user *v1alpha1.KeycloakAPIUser, keycloak *v1alpha1.ExternalKeycloak) *v1.Secret

func RoleDifferenceIntersection

returned roles are always from a

func SanitizeNumberOfReplicas

func SanitizeNumberOfReplicas(numberOfReplicas int, isCreate bool) *int32

func SanitizeResourceName

func SanitizeResourceName(name string) string

func SanitizeResourceNameWithAlphaNum

func SanitizeResourceNameWithAlphaNum(text string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL