Documentation ¶
Index ¶
- Variables
- func MakeAddClientRolesToUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeAuthorizationManagementComponentMW(logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component
- func MakeCreateClientRoleEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeCreateGroupEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeCreateRecoveryCodeEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeCreateShadowUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeCreateUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeDeleteCredentialsForUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeDeleteGroupEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeDeleteUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeExecuteActionsEmailEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetActionsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetAuthorizationsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetClientEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetClientRolesEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetClientRolesForUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetClientsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetCredentialsForUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetGroupsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetGroupsOfUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRealmCustomConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRealmEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRealmsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRequiredActionsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRoleEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRolesEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetRolesOfUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetUserAccountStatusEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeGetUsersEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeManagementHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- func MakeResetPasswordEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeResetSmsCounterEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeSendNewEnrolmentCodeEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeSendReminderEmailEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeSetTrustIDGroupsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeUpdateAuthorizationsEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeUpdateRealmCustomConfigurationEndpoint(managementComponent ManagementComponent) cs.Endpoint
- func MakeUpdateUserEndpoint(managementComponent ManagementComponent) cs.Endpoint
- type Component
- type ConfigurationDBModule
- type ConvertLocationError
- type Endpoints
- type KeycloakClient
- type LocationHeader
- type ManagementComponent
Constants ¶
This section is empty.
Variables ¶
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) 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) 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 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 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 MakeGetUsersEndpoint ¶
func MakeGetUsersEndpoint(managementComponent ManagementComponent) cs.Endpoint
MakeGetUsersEndpoint creates an endpoint for GetUsers
func MakeManagementHandler ¶
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 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
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 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 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 ConfigurationDBModule, authorizedTrustIDGroups []string, logger keycloakb.Logger) Component
NewComponent returns the management component.
type ConfigurationDBModule ¶
type ConfigurationDBModule interface { NewTransaction(context context.Context) (database.Transaction, error) StoreOrUpdate(context.Context, string, dto.RealmConfiguration) error GetConfiguration(context.Context, string) (dto.RealmConfiguration, error) GetAuthorizations(context context.Context, realmID string, groupID string) ([]dto.Authorization, error) CreateAuthorization(context context.Context, authz dto.Authorization) error DeleteAuthorizations(context context.Context, realmID string, groupID string) error DeleteAllAuthorizationsWithGroup(context context.Context, realmID, groupName string) error }
ConfigurationDBModule is the interface of the configuration module.
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 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 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 }
KeycloakClient are methods from keycloak-client used by this component
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 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 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.