Documentation ¶
Index ¶
- Constants
- Variables
- func MakeAuthorizationRegisterComponentMW(realmName string, logger log.Logger, ...) func(Component) Component
- func MakeGetActionsEndpoint(component Component) cs.Endpoint
- func MakeGetUserEndpoint(component Component) cs.Endpoint
- func MakeKYCHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- func MakeValidateUserEndpoint(component Component) cs.Endpoint
- type Component
- type ConfigurationDBModule
- type Endpoints
- type KeycloakClient
Constants ¶
View Source
const ( RegExpUserName = apimgmt.RegExpUsername RegExpUserID = apimgmt.RegExpID )
Regular expressions
View Source
const (
// RegistrationOfficer is the name of the Keycloak group required for KYC API methods
RegistrationOfficer = "registration_officer"
)
Variables ¶
View Source
var ( KYCGetActions = newAction("KYC_GetActions", security.ScopeGlobal) KYCGetUser = newAction("KYC_GetUser", security.ScopeGroup) KYCValidateUser = newAction("KYC_ValidateUser", security.ScopeGroup) )
Creates constants for API method names
Functions ¶
func MakeAuthorizationRegisterComponentMW ¶
func MakeAuthorizationRegisterComponentMW(realmName string, logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component
MakeAuthorizationRegisterComponentMW checks authorization and return an error if the action is not allowed.
func MakeGetActionsEndpoint ¶
MakeGetActionsEndpoint creates an endpoint for GetActions
func MakeGetUserEndpoint ¶
MakeGetUserEndpoint endpoint creation
func MakeKYCHandler ¶
MakeKYCHandler make an HTTP handler for the KYC endpoint.
func MakeValidateUserEndpoint ¶
MakeValidateUserEndpoint endpoint creation
Types ¶
type Component ¶
type Component interface { GetActions(ctx context.Context) ([]apikyc.ActionRepresentation, error) GetUser(ctx context.Context, username string) (apikyc.UserRepresentation, error) ValidateUser(ctx context.Context, userID string, user apikyc.UserRepresentation) error }
Component is the register component interface.
func NewComponent ¶
func NewComponent(socialRealmName string, keycloakClient KeycloakClient, usersDBModule keycloakb.UsersDBModule, configDBModule ConfigurationDBModule, eventsDBModule database.EventsDBModule, logger internal.Logger) Component
NewComponent returns the management component.
type ConfigurationDBModule ¶
type ConfigurationDBModule interface {
GetConfiguration(context.Context, string) (dto.RealmConfiguration, error)
}
ConfigurationDBModule is the interface of the configuration module.
type Endpoints ¶
type Endpoints struct { GetActions endpoint.Endpoint GetUser endpoint.Endpoint ValidateUser endpoint.Endpoint }
Endpoints for self service
type KeycloakClient ¶
type KeycloakClient interface { UpdateUser(accessToken string, realmName, userID string, user kc.UserRepresentation) error GetUser(accessToken string, realmName, userID string) (kc.UserRepresentation, error) GetUsers(accessToken string, reqRealmName, targetRealmName string, paramKV ...string) (kc.UsersPageRepresentation, error) }
KeycloakClient are methods from keycloak-client used by this component
Click to show internal directories.
Click to hide internal directories.