Documentation ¶
Index ¶
- Constants
- Variables
- func GetActions() []security.Action
- func MakeAuthorizationRegisterComponentMW(realmName string, authorizationManager security.AuthorizationManager, ...) func(Component) Component
- func MakeGetActionsEndpoint(component Component) cs.Endpoint
- func MakeGetUserByUsernameInSocialRealmEndpoint(component Component) cs.Endpoint
- func MakeGetUserInSocialRealmEndpoint(component Component) cs.Endpoint
- func MakeKYCHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- func MakeSendSmsCodeInSocialRealmEndpoint(component Component) cs.Endpoint
- func MakeValidateUserEndpoint(component Component) cs.Endpoint
- func MakeValidateUserInSocialRealmEndpoint(component Component) cs.Endpoint
- type ArchiveDBModule
- type Component
- type ConfigDBModule
- type Endpoints
- type EventsDBModule
- type KeycloakClient
- type UsersDetailsDBModule
Constants ¶
const ( RegExpUserName = constants.RegExpUsername RegExpUserID = constants.RegExpID RegExpRealmName = constants.RegExpRealmName )
Regular expressions and parameters
Variables ¶
var ( KYCGetActions = newAction("KYC_GetActions", security.ScopeGlobal) KYCGetUserInSocialRealm = newAction("KYC_GetUserInSocialRealm", security.ScopeRealm) KYCGetUserByUsernameInSocialRealm = newAction("KYC_GetUserByUsernameInSocialRealm", security.ScopeRealm) KYCValidateUserInSocialRealm = newAction("KYC_ValidateUserInSocialRealm", security.ScopeRealm) KYCValidateUser = newAction("KYC_ValidateUser", security.ScopeGroup) KYCSendSmsCodeInSocialRealm = newAction("KYC_SendSmsCodeInSocialRealm", security.ScopeRealm) )
Creates constants for API method names
Functions ¶
func MakeAuthorizationRegisterComponentMW ¶
func MakeAuthorizationRegisterComponentMW(realmName string, authorizationManager security.AuthorizationManager, availabilityChecker middleware.EndpointAvailabilityChecker, logger log.Logger) 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 MakeGetUserByUsernameInSocialRealmEndpoint ¶
MakeGetUserByUsernameInSocialRealmEndpoint endpoint creation
func MakeGetUserInSocialRealmEndpoint ¶
MakeGetUserInSocialRealmEndpoint endpoint creation
func MakeKYCHandler ¶
MakeKYCHandler make an HTTP handler for the KYC endpoint.
func MakeSendSmsCodeInSocialRealmEndpoint ¶
MakeSendSmsCodeInSocialRealmEndpoint creates an endpoint for SendSmsCodeInSocialRealm
func MakeValidateUserEndpoint ¶
MakeValidateUserEndpoint endpoint creation
func MakeValidateUserInSocialRealmEndpoint ¶
MakeValidateUserInSocialRealmEndpoint endpoint creation
Types ¶
type ArchiveDBModule ¶
type ArchiveDBModule interface {
StoreUserDetails(ctx context.Context, realm string, user dto.ArchiveUserRepresentation) error
}
ArchiveDBModule is the interface from the archive module
type Component ¶
type Component interface { GetActions(ctx context.Context) ([]apikyc.ActionRepresentation, error) GetUserInSocialRealm(ctx context.Context, userID string) (apikyc.UserRepresentation, error) GetUserByUsernameInSocialRealm(ctx context.Context, username string) (apikyc.UserRepresentation, error) ValidateUserInSocialRealm(ctx context.Context, userID string, user apikyc.UserRepresentation) error ValidateUser(ctx context.Context, realm string, userID string, user apikyc.UserRepresentation) error SendSmsCodeInSocialRealm(ctx context.Context, userID string) (string, error) }
Component is the register component interface.
func NewComponent ¶
func NewComponent(tokenProvider toolbox.OidcTokenProvider, socialRealmName string, keycloakClient KeycloakClient, usersDBModule UsersDetailsDBModule, archiveDBModule ArchiveDBModule, configDBModule ConfigDBModule, eventsDBModule EventsDBModule, accredsModule keycloakb.AccreditationsModule, logger internal.Logger) Component
NewComponent returns the management component.
type ConfigDBModule ¶
type ConfigDBModule interface {
GetAdminConfiguration(ctx context.Context, realmID string) (configuration.RealmAdminConfiguration, error)
}
ConfigDBModule is the interface from the configuration DB module
type Endpoints ¶
type Endpoints struct { GetActions endpoint.Endpoint GetUserInSocialRealm endpoint.Endpoint GetUserByUsernameInSocialRealm endpoint.Endpoint ValidateUserInSocialRealm endpoint.Endpoint ValidateUser endpoint.Endpoint SendSMSCodeInSocialRealm endpoint.Endpoint }
Endpoints for self service
type EventsDBModule ¶
type EventsDBModule interface { Store(context.Context, map[string]string) error ReportEvent(ctx context.Context, apiCall string, origin string, values ...string) error }
EventsDBModule is the interface of the audit events module
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) GetGroups(accessToken string, realmName string) ([]kc.GroupRepresentation, error) SendSmsCode(accessToken string, realmName string, userID string) (kc.SmsCodeRepresentation, error) }
KeycloakClient are methods from keycloak-client used by this component
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) CreateCheck(ctx context.Context, realm string, userID string, check dto.DBCheck) error GetChecks(ctx context.Context, realm string, userID string) ([]dto.DBCheck, error) }
UsersDetailsDBModule is the interface from the users module