Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin interface { EnsureSetup(ctx context.Context) error GetOrCreateClient(ctx context.Context, clientID string) (Client, error) Session(ctx context.Context) Session CreateUser(ctx context.Context, username, password string) error DeleteUser(ctx context.Context, username string) error GetUser(ctx context.Context, username string) (User, error) GetUsers(ctx context.Context) (map[string]User, error) UpdateUser(ctx context.Context, user User) error }
func NewAdmin ¶
func NewAdmin(core Core, opts ...AdminOption) Admin
type AdminOption ¶
type AdminOption func(*adminConfig)
func ClientID ¶
func ClientID(clientID string) AdminOption
func MasterRealm ¶ added in v0.1.6
func MasterRealm(masterRealm string) AdminOption
func Password ¶
func Password(password string) AdminOption
func Realm ¶
func Realm(realm string) AdminOption
func Username ¶
func Username(username string) AdminOption
type Client ¶
type Core ¶
type Core interface {
GetClient() *gocloak.GoCloak
}
func NewCore ¶
func NewCore(opts ...CoreOption) Core
type CoreOption ¶
type CoreOption func(*coreConfig)
func BaseURL ¶
func BaseURL(url string) CoreOption
type EventEmitter ¶
type EventEmitter interface { Signal() signalslots.Signal GetLastEventTime() time.Time SetLastEventTime(time.Time) ProcessNextBatch(ctx context.Context, session Session) error }
func NewEventEmitter ¶
func NewEventEmitter(core Core, opts ...EventEmitterOption) EventEmitter
type EventEmitterOption ¶
type EventEmitterOption func(*eventEmitterConfig)
func BatchSize ¶
func BatchSize(size int) EventEmitterOption
func EventTypes ¶
func EventTypes(types ...EventType) EventEmitterOption
type EventType ¶
type EventType string
const ( // Login Events EventLogin EventType = "LOGIN" EventLoginError EventType = "LOGIN_ERROR" EventLogout EventType = "LOGOUT" EventLogoutError EventType = "LOGOUT_ERROR" // Registration Events EventRegister EventType = "REGISTER" EventRegisterError EventType = "REGISTER_ERROR" EventDeleteAccount EventType = "DELETE_ACCOUNT" EventDeleteError EventType = "DELETE_ACCOUNT_ERROR" // User Profile Events EventUpdateProfile EventType = "UPDATE_PROFILE" EventUpdatePassword EventType = "UPDATE_PASSWORD" EventUpdateEmail EventType = "UPDATE_EMAIL" EventVerifyEmail EventType = "VERIFY_EMAIL" EventUpdateLocale EventType = "UPDATE_LOCALE" // Identity Provider Events EventLinkIDP EventType = "IDENTITY_PROVIDER_LINK" EventUnlinkIDP EventType = "IDENTITY_PROVIDER_UNLINK" EventLoginIDP EventType = "IDENTITY_PROVIDER_LOGIN" EventFirstLoginIDP EventType = "IDENTITY_PROVIDER_FIRST_LOGIN" EventPostLoginIDP EventType = "IDENTITY_PROVIDER_POST_LOGIN" EventResponseIDP EventType = "IDENTITY_PROVIDER_RESPONSE" // 2FA/MFA Events EventRemoveTotp EventType = "REMOVE_TOTP" EventUpdateTotp EventType = "UPDATE_TOTP" EventGrantConsent EventType = "GRANT_CONSENT" EventUpdateConsent EventType = "UPDATE_CONSENT" EventRevokeConsent EventType = "REVOKE_CONSENT" EventCodeToToken EventType = "CODE_TO_TOKEN" EventCustomRequired EventType = "CUSTOM_REQUIRED_ACTION" // Client Events EventClientLogin EventType = "CLIENT_LOGIN" EventClientLogout EventType = "CLIENT_LOGOUT" EventClientRegister EventType = "CLIENT_REGISTER" EventClientDelete EventType = "CLIENT_DELETE" EventClientUpdate EventType = "CLIENT_UPDATE" EventClientInfo EventType = "CLIENT_INFO" EventClientInitLogin EventType = "CLIENT_INITIATED_ACCOUNT_LINKING" // Token Events EventTokenRefresh EventType = "REFRESH_TOKEN" EventTokenExchange EventType = "TOKEN_EXCHANGE" EventIntrospectToken EventType = "INTROSPECT_TOKEN" EventValidateToken EventType = "VALIDATE_ACCESS_TOKEN" // Role Events EventGrantRole EventType = "GRANT_ROLE" EventRemoveRole EventType = "REMOVE_ROLE" EventUpdateRole EventType = "UPDATE_ROLE" // Permission Events EventPermissionGrant EventType = "PERMISSION_GRANT" EventPermissionRevoke EventType = "PERMISSION_REVOKE" // Group Events EventGroupMembership EventType = "GROUP_MEMBERSHIP" EventJoinGroup EventType = "JOIN_GROUP" EventLeaveGroup EventType = "LEAVE_GROUP" // Session Events EventRestart EventType = "RESTART_AUTHENTICATION" EventImpersonate EventType = "IMPERSONATE" EventBackchannelLogin EventType = "BACKCHANNEL_LOGIN" EventBackchannelLogout EventType = "BACKCHANNEL_LOGOUT" EventClientSessionExpired EventType = "CLIENT_SESSION_EXPIRED" EventSessionExpired EventType = "SESSION_EXPIRED" )
type Session ¶
type Session interface { Refresh(context.Context) error Revoke(context.Context) error PastHalfLife(context.Context) bool GetOwnerName(context.Context) (string, error) IsValid(context.Context) bool AccessToken() string RefreshToken() string Realm() string ClientID() string ClientSecret() string }
func NewSession ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.