validation

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: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCreateCheckEndpoint

func MakeCreateCheckEndpoint(component Component) cs.Endpoint

MakeCreateCheckEndpoint endpoint creation

func MakeCreatePendingCheckEndpoint

func MakeCreatePendingCheckEndpoint(component Component) cs.Endpoint

MakeCreatePendingCheckEndpoint endpoint creation

func MakeDeletePendingCheckEndpoint

func MakeDeletePendingCheckEndpoint(component Component) cs.Endpoint

MakeDeletePendingCheckEndpoint endpoint creation

func MakeGetUserEndpoint

func MakeGetUserEndpoint(component Component) cs.Endpoint

MakeGetUserEndpoint endpoint creation

func MakeUpdateUserEndpoint

func MakeUpdateUserEndpoint(component Component) cs.Endpoint

MakeUpdateUserEndpoint endpoint creation

func MakeValidationHandler

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

MakeValidationHandler make an HTTP handler for a Validation endpoint.

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 {
	GetUser(ctx context.Context, realmName string, userID string) (api.UserRepresentation, error)
	UpdateUser(ctx context.Context, realmName string, userID string, user api.UserRepresentation) error
	CreateCheck(ctx context.Context, realmName string, userID string, check api.CheckRepresentation) error
	CreatePendingCheck(ctx context.Context, realmName string, userID string, pendingChecks api.PendingChecksRepresentation) error
	DeletePendingCheck(ctx context.Context, realmName string, userID string, pendingCheck string) error
}

Component is the register component interface.

func NewComponent

func NewComponent(keycloakClient KeycloakClient, tokenProvider TokenProvider, usersDBModule UsersDetailsDBModule, archiveDBModule ArchiveDBModule, eventsDBModule database.EventsDBModule, accredsModule keycloakb.AccreditationsModule, configDBModule ConfigurationDBModule, logger keycloakb.Logger) Component

NewComponent returns the management component.

type ConfigurationDBModule

type ConfigurationDBModule interface {
	GetAdminConfiguration(context.Context, string) (configuration.RealmAdminConfiguration, error)
}

ConfigurationDBModule is the interface of the configuration module.

type Endpoints

type Endpoints struct {
	GetUser            endpoint.Endpoint
	UpdateUser         endpoint.Endpoint
	CreateCheck        endpoint.Endpoint
	CreatePendingCheck endpoint.Endpoint
	DeletePendingCheck 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)
	GetRealm(accessToken string, realmName string) (kc.RealmRepresentation, error)
}

KeycloakClient are methods from keycloak-client used by this component

type TokenProvider

type TokenProvider interface {
	ProvideToken(ctx context.Context) (string, error)
}

TokenProvider is the interface to retrieve accessToken to access KC

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