kyc

package
v3.22.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: GPL-3.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RegExpUserName  = constants.RegExpSearch
	RegExpUserID    = constants.RegExpID
	RegExpRealmName = constants.RegExpRealmName
)

Regular expressions and parameters

Variables

View Source
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 GetActions

func GetActions() []security.Action

GetActions returns available actions

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

func MakeGetActionsEndpoint(component Component) cs.Endpoint

MakeGetActionsEndpoint creates an endpoint for GetActions

func MakeGetUserByUsernameEndpoint

func MakeGetUserByUsernameEndpoint(component Component) cs.Endpoint

MakeGetUserByUsernameEndpoint endpoint creation

func MakeGetUserByUsernameInSocialRealmEndpoint

func MakeGetUserByUsernameInSocialRealmEndpoint(component Component) cs.Endpoint

MakeGetUserByUsernameInSocialRealmEndpoint endpoint creation

func MakeGetUserEndpoint

func MakeGetUserEndpoint(component Component) cs.Endpoint

MakeGetUserEndpoint endpoint creation

func MakeGetUserInSocialRealmEndpoint

func MakeGetUserInSocialRealmEndpoint(component Component) cs.Endpoint

MakeGetUserInSocialRealmEndpoint endpoint creation

func MakeKYCHandler

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

MakeKYCHandler make an HTTP handler for the KYC endpoint.

func MakeSendSmsCodeEndpoint

func MakeSendSmsCodeEndpoint(component Component) cs.Endpoint

MakeSendSmsCodeEndpoint creates an endpoint for SendSmsCode

func MakeSendSmsCodeInSocialRealmEndpoint

func MakeSendSmsCodeInSocialRealmEndpoint(component Component) cs.Endpoint

MakeSendSmsCodeInSocialRealmEndpoint creates an endpoint for SendSmsCodeInSocialRealm

func MakeSendSmsConsentCodeEndpoint

func MakeSendSmsConsentCodeEndpoint(component Component) cs.Endpoint

MakeSendSmsConsentCodeEndpoint creates an endpoint for SendSmsConsentCode

func MakeSendSmsConsentCodeInSocialRealmEndpoint

func MakeSendSmsConsentCodeInSocialRealmEndpoint(component Component) cs.Endpoint

MakeSendSmsConsentCodeInSocialRealmEndpoint creates an endpoint for SendSmsConsentCodeInSocialRealm

func MakeValidateUserEndpoint

func MakeValidateUserEndpoint(component Component) cs.Endpoint

MakeValidateUserEndpoint endpoint creation

func MakeValidateUserInSocialRealmEndpoint

func MakeValidateUserInSocialRealmEndpoint(component Component) cs.Endpoint

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

type GlnVerifier interface {
	ValidateGLN(firstName, lastName, gln string) error
}

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

Jump to

Keyboard shortcuts

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