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 MakeGetUserByUsernameEndpoint(component Component) cs.Endpoint
- func MakeGetUserByUsernameInSocialRealmEndpoint(component Component) cs.Endpoint
- func MakeGetUserEndpoint(component Component) cs.Endpoint
- func MakeGetUserInSocialRealmEndpoint(component Component) cs.Endpoint
- func MakeKYCHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- func MakeSendSmsCodeEndpoint(component Component) cs.Endpoint
- func MakeSendSmsCodeInSocialRealmEndpoint(component Component) cs.Endpoint
- func MakeSendSmsConsentCodeEndpoint(component Component) cs.Endpoint
- func MakeSendSmsConsentCodeInSocialRealmEndpoint(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 GlnVerifier
- type KeycloakClient
- type UsersDetailsDBModule
Constants ¶
const ( RegExpUserName = constants.RegExpSearch RegExpUserID = constants.RegExpID RegExpRealmName = constants.RegExpRealmName )
Regular expressions and parameters
Variables ¶
var ( KYCGetActions = newAction("KYC_GetActions", security.ScopeGlobal) KYCGetUserInSocialRealm = newAction("KYC_GetUserInSocialRealm", security.ScopeRealm) KYCGetUser = newAction("KYC_GetUser", security.ScopeGroup) KYCGetUserByUsernameInSocialRealm = newAction("KYC_GetUserByUsernameInSocialRealm", security.ScopeRealm) KYCGetUserByUsername = newAction("KYC_GetUserByUsername", security.ScopeGroup) KYCValidateUserInSocialRealm = newAction("KYC_ValidateUserInSocialRealm", security.ScopeRealm) KYCValidateUser = newAction("KYC_ValidateUser", security.ScopeGroup) KYCSendSmsConsentCodeInSocialRealm = newAction("KYC_SendSmsConsentCodeInSocialRealm", security.ScopeRealm) KYCSendSmsConsentCode = newAction("KYC_SendSmsConsentCode", security.ScopeGroup) KYCSendSmsCodeInSocialRealm = newAction("KYC_SendSmsCodeInSocialRealm", security.ScopeRealm) KYCSendSmsCode = newAction("KYC_SendSmsCode", security.ScopeGroup) )
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 MakeGetUserByUsernameEndpoint ¶
MakeGetUserByUsernameEndpoint endpoint creation
func MakeGetUserByUsernameInSocialRealmEndpoint ¶
MakeGetUserByUsernameInSocialRealmEndpoint endpoint creation
func MakeGetUserEndpoint ¶
MakeGetUserEndpoint endpoint creation
func MakeGetUserInSocialRealmEndpoint ¶
MakeGetUserInSocialRealmEndpoint endpoint creation
func MakeKYCHandler ¶
MakeKYCHandler make an HTTP handler for the KYC endpoint.
func MakeSendSmsCodeEndpoint ¶
MakeSendSmsCodeEndpoint creates an endpoint for SendSmsCode
func MakeSendSmsCodeInSocialRealmEndpoint ¶
MakeSendSmsCodeInSocialRealmEndpoint creates an endpoint for SendSmsCodeInSocialRealm
func MakeSendSmsConsentCodeEndpoint ¶
MakeSendSmsConsentCodeEndpoint creates an endpoint for SendSmsConsentCode
func MakeSendSmsConsentCodeInSocialRealmEndpoint ¶
MakeSendSmsConsentCodeInSocialRealmEndpoint creates an endpoint for SendSmsConsentCodeInSocialRealm
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, consentCode *string) (apikyc.UserRepresentation, error) GetUserByUsernameInSocialRealm(ctx context.Context, username string) (apikyc.UserRepresentation, error) GetUser(ctx context.Context, realmName string, userID string, consentCode *string) (apikyc.UserRepresentation, error) GetUserByUsername(ctx context.Context, realmName string, username string) (apikyc.UserRepresentation, error) ValidateUserInSocialRealm(ctx context.Context, userID string, user apikyc.UserRepresentation, consentCode *string) error ValidateUser(ctx context.Context, realm string, userID string, user apikyc.UserRepresentation, consentCode *string) error SendSmsConsentCodeInSocialRealm(ctx context.Context, userID string) error SendSmsConsentCode(ctx context.Context, realmName string, userID string) error SendSmsCodeInSocialRealm(ctx context.Context, userID string) (string, error) SendSmsCode(ctx context.Context, realmName string, 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, glnVerifier GlnVerifier, logger keycloakb.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 GetUser endpoint.Endpoint GetUserByUsername endpoint.Endpoint ValidateUserInSocialRealm endpoint.Endpoint ValidateUser endpoint.Endpoint SendSMSConsentCodeInSocialRealm endpoint.Endpoint SendSMSConsentCode endpoint.Endpoint SendSMSCodeInSocialRealm endpoint.Endpoint SendSMSCode 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 GlnVerifier ¶
GlnVerifier interface allows to check validity of a GLN
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) GetGroupsOfUser(accessToken string, realmName, userID string) ([]kc.GroupRepresentation, error) SendSmsCode(accessToken string, realmName string, userID string) (kc.SmsCodeRepresentation, error) SendConsentCodeSMS(accessToken string, realmName string, userID string) error CheckConsentCodeSMS(accessToken string, realmName string, userID string, consentCode string) 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