management

package
v2.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: GPL-3.0 Imports: 24 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)
	MGMTGetUsers                            = newAction("MGMT_GetUsers", security.ScopeGroup)
	MGMTCreateUser                          = newAction("MGMT_CreateUser", security.ScopeGroup)
	MGMTGetUserAccountStatus                = newAction("MGMT_GetUserAccountStatus", security.ScopeGroup)
	MGMTGetRolesOfUser                      = newAction("MGMT_GetRolesOfUser", security.ScopeGroup)
	MGMTGetGroupsOfUser                     = newAction("MGMT_GetGroupsOfUser", 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)
	MGMTSendNewEnrolmentCode                = newAction("MGMT_SendNewEnrolmentCode", security.ScopeGroup)
	MGMTSendReminderEmail                   = newAction("MGMT_SendReminderEmail", security.ScopeGroup)
	MGMTResetSmsCounter                     = newAction("MGMT_ResetSmsCounter", security.ScopeGroup)
	MGMTCreateRecoveryCode                  = newAction("MGMT_CreateRecoveryCode", security.ScopeGroup)
	MGMTGetCredentialsForUser               = newAction("MGMT_GetCredentialsForUser", security.ScopeGroup)
	MGMTDeleteCredentialsForUser            = newAction("MGMT_DeleteCredentialsForUser", security.ScopeGroup)
	MGMTClearUserLoginFailures              = newAction("MGMT_ClearUserLoginFailures", 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)
	MGMTCreateShadowUser                    = newAction("MGMT_CreateShadowUser", security.ScopeRealm)
)

Creates constants for API method names

Functions

func MakeAddClientRolesToUserEndpoint

func MakeAddClientRolesToUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeAddClientRolesToUserEndpoint creates an endpoint for AddClientRolesToUser

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(managementComponent ManagementComponent) cs.Endpoint

MakeClearUserLoginFailures creates an endpoint for ClearUserLoginFailures

func MakeCreateClientRoleEndpoint

func MakeCreateClientRoleEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeCreateClientRoleEndpoint creates an endpoint for CreateClientRole

func MakeCreateGroupEndpoint

func MakeCreateGroupEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeCreateGroupEndpoint makes the endpoint to create a group.

func MakeCreateRecoveryCodeEndpoint

func MakeCreateRecoveryCodeEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeCreateRecoveryCodeEndpoint creates an endpoint for MakeCreateRecoveryCode

func MakeCreateShadowUserEndpoint

func MakeCreateShadowUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeCreateShadowUserEndpoint makes the endpoint to create a shadow user.

func MakeCreateUserEndpoint

func MakeCreateUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeCreateUserEndpoint makes the endpoint to create a user.

func MakeDeleteCredentialsForUserEndpoint

func MakeDeleteCredentialsForUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeDeleteCredentialsForUserEndpoint creates an endpoint for DeleteCredentialsForUser

func MakeDeleteGroupEndpoint

func MakeDeleteGroupEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeDeleteGroupEndpoint creates an endpoint for DeleteGroup

func MakeDeleteUserEndpoint

func MakeDeleteUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeDeleteUserEndpoint creates an endpoint for DeleteUser

func MakeExecuteActionsEmailEndpoint

func MakeExecuteActionsEmailEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeExecuteActionsEmailEndpoint creates an endpoint for ExecuteActionsEmail

func MakeGetActionsEndpoint

func MakeGetActionsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetActionsEndpoint creates an endpoint for GetActions

func MakeGetAuthorizationsEndpoint

func MakeGetAuthorizationsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetAuthorizationsEndpoint creates an endpoint for GetAuthorizations

func MakeGetClientEndpoint

func MakeGetClientEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetClientEndpoint creates an endpoint for GetClient

func MakeGetClientRolesEndpoint

func MakeGetClientRolesEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetClientRolesEndpoint creates an endpoint for GetClientRoles

func MakeGetClientRolesForUserEndpoint

func MakeGetClientRolesForUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetClientRolesForUserEndpoint creates an endpoint for GetClientRolesForUser

func MakeGetClientsEndpoint

func MakeGetClientsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetClientsEndpoint creates an endpoint for GetClients

func MakeGetCredentialsForUserEndpoint

func MakeGetCredentialsForUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetCredentialsForUserEndpoint creates an endpoint for GetCredentialsForUser

func MakeGetGroupsEndpoint

func MakeGetGroupsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetGroupsEndpoint creates an endpoint for GetGroups

func MakeGetGroupsOfUserEndpoint

func MakeGetGroupsOfUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetGroupsOfUserEndpoint creates an endpoint for GetGroupsOfUser

func MakeGetRealmAdminConfigurationEndpoint

func MakeGetRealmAdminConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRealmAdminConfigurationEndpoint creates an endpoint for GetRealmAdminConfiguration

func MakeGetRealmBackOfficeConfigurationEndpoint

func MakeGetRealmBackOfficeConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRealmBackOfficeConfigurationEndpoint creates an endpoint for GetRealmBackOfficeConfiguration

func MakeGetRealmCustomConfigurationEndpoint

func MakeGetRealmCustomConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRealmCustomConfigurationEndpoint creates an endpoint for GetRealmCustomConfiguration

func MakeGetRealmEndpoint

func MakeGetRealmEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRealmEndpoint makes the Realm endpoint to retrieve a realm.

func MakeGetRealmsEndpoint

func MakeGetRealmsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRealmsEndpoint makes the Realms endpoint to retrieve all available realms.

func MakeGetRequiredActionsEndpoint

func MakeGetRequiredActionsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRequiredActionsEndpoint creates an endpoint for GetRequiredActions

func MakeGetRoleEndpoint

func MakeGetRoleEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRoleEndpoint creates an endpoint for GetRole

func MakeGetRolesEndpoint

func MakeGetRolesEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRolesEndpoint creates an endpoint for GetRoles

func MakeGetRolesOfUserEndpoint

func MakeGetRolesOfUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetRolesOfUserEndpoint creates an endpoint for GetRolesOfUser

func MakeGetUserAccountStatusEndpoint

func MakeGetUserAccountStatusEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetUserAccountStatusEndpoint creates an endpoint for GetUserAccountStatus

func MakeGetUserEndpoint

func MakeGetUserEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetUserEndpoint creates an endpoint for GetUser

func MakeGetUserRealmBackOfficeConfigurationEndpoint

func MakeGetUserRealmBackOfficeConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetUserRealmBackOfficeConfigurationEndpoint creates an endpoint for GetUserRealmBackOfficeConfiguration

func MakeGetUsersEndpoint

func MakeGetUsersEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeGetUsersEndpoint creates an endpoint for GetUsers

func MakeManagementHandler

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

MakeManagementHandler make an HTTP handler for a Management endpoint.

func MakeResetPasswordEndpoint

func MakeResetPasswordEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeResetPasswordEndpoint creates an endpoint for ResetPassword

func MakeResetSmsCounterEndpoint

func MakeResetSmsCounterEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeResetSmsCounterEndpoint creates an endpoint for ResetSmsCounter

func MakeSendNewEnrolmentCodeEndpoint

func MakeSendNewEnrolmentCodeEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeSendNewEnrolmentCodeEndpoint creates an endpoint for SendNewEnrolmentCode

func MakeSendReminderEmailEndpoint

func MakeSendReminderEmailEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeSendReminderEmailEndpoint creates an endpoint for SendReminderEmail

func MakeSetTrustIDGroupsEndpoint

func MakeSetTrustIDGroupsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeSetTrustIDGroupsEndpoint creates an endpoint for SetTrustIDGroups

func MakeUpdateAuthorizationsEndpoint

func MakeUpdateAuthorizationsEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeUpdateAuthorizationsEndpoint creates an endpoint for UpdateAuthorizations

func MakeUpdateRealmAdminConfigurationEndpoint

func MakeUpdateRealmAdminConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeUpdateRealmAdminConfigurationEndpoint creates an endpoint for UpdateRealmAdminConfiguration

func MakeUpdateRealmBackOfficeConfigurationEndpoint

func MakeUpdateRealmBackOfficeConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeUpdateRealmBackOfficeConfigurationEndpoint creates an endpoint for UpdateRealmBackOfficeConfiguration

func MakeUpdateRealmCustomConfigurationEndpoint

func MakeUpdateRealmCustomConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint

MakeUpdateRealmCustomConfigurationEndpoint creates an endpoint for UpdateRealmCustomConfiguration

func MakeUpdateUserEndpoint

func MakeUpdateUserEndpoint(managementComponent ManagementComponent) 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.UserRepresentation) error
	GetUsers(ctx context.Context, realmName string, groupIDs []string, paramKV ...string) (api.UsersPageRepresentation, error)
	CreateUser(ctx context.Context, realmName string, user api.UserRepresentation) (string, error)
	GetUserAccountStatus(ctx context.Context, realmName, userID string) (map[string]bool, error)
	GetRolesOfUser(ctx context.Context, realmName, userID string) ([]api.RoleRepresentation, error)
	GetGroupsOfUser(ctx context.Context, realmName, userID string) ([]api.GroupRepresentation, error)
	SetTrustIDGroups(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
	SendNewEnrolmentCode(ctx context.Context, realmName string, userID string) (string, 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)
	GetCredentialsForUser(ctx context.Context, realmName string, userID string) ([]api.CredentialRepresentation, error)
	DeleteCredentialsForUser(ctx context.Context, realmName string, userID string, credentialID string) error
	ClearUserLoginFailures(ctx context.Context, realmName, userID string) 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)

	CreateShadowUser(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, eventDBModule database.EventsDBModule,
	configDBModule keycloakb.ConfigurationDBModule, authorizedTrustIDGroups []string, 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
	GetUsers             endpoint.Endpoint
	CreateUser           endpoint.Endpoint
	GetRolesOfUser       endpoint.Endpoint
	GetGroupsOfUser      endpoint.Endpoint
	SetTrustIDGroups     endpoint.Endpoint
	GetUserAccountStatus endpoint.Endpoint
	GetClientRoleForUser endpoint.Endpoint
	AddClientRoleToUser  endpoint.Endpoint

	ResetPassword            endpoint.Endpoint
	ExecuteActionsEmail      endpoint.Endpoint
	SendNewEnrolmentCode     endpoint.Endpoint
	SendReminderEmail        endpoint.Endpoint
	ResetSmsCounter          endpoint.Endpoint
	CreateRecoveryCode       endpoint.Endpoint
	GetCredentialsForUser    endpoint.Endpoint
	DeleteCredentialsForUser endpoint.Endpoint
	ClearUserLoginFailures   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

	CreateShadowUser endpoint.Endpoint
}

Endpoints wraps a service behind a set of endpoints.

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)
	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)
	ResetPassword(accessToken string, realmName string, userID string, cred kc.CredentialRepresentation) error
	ExecuteActionsEmail(accessToken string, realmName string, userID string, actions []string, paramKV ...string) error
	SendNewEnrolmentCode(accessToken string, realmName string, userID string) (kc.SmsCodeRepresentation, error)
	CreateRecoveryCode(accessToken string, realmName string, userID string) (kc.RecoveryCodeRepresentation, 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
	CreateShadowUser(accessToken string, realmName string, userID string, provider string, fedID kc.FederatedIdentityRepresentation) error
	ClearUserLoginFailures(accessToken string, realmName, userID string) error
}

KeycloakClient are methods from keycloak-client used by this component

type LocationHeader

type LocationHeader struct {
	URL string
}

LocationHeader type

type ManagementComponent

type ManagementComponent 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.UserRepresentation) error
	GetUsers(ctx context.Context, realmName string, groupIDs []string, paramKV ...string) (api.UsersPageRepresentation, error)
	CreateUser(ctx context.Context, realmName string, user api.UserRepresentation) (string, error)
	GetUserAccountStatus(ctx context.Context, realmName, userID string) (map[string]bool, error)
	GetRolesOfUser(ctx context.Context, realmName, userID string) ([]api.RoleRepresentation, error)
	GetGroupsOfUser(ctx context.Context, realmName, userID string) ([]api.GroupRepresentation, error)
	SetTrustIDGroups(ctx context.Context, realmName, userID string, groups []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
	SendNewEnrolmentCode(ctx context.Context, realmName string, userID string) (string, 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)
	GetCredentialsForUser(ctx context.Context, realmName string, userID string) ([]api.CredentialRepresentation, error)
	DeleteCredentialsForUser(ctx context.Context, realmName string, userID string, credentialID string) error
	ClearUserLoginFailures(ctx context.Context, realmName, userID string) 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, realmID string) (api.RealmCustomConfiguration, error)
	UpdateRealmCustomConfiguration(ctx context.Context, realmID string, customConfig api.RealmCustomConfiguration) error
	GetRealmAdminConfiguration(ctx context.Context, realmID string) (api.RealmAdminConfiguration, error)
	UpdateRealmAdminConfiguration(ctx context.Context, realmID string, adminConfig api.RealmAdminConfiguration) error
	GetRealmBackOfficeConfiguration(ctx context.Context, realmName string, groupID string) (api.BackOfficeConfiguration, error)
	UpdateRealmBackOfficeConfiguration(ctx context.Context, realmName string, groupID string, boConf api.BackOfficeConfiguration) error
	GetUserRealmBackOfficeConfiguration(ctx context.Context, realmName string) (api.BackOfficeConfiguration, error)

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

ManagementComponent is the interface of the component to send a query to Keycloak.

Jump to

Keyboard shortcuts

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