kyc

package
v2.8.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: GPL-3.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RegExpUserName  = constants.RegExpUsername
	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)
	KYCGetUserByUsernameInSocialRealm = newAction("KYC_GetUserByUsernameInSocialRealm", security.ScopeRealm)
	KYCValidateUserInSocialRealm      = newAction("KYC_ValidateUserInSocialRealm", security.ScopeRealm)
	KYCValidateUser                   = newAction("KYC_ValidateUser", 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 MakeGetUserByUsernameInSocialRealmEndpoint

func MakeGetUserByUsernameInSocialRealmEndpoint(component Component) cs.Endpoint

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

func MakeValidateUserEndpoint(component Component) cs.Endpoint

MakeValidateUserEndpoint endpoint creation

func MakeValidateUserInSocialRealmEndpoint

func MakeValidateUserInSocialRealmEndpoint(component Component) cs.Endpoint

MakeValidateUserInSocialRealmEndpoint endpoint creation

Types

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
}

Component is the register component interface.

func NewComponent

func NewComponent(tokenProvider toolbox.OidcTokenProvider, socialRealmName string, keycloakClient KeycloakClient, usersDBModule UsersDetailsDBModule, eventsDBModule EventsDBModule, accredsModule keycloakb.AccreditationsModule, logger internal.Logger) Component

NewComponent returns the management component.

type Endpoints

type Endpoints struct {
	GetActions                     endpoint.Endpoint
	GetUserInSocialRealm           endpoint.Endpoint
	GetUserByUsernameInSocialRealm endpoint.Endpoint
	ValidateUserInSocialRealm      endpoint.Endpoint
	ValidateUser                   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)
}

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
}

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