mobilepkg

package
v3.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: GPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GetUserInformation = "GetUserInformation"
)

Creates constants for API method names

Variables

This section is empty.

Functions

func MakeAuthorizationMobileComponentMW

func MakeAuthorizationMobileComponentMW(logger log.Logger, configDBModule keycloakb.ConfigurationDBModule) func(Component) Component

MakeAuthorizationMobileComponentMW checks authorization and return an error if the action is not allowed.

func MakeGetUserInformationEndpoint

func MakeGetUserInformationEndpoint(component Component) cs.Endpoint

MakeGetUserInformationEndpoint makes the GetUserInformation endpoint

func MakeMobileHandler

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

MakeMobileHandler make an HTTP handler for a Mobile endpoint.

Types

type Component

type Component interface {
	GetUserInformation(ctx context.Context) (api.UserInformationRepresentation, error)
}

Component interface exposes methods used by the bridge API

func NewComponent

func NewComponent(keycloakClient KeycloakClient, configDBModule keycloakb.ConfigurationDBModule, usersDBModule UsersDetailsDBModule, tokenProvider TokenProvider, logger keycloakb.Logger) Component

NewComponent returns the self-service component.

type Endpoints

type Endpoints struct {
	GetUserInformation endpoint.Endpoint
}

Endpoints wraps a service behind a set of endpoints.

type KeycloakClient

type KeycloakClient interface {
	GetUser(accessToken string, realmName, userID string) (kc.UserRepresentation, error)
}

KeycloakClient interface exposes methods we need to call to send requests to Keycloak API

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 {
	GetChecks(ctx context.Context, realm string, userID string) ([]dto.DBCheck, error)
}

UsersDetailsDBModule is the minimum required interface to access the users database

Jump to

Keyboard shortcuts

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