Documentation ¶
Index ¶
- Constants
- func MakeCreateCheckEndpoint(component Component) cs.Endpoint
- func MakeGetUserEndpoint(component Component) cs.Endpoint
- func MakeUpdateUserEndpoint(component Component) cs.Endpoint
- func MakeValidationHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- type Component
- type Endpoints
- type EventsDBModule
- type KeycloakClient
- type TokenProvider
- type UsersDetailsDBModule
Constants ¶
View Source
const ( ReqBody = "body" PrmRealm = "realm" PrmUserID = "userID" )
Parameter names
Variables ¶
This section is empty.
Functions ¶
func MakeCreateCheckEndpoint ¶
MakeCreateCheckEndpoint endpoint creation
func MakeGetUserEndpoint ¶
MakeGetUserEndpoint endpoint creation
func MakeUpdateUserEndpoint ¶
MakeUpdateUserEndpoint endpoint creation
func MakeValidationHandler ¶
MakeValidationHandler make an HTTP handler for a Validation endpoint.
Types ¶
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 }
Component is the register component interface.
func NewComponent ¶
func NewComponent(keycloakClient KeycloakClient, tokenProvider TokenProvider, usersDBModule UsersDetailsDBModule, eventsDBModule database.EventsDBModule, accredsModule keycloakb.AccreditationsModule, logger internal.Logger) Component
NewComponent returns the management component.
type Endpoints ¶
type Endpoints struct { GetUser endpoint.Endpoint UpdateUser endpoint.Endpoint CreateCheck 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 ¶
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
Click to show internal directories.
Click to hide internal directories.