keycloak

package
v0.0.0-...-ebba861 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package keycloak offers an invitation backend for the invitation service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend represents the keycloak backend.

func New

func New(
	logger log.Logger,
	baseURL, clientID, clientSecret, clientRealm, userRealm string,
	insecureSkipVerify bool,
) *Backend

New instantiates a new keycloak.Backend with a default gocloak client.

func NewWithClient

func NewWithClient(
	logger log.Logger,
	client keycloak.Client,
	userRealm string,
) *Backend

NewWithClient creates a new backend with the supplied keycloak client.

func (Backend) CanSendMail

func (b Backend) CanSendMail() bool

CanSendMail returns true because keycloak does allow sending mail.

func (Backend) CreateUser

func (b Backend) CreateUser(ctx context.Context, invitation *invitations.Invitation) (string, error)

CreateUser creates a user in the keycloak backend.

func (Backend) SendMail

func (b Backend) SendMail(ctx context.Context, id string) error

SendMail sends a mail to the user with details on how to redeem the invitation.

type GoCloak

type GoCloak interface {
	CreateUser(ctx context.Context, token, realm string, user gocloak.User) (string, error)
	ExecuteActionsEmail(ctx context.Context, token, realm string, params gocloak.ExecuteActionsEmail) error
	LoginClient(ctx context.Context, clientID, clientSecret, realm string) (*gocloak.JWT, error)
	RetrospectToken(ctx context.Context, accessToken, clientID, clientSecret, realm string) (*gocloak.IntroSpectTokenResult, error)
}

GoCloak represents the parts of gocloak.GoCloak that we use, mainly here for mockery.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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