Documentation ¶
Index ¶
- Constants
- func EnsureCredential(user *v1alpha1.KeycloakAPIUser)
- func EnsureCredentials(users []*v1alpha1.KeycloakAPIUser)
- func GetMatchingKeycloaks(ctx context.Context, c client.Client, labelSelector *v1.LabelSelector) (v1alpha1.KeycloakList, error)
- func GetMatchingRealms(ctx context.Context, c client.Client, labelSelector *v1.LabelSelector) (v1alpha1.KeycloakRealmList, error)
- func GetStateFieldName(controllerName string, kind string) string
- func IsDeploymentReady(deployment *v12.Deployment) (bool, error)
- func IsJobReady(job *v13.Job) (bool, error)
- func IsRouteReady(route *v1.Route) bool
- func IsStatefulSetReady(statefulSet *v12.StatefulSet) (bool, error)
- func WatchSecondaryResource(c controller.Controller, controllerName string, resourceKind string, ...) error
- type ActionRunner
- type AssignClientRoleAction
- type AssignRealmRoleAction
- type Background
- type BackupState
- type Client
- func (c *Client) CreateAuthenticatorConfig(authenticatorConfig *v1alpha1.AuthenticatorConfig, ...) error
- func (c *Client) CreateClient(client *v1alpha1.KeycloakAPIClient, realmName string) error
- func (c *Client) CreateFederatedIdentity(fid v1alpha1.FederatedIdentity, userID string, realmName string) error
- func (c *Client) CreateIdentityProvider(identityProvider *v1alpha1.KeycloakIdentityProvider, realmName string) error
- func (c *Client) CreateRealm(realm *v1alpha1.KeycloakRealm) error
- func (c *Client) CreateUser(user *v1alpha1.KeycloakAPIUser, realmName string) error
- func (c *Client) CreateUserClientRole(role *v1alpha1.KeycloakUserRole, realmName, clientID, userID string) error
- func (c *Client) CreateUserRealmRole(role *v1alpha1.KeycloakUserRole, realmName, userID string) error
- func (c *Client) DeleteAuthenticatorConfig(configID, realmName string) error
- func (c *Client) DeleteClient(clientID, realmName string) error
- func (c *Client) DeleteIdentityProvider(alias string, realmName string) error
- func (c *Client) DeleteRealm(realmName string) error
- func (c *Client) DeleteUser(userID, realmName string) error
- func (c *Client) DeleteUserClientRole(role *v1alpha1.KeycloakUserRole, realmName, clientID, userID string) error
- func (c *Client) DeleteUserRealmRole(role *v1alpha1.KeycloakUserRole, realmName, userID string) error
- func (c *Client) FindUserByEmail(email, realm string) (*v1alpha1.KeycloakAPIUser, error)
- func (c *Client) FindUserByUsername(name, realm string) (*v1alpha1.KeycloakAPIUser, error)
- func (c *Client) GetAuthenticatorConfig(configID, realmName string) (*v1alpha1.AuthenticatorConfig, error)
- func (c *Client) GetClient(clientID, realmName string) (*v1alpha1.KeycloakAPIClient, error)
- func (c *Client) GetClientInstall(clientID, realmName string) ([]byte, error)
- func (c *Client) GetClientSecret(clientID, realmName string) (string, error)
- func (c *Client) GetIdentityProvider(alias string, realmName string) (*v1alpha1.KeycloakIdentityProvider, error)
- func (c *Client) GetRealm(realmName string) (*v1alpha1.KeycloakRealm, error)
- func (c *Client) GetUser(userID, realmName string) (*v1alpha1.KeycloakAPIUser, error)
- func (c *Client) GetUserFederatedIdentities(userID string, realmName string) ([]v1alpha1.FederatedIdentity, error)
- func (c *Client) ListAuthenticationExecutionsForFlow(flowAlias, realmName string) ([]*v1alpha1.AuthenticationExecutionInfo, error)
- func (c *Client) ListAvailableUserClientRoles(realmName, clientID, userID string) ([]*v1alpha1.KeycloakUserRole, error)
- func (c *Client) ListAvailableUserRealmRoles(realmName, userID string) ([]*v1alpha1.KeycloakUserRole, error)
- func (c *Client) ListClients(realmName string) ([]*v1alpha1.KeycloakAPIClient, error)
- func (c *Client) ListIdentityProviders(realmName string) ([]*v1alpha1.KeycloakIdentityProvider, error)
- func (c *Client) ListRealms() ([]*v1alpha1.KeycloakRealm, error)
- func (c *Client) ListUserClientRoles(realmName, clientID, userID string) ([]*v1alpha1.KeycloakUserRole, error)
- func (c *Client) ListUserRealmRoles(realmName, userID string) ([]*v1alpha1.KeycloakUserRole, error)
- func (c *Client) ListUsers(realmName string) ([]*v1alpha1.KeycloakAPIUser, error)
- func (c *Client) Ping() error
- func (c *Client) RemoveFederatedIdentity(fid v1alpha1.FederatedIdentity, userID string, realmName string) error
- func (c *Client) UpdateAuthenticatorConfig(authenticatorConfig *v1alpha1.AuthenticatorConfig, realmName string) error
- func (c *Client) UpdateClient(specClient *v1alpha1.KeycloakAPIClient, realmName string) error
- func (c *Client) UpdateIdentityProvider(specIdentityProvider *v1alpha1.KeycloakIdentityProvider, realmName string) error
- func (c *Client) UpdatePassword(user *v1alpha1.KeycloakAPIUser, realmName, newPass string) error
- func (c *Client) UpdateRealm(realm *v1alpha1.KeycloakRealm) error
- func (c *Client) UpdateUser(specUser *v1alpha1.KeycloakAPIUser, realmName string) error
- type ClientState
- type ClusterAction
- type ClusterActionRunner
- func (i *ClusterActionRunner) ApplyOverrides(obj *v1alpha1.KeycloakRealm) error
- func (i *ClusterActionRunner) AssignClientRole(obj *v1alpha1.KeycloakUserRole, clientID, userID, realm string) error
- func (i *ClusterActionRunner) AssignRealmRole(obj *v1alpha1.KeycloakUserRole, userID, realm string) error
- func (i *ClusterActionRunner) Create(obj runtime.Object) error
- func (i *ClusterActionRunner) CreateClient(obj *v1alpha1.KeycloakClient, realm string) error
- func (i *ClusterActionRunner) CreateRealm(obj *v1alpha1.KeycloakRealm) error
- func (i *ClusterActionRunner) CreateUser(obj *v1alpha1.KeycloakUser, realm string) error
- func (i *ClusterActionRunner) DeleteClient(obj *v1alpha1.KeycloakClient, realm string) error
- func (i *ClusterActionRunner) DeleteRealm(obj *v1alpha1.KeycloakRealm) error
- func (i *ClusterActionRunner) DeleteUser(id, realm string) error
- func (i *ClusterActionRunner) Ping() error
- func (i *ClusterActionRunner) RemoveClientRole(obj *v1alpha1.KeycloakUserRole, clientID, userID, realm string) error
- func (i *ClusterActionRunner) RemoveRealmRole(obj *v1alpha1.KeycloakUserRole, userID, realm string) error
- func (i *ClusterActionRunner) RunAll(desiredState DesiredClusterState) error
- func (i *ClusterActionRunner) Update(obj runtime.Object) error
- func (i *ClusterActionRunner) UpdateClient(obj *v1alpha1.KeycloakClient, realm string) error
- func (i *ClusterActionRunner) UpdateUser(obj *v1alpha1.KeycloakUser, realm string) error
- type ClusterState
- type ConfigureRealmAction
- type CreateClientAction
- type CreateRealmAction
- type CreateUserAction
- type DeleteClientAction
- type DeleteRealmAction
- type DeleteUserAction
- type DesiredClusterState
- type GenericCreateAction
- type GenericUpdateAction
- type KeycloakClientFactory
- type KeycloakInterface
- type LocalConfigKeycloakFactory
- type PingAction
- type RealmState
- type RemoveClientRoleAction
- type RemoveRealmRoleAction
- type Requester
- type StateManager
- type T
- type UpdateClientAction
- type UpdateUserAction
- type UserState
- func (i *UserState) GetAvailableClientRole(name, clientID string) *v1alpha1.KeycloakUserRole
- func (i *UserState) GetAvailableRealmRole(name string) *v1alpha1.KeycloakUserRole
- func (i *UserState) GetClientByID(clientID string) *v1alpha1.KeycloakAPIClient
- func (i *UserState) Read(keycloakClient KeycloakInterface, userClient client.Client, ...) error
Constants ¶
const ( RouteKind = "Route" JobKind = "Job" CronJobKind = "CronJob" SecretKind = "Secret" StatefulSetKind = "StatefulSet" ServiceKind = "Service" IngressKind = "Ingress" DeploymentKind = "Deployment" PersistentVolumeClaimKind = "PersistentVolumeClaim" )
These kinds are not provided by the openshift api
const (
ConditionStatusSuccess = "True"
)
const (
RHSSOProfile = "RHSSO"
)
const (
RealmLabelSelectorsKey = "realmLabelSelectors"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureCredential ¶
func EnsureCredential(user *v1alpha1.KeycloakAPIUser)
func EnsureCredentials ¶
func EnsureCredentials(users []*v1alpha1.KeycloakAPIUser)
Auto generate a password if the user didn't specify one It will be written to the secret
func GetMatchingKeycloaks ¶
func GetMatchingKeycloaks(ctx context.Context, c client.Client, labelSelector *v1.LabelSelector) (v1alpha1.KeycloakList, error)
Try to get a list of keycloak instances that match the selector specified on the realm
func GetMatchingRealms ¶
func GetMatchingRealms(ctx context.Context, c client.Client, labelSelector *v1.LabelSelector) (v1alpha1.KeycloakRealmList, error)
Try to get a list of keycloak instances that match the selector specified on the realm
func GetStateFieldName ¶
func IsDeploymentReady ¶
func IsDeploymentReady(deployment *v12.Deployment) (bool, error)
func IsRouteReady ¶
func IsStatefulSetReady ¶
func IsStatefulSetReady(statefulSet *v12.StatefulSet) (bool, error)
func WatchSecondaryResource ¶
func WatchSecondaryResource(c controller.Controller, controllerName string, resourceKind string, objectTypetoWatch runtime.Object, cr runtime.Object) error
Types ¶
type ActionRunner ¶
type ActionRunner interface { RunAll(desiredState DesiredClusterState) error Create(obj runtime.Object) error Update(obj runtime.Object) error CreateRealm(obj *v1alpha1.KeycloakRealm) error DeleteRealm(obj *v1alpha1.KeycloakRealm) error CreateClient(keycloakClient *v1alpha1.KeycloakClient, Realm string) error DeleteClient(keycloakClient *v1alpha1.KeycloakClient, Realm string) error UpdateClient(keycloakClient *v1alpha1.KeycloakClient, Realm string) error CreateUser(obj *v1alpha1.KeycloakUser, realm string) error UpdateUser(obj *v1alpha1.KeycloakUser, realm string) error DeleteUser(id, realm string) error AssignRealmRole(obj *v1alpha1.KeycloakUserRole, userID, realm string) error RemoveRealmRole(obj *v1alpha1.KeycloakUserRole, userID, realm string) error AssignClientRole(obj *v1alpha1.KeycloakUserRole, clientID, userID, realm string) error RemoveClientRole(obj *v1alpha1.KeycloakUserRole, clientID, userID, realm string) error ApplyOverrides(obj *v1alpha1.KeycloakRealm) error Ping() error }
func NewClusterActionRunner ¶
func NewClusterActionRunner(context context.Context, client client.Client, scheme *runtime.Scheme, cr runtime.Object) ActionRunner
Create an action runner to run kubernetes actions
func NewClusterAndKeycloakActionRunner ¶
func NewClusterAndKeycloakActionRunner(context context.Context, client client.Client, scheme *runtime.Scheme, cr runtime.Object, keycloakClient KeycloakInterface) ActionRunner
Create an action runner to run kubernetes and keycloak api actions
type AssignClientRoleAction ¶
type AssignClientRoleAction struct { UserID string ClientID string Ref *v1alpha1.KeycloakUserRole Realm string Msg string }
func (AssignClientRoleAction) Run ¶
func (i AssignClientRoleAction) Run(runner ActionRunner) (string, error)
type AssignRealmRoleAction ¶
type AssignRealmRoleAction struct { UserID string Ref *v1alpha1.KeycloakUserRole Realm string Msg string }
func (AssignRealmRoleAction) Run ¶
func (i AssignRealmRoleAction) Run(runner ActionRunner) (string, error)
type Background ¶
type Background struct { SubscriptionChannel chan schema.GroupVersionKind // contains filtered or unexported fields }
Background represents a procedure that runs in the background, periodically auto-detecting features
func NewAutoDetect ¶
func NewAutoDetect(mgr manager.Manager) (*Background, error)
New creates a new auto-detect runner
func (*Background) Start ¶
func (b *Background) Start()
Start initializes the auto-detection process that runs in the background
func (*Background) Stop ¶
func (b *Background) Stop()
Stop causes the background process to stop auto detecting capabilities
type BackupState ¶
type BackupState struct { LocalPersistentVolumeJob *v12.Job LocalPersistentVolumeClaim *v1.PersistentVolumeClaim AwsJob *v12.Job AwsPeriodicJob *v1beta1.CronJob }
func NewBackupState ¶
func NewBackupState() *BackupState
func (*BackupState) IsResourcesReady ¶
func (i *BackupState) IsResourcesReady() (bool, error)
func (*BackupState) Read ¶
func (i *BackupState) Read(context context.Context, cr *kc.KeycloakBackup, controllerClient client.Client) error
type Client ¶
type Client struct { URL string // contains filtered or unexported fields }
func (*Client) CreateAuthenticatorConfig ¶
func (c *Client) CreateAuthenticatorConfig(authenticatorConfig *v1alpha1.AuthenticatorConfig, realmName, executionID string) error
func (*Client) CreateClient ¶
func (c *Client) CreateClient(client *v1alpha1.KeycloakAPIClient, realmName string) error
func (*Client) CreateFederatedIdentity ¶
func (*Client) CreateIdentityProvider ¶
func (c *Client) CreateIdentityProvider(identityProvider *v1alpha1.KeycloakIdentityProvider, realmName string) error
func (*Client) CreateRealm ¶
func (c *Client) CreateRealm(realm *v1alpha1.KeycloakRealm) error
func (*Client) CreateUser ¶
func (c *Client) CreateUser(user *v1alpha1.KeycloakAPIUser, realmName string) error
func (*Client) CreateUserClientRole ¶
func (c *Client) CreateUserClientRole(role *v1alpha1.KeycloakUserRole, realmName, clientID, userID string) error
func (*Client) CreateUserRealmRole ¶
func (c *Client) CreateUserRealmRole(role *v1alpha1.KeycloakUserRole, realmName, userID string) error
func (*Client) DeleteAuthenticatorConfig ¶
func (*Client) DeleteClient ¶
func (*Client) DeleteIdentityProvider ¶
func (*Client) DeleteRealm ¶
func (*Client) DeleteUser ¶
func (*Client) DeleteUserClientRole ¶
func (c *Client) DeleteUserClientRole(role *v1alpha1.KeycloakUserRole, realmName, clientID, userID string) error
func (*Client) DeleteUserRealmRole ¶
func (c *Client) DeleteUserRealmRole(role *v1alpha1.KeycloakUserRole, realmName, userID string) error
func (*Client) FindUserByEmail ¶
func (c *Client) FindUserByEmail(email, realm string) (*v1alpha1.KeycloakAPIUser, error)
func (*Client) FindUserByUsername ¶
func (c *Client) FindUserByUsername(name, realm string) (*v1alpha1.KeycloakAPIUser, error)
func (*Client) GetAuthenticatorConfig ¶
func (c *Client) GetAuthenticatorConfig(configID, realmName string) (*v1alpha1.AuthenticatorConfig, error)
func (*Client) GetClient ¶
func (c *Client) GetClient(clientID, realmName string) (*v1alpha1.KeycloakAPIClient, error)
func (*Client) GetClientInstall ¶
func (*Client) GetClientSecret ¶
func (*Client) GetIdentityProvider ¶
func (*Client) GetRealm ¶
func (c *Client) GetRealm(realmName string) (*v1alpha1.KeycloakRealm, error)
func (*Client) GetUser ¶
func (c *Client) GetUser(userID, realmName string) (*v1alpha1.KeycloakAPIUser, error)
func (*Client) GetUserFederatedIdentities ¶
func (*Client) ListAuthenticationExecutionsForFlow ¶
func (c *Client) ListAuthenticationExecutionsForFlow(flowAlias, realmName string) ([]*v1alpha1.AuthenticationExecutionInfo, error)
func (*Client) ListAvailableUserClientRoles ¶
func (c *Client) ListAvailableUserClientRoles(realmName, clientID, userID string) ([]*v1alpha1.KeycloakUserRole, error)
func (*Client) ListAvailableUserRealmRoles ¶
func (c *Client) ListAvailableUserRealmRoles(realmName, userID string) ([]*v1alpha1.KeycloakUserRole, error)
func (*Client) ListClients ¶
func (c *Client) ListClients(realmName string) ([]*v1alpha1.KeycloakAPIClient, error)
func (*Client) ListIdentityProviders ¶
func (c *Client) ListIdentityProviders(realmName string) ([]*v1alpha1.KeycloakIdentityProvider, error)
func (*Client) ListRealms ¶
func (c *Client) ListRealms() ([]*v1alpha1.KeycloakRealm, error)
func (*Client) ListUserClientRoles ¶
func (c *Client) ListUserClientRoles(realmName, clientID, userID string) ([]*v1alpha1.KeycloakUserRole, error)
func (*Client) ListUserRealmRoles ¶
func (c *Client) ListUserRealmRoles(realmName, userID string) ([]*v1alpha1.KeycloakUserRole, error)
func (*Client) ListUsers ¶
func (c *Client) ListUsers(realmName string) ([]*v1alpha1.KeycloakAPIUser, error)
func (*Client) RemoveFederatedIdentity ¶
func (*Client) UpdateAuthenticatorConfig ¶
func (c *Client) UpdateAuthenticatorConfig(authenticatorConfig *v1alpha1.AuthenticatorConfig, realmName string) error
func (*Client) UpdateClient ¶
func (c *Client) UpdateClient(specClient *v1alpha1.KeycloakAPIClient, realmName string) error
func (*Client) UpdateIdentityProvider ¶
func (c *Client) UpdateIdentityProvider(specIdentityProvider *v1alpha1.KeycloakIdentityProvider, realmName string) error
func (*Client) UpdatePassword ¶
func (c *Client) UpdatePassword(user *v1alpha1.KeycloakAPIUser, realmName, newPass string) error
func (*Client) UpdateRealm ¶
func (c *Client) UpdateRealm(realm *v1alpha1.KeycloakRealm) error
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(specUser *v1alpha1.KeycloakAPIUser, realmName string) error
type ClientState ¶
type ClientState struct { Client *kc.KeycloakAPIClient ClientSecret *v1.Secret Context context.Context Realm *kc.KeycloakRealm }
func NewClientState ¶
func NewClientState(context context.Context, realm *kc.KeycloakRealm) *ClientState
func (*ClientState) Read ¶
func (i *ClientState) Read(context context.Context, cr *kc.KeycloakClient, realmClient KeycloakInterface, controllerClient client.Client) error
type ClusterAction ¶
type ClusterAction interface {
Run(runner ActionRunner) (string, error)
}
type ClusterActionRunner ¶
type ClusterActionRunner struct {
// contains filtered or unexported fields
}
func (*ClusterActionRunner) ApplyOverrides ¶
func (i *ClusterActionRunner) ApplyOverrides(obj *v1alpha1.KeycloakRealm) error
Delete a realm using the keycloak api
func (*ClusterActionRunner) AssignClientRole ¶
func (i *ClusterActionRunner) AssignClientRole(obj *v1alpha1.KeycloakUserRole, clientID, userID, realm string) error
func (*ClusterActionRunner) AssignRealmRole ¶
func (i *ClusterActionRunner) AssignRealmRole(obj *v1alpha1.KeycloakUserRole, userID, realm string) error
func (*ClusterActionRunner) CreateClient ¶
func (i *ClusterActionRunner) CreateClient(obj *v1alpha1.KeycloakClient, realm string) error
func (*ClusterActionRunner) CreateRealm ¶
func (i *ClusterActionRunner) CreateRealm(obj *v1alpha1.KeycloakRealm) error
Create a new realm using the keycloak api
func (*ClusterActionRunner) CreateUser ¶
func (i *ClusterActionRunner) CreateUser(obj *v1alpha1.KeycloakUser, realm string) error
func (*ClusterActionRunner) DeleteClient ¶
func (i *ClusterActionRunner) DeleteClient(obj *v1alpha1.KeycloakClient, realm string) error
func (*ClusterActionRunner) DeleteRealm ¶
func (i *ClusterActionRunner) DeleteRealm(obj *v1alpha1.KeycloakRealm) error
Delete a realm using the keycloak api
func (*ClusterActionRunner) DeleteUser ¶
func (i *ClusterActionRunner) DeleteUser(id, realm string) error
func (*ClusterActionRunner) Ping ¶
func (i *ClusterActionRunner) Ping() error
Check if Keycloak is available
func (*ClusterActionRunner) RemoveClientRole ¶
func (i *ClusterActionRunner) RemoveClientRole(obj *v1alpha1.KeycloakUserRole, clientID, userID, realm string) error
func (*ClusterActionRunner) RemoveRealmRole ¶
func (i *ClusterActionRunner) RemoveRealmRole(obj *v1alpha1.KeycloakUserRole, userID, realm string) error
func (*ClusterActionRunner) RunAll ¶
func (i *ClusterActionRunner) RunAll(desiredState DesiredClusterState) error
func (*ClusterActionRunner) UpdateClient ¶
func (i *ClusterActionRunner) UpdateClient(obj *v1alpha1.KeycloakClient, realm string) error
func (*ClusterActionRunner) UpdateUser ¶
func (i *ClusterActionRunner) UpdateUser(obj *v1alpha1.KeycloakUser, realm string) error
type ClusterState ¶
type ClusterState struct { KeycloakServiceMonitor *monitoringv1.ServiceMonitor KeycloakPrometheusRule *monitoringv1.PrometheusRule KeycloakGrafanaDashboard *integreatlyv1alpha1.GrafanaDashboard DatabaseSecret *v1.Secret PostgresqlPersistentVolumeClaim *v1.PersistentVolumeClaim PostgresqlService *v1.Service PostgresqlDeployment *v12.Deployment KeycloakService *v1.Service KeycloakDiscoveryService *v1.Service KeycloakDeployment *v12.StatefulSet KeycloakAdminSecret *v1.Secret KeycloakIngress *v1beta1.Ingress KeycloakRoute *v13.Route PostgresqlServiceEndpoints *v1.Endpoints }
func NewClusterState ¶
func NewClusterState() *ClusterState
func (*ClusterState) IsResourcesReady ¶
func (i *ClusterState) IsResourcesReady() (bool, error)
type ConfigureRealmAction ¶
type ConfigureRealmAction struct { Ref *v1alpha1.KeycloakRealm Msg string }
func (ConfigureRealmAction) Run ¶
func (i ConfigureRealmAction) Run(runner ActionRunner) (string, error)
type CreateClientAction ¶
type CreateClientAction struct { Ref *v1alpha1.KeycloakClient Msg string Realm string }
func (CreateClientAction) Run ¶
func (i CreateClientAction) Run(runner ActionRunner) (string, error)
type CreateRealmAction ¶
type CreateRealmAction struct { Ref *v1alpha1.KeycloakRealm Msg string }
func (CreateRealmAction) Run ¶
func (i CreateRealmAction) Run(runner ActionRunner) (string, error)
type CreateUserAction ¶
type CreateUserAction struct { Ref *v1alpha1.KeycloakUser Realm string Msg string }
func (CreateUserAction) Run ¶
func (i CreateUserAction) Run(runner ActionRunner) (string, error)
type DeleteClientAction ¶
type DeleteClientAction struct { Ref *v1alpha1.KeycloakClient Realm string Msg string }
func (DeleteClientAction) Run ¶
func (i DeleteClientAction) Run(runner ActionRunner) (string, error)
type DeleteRealmAction ¶
type DeleteRealmAction struct { Ref *v1alpha1.KeycloakRealm Msg string }
func (DeleteRealmAction) Run ¶
func (i DeleteRealmAction) Run(runner ActionRunner) (string, error)
type DeleteUserAction ¶
func (DeleteUserAction) Run ¶
func (i DeleteUserAction) Run(runner ActionRunner) (string, error)
type DesiredClusterState ¶
type DesiredClusterState []ClusterAction
The desired cluster state is defined by a list of actions that have to be run to get from the current state to the desired state
func (*DesiredClusterState) AddAction ¶
func (d *DesiredClusterState) AddAction(action ClusterAction) DesiredClusterState
func (*DesiredClusterState) AddActions ¶
func (d *DesiredClusterState) AddActions(actions []ClusterAction) DesiredClusterState
type GenericCreateAction ¶
An action to create generic kubernetes resources (resources that don't require special treatment)
func (GenericCreateAction) Run ¶
func (i GenericCreateAction) Run(runner ActionRunner) (string, error)
type GenericUpdateAction ¶
An action to update generic kubernetes resources (resources that don't require special treatment)
func (GenericUpdateAction) Run ¶
func (i GenericUpdateAction) Run(runner ActionRunner) (string, error)
type KeycloakClientFactory ¶
type KeycloakClientFactory interface {
AuthenticatedClient(kc v1alpha1.Keycloak) (KeycloakInterface, error)
}
KeycloakClientFactory interface
type KeycloakInterface ¶
type KeycloakInterface interface { Ping() error CreateRealm(realm *v1alpha1.KeycloakRealm) error GetRealm(realmName string) (*v1alpha1.KeycloakRealm, error) UpdateRealm(specRealm *v1alpha1.KeycloakRealm) error DeleteRealm(realmName string) error ListRealms() ([]*v1alpha1.KeycloakRealm, error) CreateClient(client *v1alpha1.KeycloakAPIClient, realmName string) error GetClient(clientID, realmName string) (*v1alpha1.KeycloakAPIClient, error) GetClientSecret(clientID, realmName string) (string, error) GetClientInstall(clientID, realmName string) ([]byte, error) UpdateClient(specClient *v1alpha1.KeycloakAPIClient, realmName string) error DeleteClient(clientID, realmName string) error ListClients(realmName string) ([]*v1alpha1.KeycloakAPIClient, error) CreateUser(user *v1alpha1.KeycloakAPIUser, realmName string) error CreateFederatedIdentity(fid v1alpha1.FederatedIdentity, userID string, realmName string) error RemoveFederatedIdentity(fid v1alpha1.FederatedIdentity, userID string, realmName string) error GetUserFederatedIdentities(userName string, realmName string) ([]v1alpha1.FederatedIdentity, error) UpdatePassword(user *v1alpha1.KeycloakAPIUser, realmName, newPass string) error FindUserByEmail(email, realm string) (*v1alpha1.KeycloakAPIUser, error) FindUserByUsername(name, realm string) (*v1alpha1.KeycloakAPIUser, error) GetUser(userID, realmName string) (*v1alpha1.KeycloakAPIUser, error) UpdateUser(specUser *v1alpha1.KeycloakAPIUser, realmName string) error DeleteUser(userID, realmName string) error ListUsers(realmName string) ([]*v1alpha1.KeycloakAPIUser, error) CreateIdentityProvider(identityProvider *v1alpha1.KeycloakIdentityProvider, realmName string) error GetIdentityProvider(alias, realmName string) (*v1alpha1.KeycloakIdentityProvider, error) UpdateIdentityProvider(specIdentityProvider *v1alpha1.KeycloakIdentityProvider, realmName string) error DeleteIdentityProvider(alias, realmName string) error ListIdentityProviders(realmName string) ([]*v1alpha1.KeycloakIdentityProvider, error) CreateUserClientRole(role *v1alpha1.KeycloakUserRole, realmName, clientID, userID string) error ListUserClientRoles(realmName, clientID, userID string) ([]*v1alpha1.KeycloakUserRole, error) ListAvailableUserClientRoles(realmName, clientID, userID string) ([]*v1alpha1.KeycloakUserRole, error) DeleteUserClientRole(role *v1alpha1.KeycloakUserRole, realmName, clientID, userID string) error CreateUserRealmRole(role *v1alpha1.KeycloakUserRole, realmName, userID string) error ListUserRealmRoles(realmName, userID string) ([]*v1alpha1.KeycloakUserRole, error) ListAvailableUserRealmRoles(realmName, userID string) ([]*v1alpha1.KeycloakUserRole, error) DeleteUserRealmRole(role *v1alpha1.KeycloakUserRole, realmName, userID string) error ListAuthenticationExecutionsForFlow(flowAlias, realmName string) ([]*v1alpha1.AuthenticationExecutionInfo, error) CreateAuthenticatorConfig(authenticatorConfig *v1alpha1.AuthenticatorConfig, realmName, executionID string) error GetAuthenticatorConfig(configID, realmName string) (*v1alpha1.AuthenticatorConfig, error) UpdateAuthenticatorConfig(authenticatorConfig *v1alpha1.AuthenticatorConfig, realmName string) error DeleteAuthenticatorConfig(configID, realmName string) error }
type LocalConfigKeycloakFactory ¶
type LocalConfigKeycloakFactory struct { }
func (*LocalConfigKeycloakFactory) AuthenticatedClient ¶
func (i *LocalConfigKeycloakFactory) AuthenticatedClient(kc v1alpha1.Keycloak) (KeycloakInterface, error)
AuthenticatedClient returns an authenticated client for requesting endpoints from the Keycloak api
type PingAction ¶
type PingAction struct {
Msg string
}
func (PingAction) Run ¶
func (i PingAction) Run(runner ActionRunner) (string, error)
type RealmState ¶
type RealmState struct { Realm *kc.KeycloakRealm RealmUserSecrets map[string]*v1.Secret Context context.Context Keycloak *kc.Keycloak }
func NewRealmState ¶
func NewRealmState(context context.Context, keycloak kc.Keycloak) *RealmState
func (*RealmState) Read ¶
func (i *RealmState) Read(cr *kc.KeycloakRealm, realmClient KeycloakInterface, controllerClient client.Client) error
type RemoveClientRoleAction ¶
type RemoveClientRoleAction struct { UserID string ClientID string Ref *v1alpha1.KeycloakUserRole Realm string Msg string }
func (RemoveClientRoleAction) Run ¶
func (i RemoveClientRoleAction) Run(runner ActionRunner) (string, error)
type RemoveRealmRoleAction ¶
type RemoveRealmRoleAction struct { UserID string Ref *v1alpha1.KeycloakUserRole Realm string Msg string }
func (RemoveRealmRoleAction) Run ¶
func (i RemoveRealmRoleAction) Run(runner ActionRunner) (string, error)
type StateManager ¶
func GetStateManager ¶
func GetStateManager() *StateManager
func (*StateManager) Clear ¶
func (sm *StateManager) Clear()
func (*StateManager) GetState ¶
func (sm *StateManager) GetState(key string) interface{}
func (*StateManager) SetState ¶
func (sm *StateManager) SetState(key string, value interface{})
type UpdateClientAction ¶
type UpdateClientAction struct { Ref *v1alpha1.KeycloakClient Msg string Realm string }
func (UpdateClientAction) Run ¶
func (i UpdateClientAction) Run(runner ActionRunner) (string, error)
type UpdateUserAction ¶
type UpdateUserAction struct { Ref *v1alpha1.KeycloakUser Realm string Msg string }
func (UpdateUserAction) Run ¶
func (i UpdateUserAction) Run(runner ActionRunner) (string, error)
type UserState ¶
type UserState struct { User *v1alpha1.KeycloakAPIUser ClientRoles map[string][]*v1alpha1.KeycloakUserRole RealmRoles []*v1alpha1.KeycloakUserRole AvailableClientRoles map[string][]*v1alpha1.KeycloakUserRole AvailableRealmRoles []*v1alpha1.KeycloakUserRole Clients []*v1alpha1.KeycloakAPIClient Secret *v1.Secret Keycloak v1alpha1.Keycloak Context context.Context }
func NewUserState ¶
func (*UserState) GetAvailableClientRole ¶
func (i *UserState) GetAvailableClientRole(name, clientID string) *v1alpha1.KeycloakUserRole
Check if a client role is part of the available roles for this user Don't allow to assign unavailable roles
func (*UserState) GetAvailableRealmRole ¶
func (i *UserState) GetAvailableRealmRole(name string) *v1alpha1.KeycloakUserRole
Check if a realm role is part of the available roles for this user Don't allow to assign unavailable roles
func (*UserState) GetClientByID ¶
func (i *UserState) GetClientByID(clientID string) *v1alpha1.KeycloakAPIClient
Keycloak clients have `ID` and `ClientID` properties and depending on the action we need one or the other. This function translates between the two
func (*UserState) Read ¶
func (i *UserState) Read(keycloakClient KeycloakInterface, userClient client.Client, user *v1alpha1.KeycloakUser, realm v1alpha1.KeycloakRealm) error