kyc

package
v2.3.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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

func MakeGetActionsEndpoint(component Component) cs.Endpoint

MakeGetActionsEndpoint creates an endpoint for GetActions

func MakeGetUserEndpoint

func MakeGetUserEndpoint(component Component) cs.Endpoint

MakeGetUserEndpoint 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 MakeValidateUserEndpoint

func MakeValidateUserEndpoint(component Component) cs.Endpoint

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

Jump to

Keyboard shortcuts

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