Documentation ¶
Index ¶
- Constants
- Variables
- func GetActions() []security.Action
- func MakeAuthorizationManagementComponentMW(logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component
- func MakeGetActionsEndpoint(ec Component) cs.Endpoint
- func MakeGetMigrationReportEndpoint(ec Component) cs.Endpoint
- func MakeGetStatisticsAuthenticationsEndpoint(ec Component) cs.Endpoint
- func MakeGetStatisticsAuthenticationsLogEndpoint(ec Component) cs.Endpoint
- func MakeGetStatisticsAuthenticatorsEndpoint(ec Component) cs.Endpoint
- func MakeGetStatisticsEndpoint(ec Component) cs.Endpoint
- func MakeGetStatisticsUsersEndpoint(ec Component) cs.Endpoint
- func MakeStatisticsHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- type Component
- type Endpoints
- type KeycloakClient
Constants ¶
const ( PrmRealm = "realm" PrmQryUnit = "unit" PrmQryMax = "max" PrmQryTimeshift = "timeshift" )
Parameter names
Variables ¶
var ( STGetActions = newAction("ST_GetActions", security.ScopeGlobal) STGetStatistics = newAction("ST_GetStatistics", security.ScopeRealm) STGetStatisticsUsers = newAction("ST_GetStatisticsUsers", security.ScopeRealm) STGetStatisticsAuthenticators = newAction("ST_GetStatisticsAuthenticators", security.ScopeRealm) STGetStatisticsAuthentications = newAction("ST_GetStatisticsAuthentications", security.ScopeRealm) STGetStatisticsAuthenticationsLog = newAction("ST_GetStatisticsAuthenticationsLog", security.ScopeRealm) STGetMigrationReport = newAction("ST_GetMigrationReport", security.ScopeRealm) )
Actions used for authorization module
Functions ¶
func MakeAuthorizationManagementComponentMW ¶
func MakeAuthorizationManagementComponentMW(logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component
MakeAuthorizationManagementComponentMW checks authorization and return an error if the action is not allowed.
func MakeGetActionsEndpoint ¶
MakeGetActionsEndpoint creates an endpoint for GetActions
func MakeGetMigrationReportEndpoint ¶
MakeGetMigrationReportEndpoint makes the migration reporting endpoint.
func MakeGetStatisticsAuthenticationsEndpoint ¶
MakeGetStatisticsAuthenticationsEndpoint makes the statistic authentications per period summary endpoint.
func MakeGetStatisticsAuthenticationsLogEndpoint ¶
MakeGetStatisticsAuthenticationsLogEndpoint makes the statistic last authentications summary endpoint.
func MakeGetStatisticsAuthenticatorsEndpoint ¶
MakeGetStatisticsAuthenticatorsEndpoint makes the statistic authenticators summary endpoint.
func MakeGetStatisticsEndpoint ¶
MakeGetStatisticsEndpoint makes the statistic summary endpoint.
func MakeGetStatisticsUsersEndpoint ¶
MakeGetStatisticsUsersEndpoint makes the statistic users summary endpoint.
func MakeStatisticsHandler ¶
MakeStatisticsHandler make an HTTP handler for a Statistics endpoint.
Types ¶
type Component ¶
type Component interface { GetActions(context.Context) ([]api.ActionRepresentation, error) GetStatistics(context.Context, string) (api.StatisticsRepresentation, error) GetStatisticsUsers(context.Context, string) (api.StatisticsUsersRepresentation, error) GetStatisticsAuthenticators(context.Context, string) (map[string]int64, error) GetStatisticsAuthentications(context.Context, string, string, *string) ([][]int64, error) GetStatisticsAuthenticationsLog(context.Context, string, string) ([]api.StatisticsConnectionRepresentation, error) GetMigrationReport(context.Context, string) (map[string]bool, error) }
Component is the interface of the events component.
func NewComponent ¶
func NewComponent(db keycloakb.EventsDBModule, keycloakClient KeycloakClient, logger log.Logger) Component
NewComponent returns a component
type Endpoints ¶
type Endpoints struct { GetActions endpoint.Endpoint GetStatistics endpoint.Endpoint GetStatisticsUsers endpoint.Endpoint GetStatisticsAuthenticators endpoint.Endpoint GetStatisticsAuthentications endpoint.Endpoint GetStatisticsAuthenticationsLog endpoint.Endpoint GetMigrationReport endpoint.Endpoint }
Endpoints exposed for path /events
type KeycloakClient ¶
type KeycloakClient interface { GetUsers(accessToken string, reqRealmName, targetRealmName string, paramKV ...string) (kc.UsersPageRepresentation, error) GetStatisticsUsers(accessToken string, realmName string) (kc.StatisticsUsersRepresentation, error) GetStatisticsAuthenticators(accessToken string, realmName string) (map[string]int64, error) }
KeycloakClient interface