keycloakb

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgErrInvalidParam         = "invalidParameter"
	MsgErrMissingParam         = "missingParameter"
	MsgErrWrongTypeRequest     = "wrongTypeRequest"
	MsgErrInvalidJSONRequest   = "invalidJSONRequest"
	MsgErrInvalidBase64Object  = "invalidBase64Object"
	MsgErrInvalidLength        = "invalidLength"
	MsgErrCannotObtain         = "cannotObtain"
	MsgErrCannotMarshal        = "cannotMarshal"
	MsgErrCannotSaveConfigInDB = "cannotSaveConfigInDB"
	MsgErrCannotUpdate         = "cannotUpdate"
	MsgErrUnknown              = "unknowError"

	CurrentPassword    = "currentPassword"
	NewPassword        = "newPassword"
	ConfirmPassword    = "confirmPassword"
	Password           = "password"
	Type               = "type"
	Id                 = "id"
	Label              = "label"
	UserId             = "userID"
	Username           = "username"
	User               = "user"
	Email              = "email"
	Firstname          = "firstname"
	Lastname           = "lastname"
	PhoneNumber        = "phoneNumber"
	Gender             = "gender"
	Birthdate          = "birthdate"
	GroudId            = "groupId"
	GroudIds           = "groupIds"
	RoleId             = "roleId"
	Locale             = "locale"
	Description        = "description"
	ContainerId        = "containerId"
	DefaultClientID    = "defaultClientID"
	DefaultRedirectURI = "defaultRedirectURI"
	RequiredAction     = "requiredAction"
	DurationLabel      = "durationLabel"
	Body               = "body"
	Flatbuffer         = "flatbuffer"
	Realm              = "realm"
	KeycloakRealms     = "keycloakRealms"
	Config             = "config"
	Response           = "response"
	ListOfRealms       = "listOfRealms"
	Groups             = "groups"
	ClientId           = "clientId"
	RedirectURI        = "redirectURI"
)

Variables

View Source
var (
	// ComponentName is the name of the component.
	ComponentName = "keycloak-bridge"
	// Version of the component.
	Version = "1.1"
)

Functions

func GenerateInitialCode

func GenerateInitialCode(nbUpperCase int, nbDigits int, nbLowerCase int) string

GenerateInitialCode generates a code of the format UpperCase + digits + LowerCase

func GeneratePassword

func GeneratePassword(policy *string, minLength int, userID string) (string, error)

GeneratePassword generates a password accoring to the policy or minimum length imposed

func GeneratePasswordFromKeycloakPolicy

func GeneratePasswordFromKeycloakPolicy(policy string) (string, error)

GeneratePasswordFromKeycloakPolicy generates a random password respecting the keycloak password policy

func GeneratePasswordNoKeycloakPolicy

func GeneratePasswordNoKeycloakPolicy(minLength int) string

GeneratePassword generates a password of a given length

func LimitRate

func LimitRate(e cs.Endpoint, limit int) endpoint.Endpoint

LimitRate adds a rate limit to an endpoint

func NewKeycloakAuthClient

func NewKeycloakAuthClient(client KeycloakClient, logger Logger) security.KeycloakClient

NewKeycloakAuthClient creates an adaptor for Authorization management to access Keycloak

func ToGoKitEndpoint

func ToGoKitEndpoint(e cs.Endpoint) endpoint.Endpoint

ToGoKitEndpoint converts endpoints

Types

type EventsDBModule

type EventsDBModule interface {
	GetEventsCount(context.Context, map[string]string) (int, error)
	GetEvents(context.Context, map[string]string) ([]api.AuditRepresentation, error)
	GetEventsSummary(context.Context) (api.EventSummaryRepresentation, error)
	GetLastConnection(context.Context, string) (int64, error)
	GetTotalConnectionsCount(context.Context, string, string) (int64, error)
}

EventsDBModule is the interface of the audit events module.

func NewEventsDBModule

func NewEventsDBModule(db database.CloudtrustDB) EventsDBModule

NewEventsDBModule returns an events database module.

type KeycloakClient

type KeycloakClient interface {
	GetGroupsOfUser(accessToken string, realmName, userID string) ([]kc.GroupRepresentation, error)
	GetGroup(accessToken string, realmName, groupID string) (kc.GroupRepresentation, error)
}

KeycloakClient are methods from keycloak-client used by authorization manager

type Logger

type Logger interface {
	Debug(keyvals ...interface{}) error
	Info(keyvals ...interface{}) error
	Warn(keyvals ...interface{}) error
	Error(keyvals ...interface{}) error
}

Logger interface for logging with level

Jump to

Keyboard shortcuts

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