management

package
v3.19.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: GPL-3.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MGMTGetActions                          = newAction("MGMT_GetActions", security.ScopeGlobal)
	MGMTGetRealms                           = newAction("MGMT_GetRealms", security.ScopeGlobal)
	MGMTGetRealm                            = newAction("MGMT_GetRealm", security.ScopeRealm)
	MGMTGetClient                           = newAction("MGMT_GetClient", security.ScopeRealm)
	MGMTGetClients                          = newAction("MGMT_GetClients", security.ScopeRealm)
	MGMTGetRequiredActions                  = newAction("MGMT_GetRequiredActions", security.ScopeRealm)
	MGMTDeleteUser                          = newAction("MGMT_DeleteUser", security.ScopeGroup)
	MGMTGetUser                             = newAction("MGMT_GetUser", security.ScopeGroup)
	MGMTUpdateUser                          = newAction("MGMT_UpdateUser", security.ScopeGroup)
	MGMTLockUser                            = newAction("MGMT_LockUser", security.ScopeGroup)
	MGMTUnlockUser                          = newAction("MGMT_UnlockUser", security.ScopeGroup)
	MGMTGetUsers                            = newAction("MGMT_GetUsers", security.ScopeGroup)
	MGMTCreateUser                          = newAction("MGMT_CreateUser", security.ScopeGroup)
	MGMTGetUserChecks                       = newAction("MGMT_GetUserChecks", security.ScopeGroup)
	MGMTGetUserAccountStatus                = newAction("MGMT_GetUserAccountStatus", security.ScopeGroup)
	MGMTGetUserAccountStatusByEmail         = newAction("MGMT_GetUserAccountStatusByEmail", security.ScopeRealm)
	MGMTGetRolesOfUser                      = newAction("MGMT_GetRolesOfUser", security.ScopeGroup)
	MGMTAddRoleToUser                       = newAction("MGMT_AddRoleToUser", security.ScopeGroup)
	MGMTDeleteRoleForUser                   = newAction("MGMT_DeleteRoleForUser", security.ScopeGroup)
	MGMTGetGroupsOfUser                     = newAction("MGMT_GetGroupsOfUser", security.ScopeGroup)
	MGMTSetGroupsToUser                     = newAction("MGMT_SetGroupsToUser", security.ScopeGroup)
	MGMTAssignableGroupsToUser              = newAction("MGMT_AssignableGroupsToUser", security.ScopeGroup)
	MGMTGetAvailableTrustIDGroups           = newAction("MGMT_GetAvailableTrustIDGroups", security.ScopeRealm)
	MGMTGetTrustIDGroups                    = newAction("MGMT_GetTrustIDGroups", security.ScopeGroup)
	MGMTSetTrustIDGroups                    = newAction("MGMT_SetTrustIDGroups", security.ScopeGroup)
	MGMTGetClientRolesForUser               = newAction("MGMT_GetClientRolesForUser", security.ScopeGroup)
	MGMTAddClientRolesToUser                = newAction("MGMT_AddClientRolesToUser", security.ScopeGroup)
	MGMTResetPassword                       = newAction("MGMT_ResetPassword", security.ScopeGroup)
	MGMTExecuteActionsEmail                 = newAction("MGMT_ExecuteActionsEmail", security.ScopeGroup)
	MGMTSendSmsCode                         = newAction("MGMT_SendSmsCode", security.ScopeGroup)
	MGMTSendOnboardingEmail                 = newAction("MGMT_SendOnboardingEmail", security.ScopeGroup)
	MGMTSendReminderEmail                   = newAction("MGMT_SendReminderEmail", security.ScopeGroup)
	MGMTResetSmsCounter                     = newAction("MGMT_ResetSmsCounter", security.ScopeGroup)
	MGMTCreateRecoveryCode                  = newAction("MGMT_CreateRecoveryCode", security.ScopeGroup)
	MGMTCreateActivationCode                = newAction("MGMT_CreateActivationCode", security.ScopeGroup)
	MGMTGetCredentialsForUser               = newAction("MGMT_GetCredentialsForUser", security.ScopeGroup)
	MGMTDeleteCredentialsForUser            = newAction("MGMT_DeleteCredentialsForUser", security.ScopeGroup)
	MGMTResetCredentialFailuresForUser      = newAction("MGMT_ResetCredentialFailuresForUser", security.ScopeGroup)
	MGMTClearUserLoginFailures              = newAction("MGMT_ClearUserLoginFailures", security.ScopeGroup)
	MGMTGetAttackDetectionStatus            = newAction("MGMT_GetAttackDetectionStatus", security.ScopeGroup)
	MGMTGetRoles                            = newAction("MGMT_GetRoles", security.ScopeRealm)
	MGMTGetRole                             = newAction("MGMT_GetRole", security.ScopeRealm)
	MGMTGetGroups                           = newAction("MGMT_GetGroups", security.ScopeRealm)
	MGMTCreateGroup                         = newAction("MGMT_CreateGroup", security.ScopeRealm)
	MGMTDeleteGroup                         = newAction("MGMT_DeleteGroup", security.ScopeGroup)
	MGMTGetAuthorizations                   = newAction("MGMT_GetAuthorizations", security.ScopeGroup)
	MGMTUpdateAuthorizations                = newAction("MGMT_UpdateAuthorizations", security.ScopeGroup)
	MGMTGetClientRoles                      = newAction("MGMT_GetClientRoles", security.ScopeRealm)
	MGMTCreateClientRole                    = newAction("MGMT_CreateClientRole", security.ScopeRealm)
	MGMTGetRealmCustomConfiguration         = newAction("MGMT_GetRealmCustomConfiguration", security.ScopeRealm)
	MGMTUpdateRealmCustomConfiguration      = newAction("MGMT_UpdateRealmCustomConfiguration", security.ScopeRealm)
	MGMTGetRealmAdminConfiguration          = newAction("MGMT_GetRealmAdminConfiguration", security.ScopeRealm)
	MGMTUpdateRealmAdminConfiguration       = newAction("MGMT_UpdateRealmAdminConfiguration", security.ScopeRealm)
	MGMTGetRealmBackOfficeConfiguration     = newAction("MGMT_GetRealmBackOfficeConfiguration", security.ScopeGroup)
	MGMTUpdateRealmBackOfficeConfiguration  = newAction("MGMT_UpdateRealmBackOfficeConfiguration", security.ScopeGroup)
	MGMTGetUserRealmBackOfficeConfiguration = newAction("MGMT_GetUserRealmBackOfficeConfiguration", security.ScopeRealm)
	MGMTLinkShadowUser                      = newAction("MGMT_LinkShadowUser", security.ScopeRealm)
)

Creates constants for API method names

Functions

func GetActions

func GetActions() []security.Action

GetActions returns available actions

func MakeAddClientRolesToUserEndpoint

func MakeAddClientRolesToUserEndpoint(component Component) cs.Endpoint

MakeAddClientRolesToUserEndpoint creates an endpoint for AddClientRolesToUser

func MakeAddGroupToUserEndpoint

func MakeAddGroupToUserEndpoint(component Component) cs.Endpoint

MakeAddGroupToUserEndpoint creates an endpoint for AddGroupToUser

func MakeAddRoleToUserEndpoint

func MakeAddRoleToUserEndpoint(component Component) cs.Endpoint

MakeAddRoleToUserEndpoint creates an endpoint for AddRoleToUser

func MakeAuthorizationManagementComponentMW

func MakeAuthorizationManagementComponentMW(logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component

MakeAuthorizationManagementComponentMW checks authorization and return an error if the action is not allowed.

func MakeClearUserLoginFailures

func MakeClearUserLoginFailures(component Component) cs.Endpoint

MakeClearUserLoginFailures creates an endpoint for ClearUserLoginFailures

func MakeCreateActivationCodeEndpoint

func MakeCreateActivationCodeEndpoint(component Component) cs.Endpoint

MakeCreateActivationCodeEndpoint creates an endpoint for MakeCreateActivationCode

func MakeCreateClientRoleEndpoint

func MakeCreateClientRoleEndpoint(component Component, logger keycloakb.Logger) cs.Endpoint

MakeCreateClientRoleEndpoint creates an endpoint for CreateClientRole

func MakeCreateGroupEndpoint

func MakeCreateGroupEndpoint(component Component, logger keycloakb.Logger) cs.Endpoint

MakeCreateGroupEndpoint makes the endpoint to create a group.

func MakeCreateRecoveryCodeEndpoint

func MakeCreateRecoveryCodeEndpoint(component Component) cs.Endpoint

MakeCreateRecoveryCodeEndpoint creates an endpoint for MakeCreateRecoveryCode

func MakeCreateUserEndpoint

func MakeCreateUserEndpoint(component Component, logger keycloakb.Logger) cs.Endpoint

MakeCreateUserEndpoint makes the endpoint to create a user.

func MakeDeleteCredentialsForUserEndpoint

func MakeDeleteCredentialsForUserEndpoint(component Component) cs.Endpoint

MakeDeleteCredentialsForUserEndpoint creates an endpoint for DeleteCredentialsForUser

func MakeDeleteGroupEndpoint

func MakeDeleteGroupEndpoint(component Component) cs.Endpoint

MakeDeleteGroupEndpoint creates an endpoint for DeleteGroup

func MakeDeleteGroupForUserEndpoint

func MakeDeleteGroupForUserEndpoint(component Component) cs.Endpoint

MakeDeleteGroupForUserEndpoint creates an endpoint for DeleteGroupForUser

func MakeDeleteRoleForUserEndpoint

func MakeDeleteRoleForUserEndpoint(component Component) cs.Endpoint

MakeDeleteRoleForUserEndpoint creates an endpoint for AddRoleToUser

func MakeDeleteUserEndpoint

func MakeDeleteUserEndpoint(component Component) cs.Endpoint

MakeDeleteUserEndpoint creates an endpoint for DeleteUser

func MakeExecuteActionsEmailEndpoint

func MakeExecuteActionsEmailEndpoint(component Component) cs.Endpoint

MakeExecuteActionsEmailEndpoint creates an endpoint for ExecuteActionsEmail

func MakeGetActionsEndpoint

func MakeGetActionsEndpoint(component Component) cs.Endpoint

MakeGetActionsEndpoint creates an endpoint for GetActions

func MakeGetAttackDetectionStatus

func MakeGetAttackDetectionStatus(component Component) cs.Endpoint

MakeGetAttackDetectionStatus creates an endpoint for GetAttackDetectionStatus

func MakeGetAuthorizationsEndpoint

func MakeGetAuthorizationsEndpoint(component Component) cs.Endpoint

MakeGetAuthorizationsEndpoint creates an endpoint for GetAuthorizations

func MakeGetAvailableTrustIDGroupsEndpoint

func MakeGetAvailableTrustIDGroupsEndpoint(component Component) cs.Endpoint

MakeGetAvailableTrustIDGroupsEndpoint creates an endpoint for GetAvailableTrustIDGroups

func MakeGetClientEndpoint

func MakeGetClientEndpoint(component Component) cs.Endpoint

MakeGetClientEndpoint creates an endpoint for GetClient

func MakeGetClientRolesEndpoint

func MakeGetClientRolesEndpoint(component Component) cs.Endpoint

MakeGetClientRolesEndpoint creates an endpoint for GetClientRoles

func MakeGetClientRolesForUserEndpoint

func MakeGetClientRolesForUserEndpoint(component Component) cs.Endpoint

MakeGetClientRolesForUserEndpoint creates an endpoint for GetClientRolesForUser

func MakeGetClientsEndpoint

func MakeGetClientsEndpoint(component Component) cs.Endpoint

MakeGetClientsEndpoint creates an endpoint for GetClients

func MakeGetCredentialsForUserEndpoint

func MakeGetCredentialsForUserEndpoint(component Component) cs.Endpoint

MakeGetCredentialsForUserEndpoint creates an endpoint for GetCredentialsForUser

func MakeGetGroupsEndpoint

func MakeGetGroupsEndpoint(component Component) cs.Endpoint

MakeGetGroupsEndpoint creates an endpoint for GetGroups

func MakeGetGroupsOfUserEndpoint

func MakeGetGroupsOfUserEndpoint(component Component) cs.Endpoint

MakeGetGroupsOfUserEndpoint creates an endpoint for GetGroupsOfUser

func MakeGetRealmAdminConfigurationEndpoint

func MakeGetRealmAdminConfigurationEndpoint(component Component) cs.Endpoint

MakeGetRealmAdminConfigurationEndpoint creates an endpoint for GetRealmAdminConfiguration

func MakeGetRealmBackOfficeConfigurationEndpoint

func MakeGetRealmBackOfficeConfigurationEndpoint(component Component) cs.Endpoint

MakeGetRealmBackOfficeConfigurationEndpoint creates an endpoint for GetRealmBackOfficeConfiguration

func MakeGetRealmCustomConfigurationEndpoint

func MakeGetRealmCustomConfigurationEndpoint(component Component) cs.Endpoint

MakeGetRealmCustomConfigurationEndpoint creates an endpoint for GetRealmCustomConfiguration

func MakeGetRealmEndpoint

func MakeGetRealmEndpoint(component Component) cs.Endpoint

MakeGetRealmEndpoint makes the Realm endpoint to retrieve a realm.

func MakeGetRealmsEndpoint

func MakeGetRealmsEndpoint(component Component) cs.Endpoint

MakeGetRealmsEndpoint makes the Realms endpoint to retrieve all available realms.

func MakeGetRequiredActionsEndpoint

func MakeGetRequiredActionsEndpoint(component Component) cs.Endpoint

MakeGetRequiredActionsEndpoint creates an endpoint for GetRequiredActions

func MakeGetRoleEndpoint

func MakeGetRoleEndpoint(component Component) cs.Endpoint

MakeGetRoleEndpoint creates an endpoint for GetRole

func MakeGetRolesEndpoint

func MakeGetRolesEndpoint(component Component) cs.Endpoint

MakeGetRolesEndpoint creates an endpoint for GetRoles

func MakeGetRolesOfUserEndpoint

func MakeGetRolesOfUserEndpoint(component Component) cs.Endpoint

MakeGetRolesOfUserEndpoint creates an endpoint for GetRolesOfUser

func MakeGetTrustIDGroupsOfUserEndpoint

func MakeGetTrustIDGroupsOfUserEndpoint(component Component) cs.Endpoint

MakeGetTrustIDGroupsOfUserEndpoint creates an endpoint for GetTrustIDGroupsOfUser

func MakeGetUserAccountStatusByEmailEndpoint

func MakeGetUserAccountStatusByEmailEndpoint(component Component) cs.Endpoint

MakeGetUserAccountStatusByEmailEndpoint creates an endpoint for GetUserAccountStatusByEmail

func MakeGetUserAccountStatusEndpoint

func MakeGetUserAccountStatusEndpoint(component Component) cs.Endpoint

MakeGetUserAccountStatusEndpoint creates an endpoint for GetUserAccountStatus

func MakeGetUserChecksEndpoint

func MakeGetUserChecksEndpoint(component Component) cs.Endpoint

MakeGetUserChecksEndpoint creates an endpoint for GetUserChecks

func MakeGetUserEndpoint

func MakeGetUserEndpoint(component Component) cs.Endpoint

MakeGetUserEndpoint creates an endpoint for GetUser

func MakeGetUserRealmBackOfficeConfigurationEndpoint

func MakeGetUserRealmBackOfficeConfigurationEndpoint(component Component) cs.Endpoint

MakeGetUserRealmBackOfficeConfigurationEndpoint creates an endpoint for GetUserRealmBackOfficeConfiguration

func MakeGetUsersEndpoint

func MakeGetUsersEndpoint(component Component) cs.Endpoint

MakeGetUsersEndpoint creates an endpoint for GetUsers

func MakeLinkShadowUserEndpoint

func MakeLinkShadowUserEndpoint(component Component) cs.Endpoint

MakeLinkShadowUserEndpoint makes the endpoint to create a shadow user.

func MakeLockUserEndpoint

func MakeLockUserEndpoint(component Component) cs.Endpoint

MakeLockUserEndpoint creates an endpoint for LockUser

func MakeManagementHandler

func MakeManagementHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server

MakeManagementHandler make an HTTP handler for a Management endpoint.

func MakeResetCredentialFailuresForUserEndpoint

func MakeResetCredentialFailuresForUserEndpoint(component Component) cs.Endpoint

MakeResetCredentialFailuresForUserEndpoint creates an endpoint for UnlockCredentialForUser

func MakeResetPasswordEndpoint

func MakeResetPasswordEndpoint(component Component) cs.Endpoint

MakeResetPasswordEndpoint creates an endpoint for ResetPassword

func MakeResetSmsCounterEndpoint

func MakeResetSmsCounterEndpoint(component Component) cs.Endpoint

MakeResetSmsCounterEndpoint creates an endpoint for ResetSmsCounter

func MakeSendOnboardingEmailEndpoint

func MakeSendOnboardingEmailEndpoint(component Component, maxLifeSpan int) cs.Endpoint

MakeSendOnboardingEmailEndpoint creates an endpoint for SendOnboardingEmail

func MakeSendReminderEmailEndpoint

func MakeSendReminderEmailEndpoint(component Component) cs.Endpoint

MakeSendReminderEmailEndpoint creates an endpoint for SendReminderEmail

func MakeSendSmsCodeEndpoint

func MakeSendSmsCodeEndpoint(component Component) cs.Endpoint

MakeSendSmsCodeEndpoint creates an endpoint for SendSmsCode

func MakeSetTrustIDGroupsToUserEndpoint

func MakeSetTrustIDGroupsToUserEndpoint(component Component) cs.Endpoint

MakeSetTrustIDGroupsToUserEndpoint creates an endpoint for SetTrustIDGroupsToUser

func MakeUnlockUserEndpoint

func MakeUnlockUserEndpoint(component Component) cs.Endpoint

MakeUnlockUserEndpoint creates an endpoint for LockUser

func MakeUpdateAuthorizationsEndpoint

func MakeUpdateAuthorizationsEndpoint(component Component) cs.Endpoint

MakeUpdateAuthorizationsEndpoint creates an endpoint for UpdateAuthorizations

func MakeUpdateRealmAdminConfigurationEndpoint

func MakeUpdateRealmAdminConfigurationEndpoint(component Component) cs.Endpoint

MakeUpdateRealmAdminConfigurationEndpoint creates an endpoint for UpdateRealmAdminConfiguration

func MakeUpdateRealmBackOfficeConfigurationEndpoint

func MakeUpdateRealmBackOfficeConfigurationEndpoint(component Component) cs.Endpoint

MakeUpdateRealmBackOfficeConfigurationEndpoint creates an endpoint for UpdateRealmBackOfficeConfiguration

func MakeUpdateRealmCustomConfigurationEndpoint

func MakeUpdateRealmCustomConfigurationEndpoint(component Component) cs.Endpoint

MakeUpdateRealmCustomConfigurationEndpoint creates an endpoint for UpdateRealmCustomConfiguration

func MakeUpdateUserEndpoint

func MakeUpdateUserEndpoint(component Component) cs.Endpoint

MakeUpdateUserEndpoint creates an endpoint for UpdateUser

func Validate

func Validate(authorizations []configuration.Authorization, allowedTargetRealmsAndGroupNames map[string]map[string]struct{}) error

Validate the content of the provided array. Returns an error if any issue is detected

Types

type Component

type Component interface {
	GetActions(ctx context.Context) ([]api.ActionRepresentation, error)

	GetRealms(ctx context.Context) ([]api.RealmRepresentation, error)
	GetRealm(ctx context.Context, realmName string) (api.RealmRepresentation, error)
	GetClient(ctx context.Context, realmName, idClient string) (api.ClientRepresentation, error)
	GetClients(ctx context.Context, realmName string) ([]api.ClientRepresentation, error)
	GetRequiredActions(ctx context.Context, realmName string) ([]api.RequiredActionRepresentation, error)

	DeleteUser(ctx context.Context, realmName, userID string) error
	GetUser(ctx context.Context, realmName, userID string) (api.UserRepresentation, error)
	UpdateUser(ctx context.Context, realmName, userID string, user api.UpdatableUserRepresentation) error
	LockUser(ctx context.Context, realmName, userID string) error
	UnlockUser(ctx context.Context, realmName, userID string) error
	GetUsers(ctx context.Context, realmName string, groupIDs []string, paramKV ...string) (api.UsersPageRepresentation, error)
	CreateUser(ctx context.Context, realmName string, user api.UserRepresentation, generateUsername bool, generateNameID bool) (string, error)
	GetUserChecks(ctx context.Context, realmName, userID string) ([]api.UserCheck, error)
	GetUserAccountStatus(ctx context.Context, realmName, userID string) (map[string]bool, error)
	GetUserAccountStatusByEmail(ctx context.Context, realmName, email string) (api.UserStatus, error)
	GetRolesOfUser(ctx context.Context, realmName, userID string) ([]api.RoleRepresentation, error)
	AddRoleToUser(ctx context.Context, realmName, userID string, roleID string) error
	DeleteRoleForUser(ctx context.Context, realmName, userID string, roleID string) error
	GetGroupsOfUser(ctx context.Context, realmName, userID string) ([]api.GroupRepresentation, error)
	AddGroupToUser(ctx context.Context, realmName, userID string, groupID string) error
	DeleteGroupForUser(ctx context.Context, realmName, userID string, groupID string) error
	GetAvailableTrustIDGroups(ctx context.Context, realmName string) ([]string, error)
	GetTrustIDGroupsOfUser(ctx context.Context, realmName, userID string) ([]string, error)
	SetTrustIDGroupsToUser(ctx context.Context, realmName, userID string, groupNames []string) error
	GetClientRolesForUser(ctx context.Context, realmName, userID, clientID string) ([]api.RoleRepresentation, error)
	AddClientRolesToUser(ctx context.Context, realmName, userID, clientID string, roles []api.RoleRepresentation) error

	ResetPassword(ctx context.Context, realmName string, userID string, password api.PasswordRepresentation) (string, error)
	ExecuteActionsEmail(ctx context.Context, realmName string, userID string, actions []api.RequiredAction, paramKV ...string) error
	SendSmsCode(ctx context.Context, realmName string, userID string) (string, error)
	SendOnboardingEmail(ctx context.Context, realmName string, userID string, customerRealm string, reminder bool, lifespan *int) error
	SendReminderEmail(ctx context.Context, realmName string, userID string, paramKV ...string) error
	ResetSmsCounter(ctx context.Context, realmName string, userID string) error
	CreateRecoveryCode(ctx context.Context, realmName string, userID string) (string, error)
	CreateActivationCode(ctx context.Context, realmName string, userID string) (string, error)
	GetCredentialsForUser(ctx context.Context, realmName string, userID string) ([]api.CredentialRepresentation, error)
	DeleteCredentialsForUser(ctx context.Context, realmName string, userID string, credentialID string) error
	ResetCredentialFailuresForUser(ctx context.Context, realmName string, userID string, credentialID string) error
	ClearUserLoginFailures(ctx context.Context, realmName, userID string) error
	GetAttackDetectionStatus(ctx context.Context, realmName, userID string) (api.AttackDetectionStatusRepresentation, error)
	GetRoles(ctx context.Context, realmName string) ([]api.RoleRepresentation, error)
	GetRole(ctx context.Context, realmName string, roleID string) (api.RoleRepresentation, error)
	GetClientRoles(ctx context.Context, realmName, idClient string) ([]api.RoleRepresentation, error)
	CreateClientRole(ctx context.Context, realmName, clientID string, role api.RoleRepresentation) (string, error)

	GetGroups(ctx context.Context, realmName string) ([]api.GroupRepresentation, error)
	CreateGroup(ctx context.Context, realmName string, group api.GroupRepresentation) (string, error)
	DeleteGroup(ctx context.Context, realmName string, groupID string) error
	GetAuthorizations(ctx context.Context, realmName string, groupID string) (api.AuthorizationsRepresentation, error)
	UpdateAuthorizations(ctx context.Context, realmName string, groupID string, group api.AuthorizationsRepresentation) error

	GetRealmCustomConfiguration(ctx context.Context, realmName string) (api.RealmCustomConfiguration, error)
	UpdateRealmCustomConfiguration(ctx context.Context, realmID string, customConfig api.RealmCustomConfiguration) error
	GetRealmAdminConfiguration(ctx context.Context, realmName string) (api.RealmAdminConfiguration, error)
	UpdateRealmAdminConfiguration(ctx context.Context, realmID string, adminConfig api.RealmAdminConfiguration) error
	GetRealmBackOfficeConfiguration(ctx context.Context, realmID string, groupName string) (api.BackOfficeConfiguration, error)
	UpdateRealmBackOfficeConfiguration(ctx context.Context, realmID string, groupName string, config api.BackOfficeConfiguration) error
	GetUserRealmBackOfficeConfiguration(ctx context.Context, realmID string) (api.BackOfficeConfiguration, error)

	LinkShadowUser(ctx context.Context, realmName string, userID string, provider string, fedID api.FederatedIdentityRepresentation) error
}

Component is the management component interface.

func NewComponent

func NewComponent(keycloakClient KeycloakClient, usersDBModule UsersDetailsDBModule, eventDBModule database.EventsDBModule,
	configDBModule keycloakb.ConfigurationDBModule, onboardingModule OnboardingModule, authorizedTrustIDGroups []string, socialRealmName string,
	glnVerifier GlnVerifier, logger keycloakb.Logger) Component

NewComponent returns the management component.

type ConvertLocationError

type ConvertLocationError struct {
	Location string
}

ConvertLocationError type

func (ConvertLocationError) Error

func (e ConvertLocationError) Error() string

type Endpoints

type Endpoints struct {
	GetRealms          endpoint.Endpoint
	GetRealm           endpoint.Endpoint
	GetClient          endpoint.Endpoint
	GetClients         endpoint.Endpoint
	GetRequiredActions endpoint.Endpoint

	DeleteUser                  endpoint.Endpoint
	GetUser                     endpoint.Endpoint
	UpdateUser                  endpoint.Endpoint
	LockUser                    endpoint.Endpoint
	UnlockUser                  endpoint.Endpoint
	GetUsers                    endpoint.Endpoint
	CreateUser                  endpoint.Endpoint
	GetRolesOfUser              endpoint.Endpoint
	AddRoleToUser               endpoint.Endpoint
	DeleteRoleForUser           endpoint.Endpoint
	GetGroupsOfUser             endpoint.Endpoint
	AddGroupToUser              endpoint.Endpoint
	DeleteGroupForUser          endpoint.Endpoint
	GetAvailableTrustIDGroups   endpoint.Endpoint
	GetTrustIDGroupsOfUser      endpoint.Endpoint
	SetTrustIDGroupsToUser      endpoint.Endpoint
	GetUserChecks               endpoint.Endpoint
	GetUserAccountStatus        endpoint.Endpoint
	GetUserAccountStatusByEmail endpoint.Endpoint
	GetClientRoleForUser        endpoint.Endpoint
	AddClientRoleToUser         endpoint.Endpoint

	ResetPassword                  endpoint.Endpoint
	ExecuteActionsEmail            endpoint.Endpoint
	SendSmsCode                    endpoint.Endpoint
	SendOnboardingEmail            endpoint.Endpoint
	SendReminderEmail              endpoint.Endpoint
	ResetSmsCounter                endpoint.Endpoint
	CreateRecoveryCode             endpoint.Endpoint
	CreateActivationCode           endpoint.Endpoint
	GetCredentialsForUser          endpoint.Endpoint
	DeleteCredentialsForUser       endpoint.Endpoint
	ResetCredentialFailuresForUser endpoint.Endpoint
	ClearUserLoginFailures         endpoint.Endpoint
	GetAttackDetectionStatus       endpoint.Endpoint

	GetRoles         endpoint.Endpoint
	GetRole          endpoint.Endpoint
	GetClientRoles   endpoint.Endpoint
	CreateClientRole endpoint.Endpoint

	GetGroups            endpoint.Endpoint
	CreateGroup          endpoint.Endpoint
	DeleteGroup          endpoint.Endpoint
	GetAuthorizations    endpoint.Endpoint
	UpdateAuthorizations endpoint.Endpoint
	GetActions           endpoint.Endpoint

	GetRealmCustomConfiguration         endpoint.Endpoint
	UpdateRealmCustomConfiguration      endpoint.Endpoint
	GetRealmAdminConfiguration          endpoint.Endpoint
	UpdateRealmAdminConfiguration       endpoint.Endpoint
	GetRealmBackOfficeConfiguration     endpoint.Endpoint
	UpdateRealmBackOfficeConfiguration  endpoint.Endpoint
	GetUserRealmBackOfficeConfiguration endpoint.Endpoint

	LinkShadowUser endpoint.Endpoint
}

Endpoints wraps a service behind a set of endpoints.

type GlnVerifier

type GlnVerifier interface {
	ValidateGLN(firstName, lastName, gln string) error
}

GlnVerifier interface allows to check validity of a GLN

type KeycloakClient

type KeycloakClient interface {
	GetRealms(accessToken string) ([]kc.RealmRepresentation, error)
	GetRealm(accessToken string, realmName string) (kc.RealmRepresentation, error)
	GetRequiredActions(accessToken string, realmName string) ([]kc.RequiredActionProviderRepresentation, error)
	GetClient(accessToken string, realmName, idClient string) (kc.ClientRepresentation, error)
	GetClients(accessToken string, realmName string, paramKV ...string) ([]kc.ClientRepresentation, error)
	DeleteUser(accessToken string, realmName, userID string) error
	GetUser(accessToken string, realmName, userID string) (kc.UserRepresentation, error)
	GetGroupsOfUser(accessToken string, realmName, userID string) ([]kc.GroupRepresentation, error)
	AddGroupToUser(accessToken string, realmName, userID, groupID string) error
	DeleteGroupFromUser(accessToken string, realmName, userID, groupID string) error
	UpdateUser(accessToken string, realmName, userID string, user kc.UserRepresentation) error
	GetUsers(accessToken string, reqRealmName, targetRealmName string, paramKV ...string) (kc.UsersPageRepresentation, error)
	CreateUser(accessToken string, realmName string, targetRealmName string, user kc.UserRepresentation) (string, error)
	GetClientRoleMappings(accessToken string, realmName, userID, clientID string) ([]kc.RoleRepresentation, error)
	AddClientRolesToUserRoleMapping(accessToken string, realmName, userID, clientID string, roles []kc.RoleRepresentation) error
	GetRealmLevelRoleMappings(accessToken string, realmName, userID string) ([]kc.RoleRepresentation, error)
	AddRealmLevelRoleMappings(accessToken string, realmName, userID string, roles []kc.RoleRepresentation) error
	DeleteRealmLevelRoleMappings(accessToken string, realmName, userID string, roles []kc.RoleRepresentation) error
	ResetPassword(accessToken string, realmName string, userID string, cred kc.CredentialRepresentation) error
	ExecuteActionsEmail(accessToken string, reqRealmName string, targetRealmName string, userID string, actions []string, paramKV ...string) error
	SendSmsCode(accessToken string, realmName string, userID string) (kc.SmsCodeRepresentation, error)
	CreateRecoveryCode(accessToken string, realmName string, userID string) (kc.RecoveryCodeRepresentation, error)
	CreateActivationCode(accessToken string, realmName string, userID string) (kc.ActivationCodeRepresentation, error)
	SendReminderEmail(accessToken string, realmName string, userID string, paramKV ...string) error
	GetRoles(accessToken string, realmName string) ([]kc.RoleRepresentation, error)
	GetRole(accessToken string, realmName string, roleID string) (kc.RoleRepresentation, error)
	GetGroups(accessToken string, realmName string) ([]kc.GroupRepresentation, error)
	GetClientRoles(accessToken string, realmName, idClient string) ([]kc.RoleRepresentation, error)
	CreateClientRole(accessToken string, realmName, clientID string, role kc.RoleRepresentation) (string, error)
	GetGroup(accessToken string, realmName, groupID string) (kc.GroupRepresentation, error)
	CreateGroup(accessToken string, realmName string, group kc.GroupRepresentation) (string, error)
	DeleteGroup(accessToken string, realmName string, groupID string) error
	AssignClientRole(accessToken string, realmName string, groupID string, clientID string, role []kc.RoleRepresentation) error
	RemoveClientRole(accessToken string, realmName string, groupID string, clientID string, role []kc.RoleRepresentation) error
	GetGroupClientRoles(accessToken string, realmName string, groupID string, clientID string) ([]kc.RoleRepresentation, error)
	GetAvailableGroupClientRoles(accessToken string, realmName string, groupID string, clientID string) ([]kc.RoleRepresentation, error)
	GetCredentials(accessToken string, realmName string, userID string) ([]kc.CredentialRepresentation, error)
	UpdateLabelCredential(accessToken string, realmName string, userID string, credentialID string, label string) error
	DeleteCredential(accessToken string, realmName string, userID string, credentialID string) error
	ResetPapercardFailures(accessToken string, realmName string, userID string, credentialID string) error
	LinkShadowUser(accessToken string, realmName string, userID string, provider string, fedID kc.FederatedIdentityRepresentation) error
	ClearUserLoginFailures(accessToken string, realmName, userID string) error
	GetAttackDetectionStatus(accessToken string, realmName, userID string) (map[string]interface{}, error)
}

KeycloakClient are methods from keycloak-client used by this component

type LocationHeader

type LocationHeader struct {
	URL string
}

LocationHeader type

type OnboardingModule

type OnboardingModule interface {
	OnboardingAlreadyCompleted(kc.UserRepresentation) (bool, error)
	SendOnboardingEmail(ctx context.Context, accessToken string, realmName string, userID string, username string,
		onboardingClientID string, onboardingRedirectURI string, themeRealmName string, reminder bool, lifespan *int) error
	CreateUser(ctx context.Context, accessToken, realmName, targetRealmName string, kcUser *kc.UserRepresentation) (string, error)
}

OnboardingModule is the interface for the onboarding process

type UsersDetailsDBModule

type UsersDetailsDBModule interface {
	StoreOrUpdateUserDetails(ctx context.Context, realm string, user dto.DBUser) error
	GetUserDetails(ctx context.Context, realm string, userID string) (dto.DBUser, error)
	DeleteUserDetails(ctx context.Context, realm string, userID string) error
	GetChecks(ctx context.Context, realm string, userID string) ([]dto.DBCheck, error)
}

UsersDetailsDBModule is the interface from the users module

Jump to

Keyboard shortcuts

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