keycloak

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken          = errors.New("invalid token")
	ErrTokenExpired          = errors.New("token expired")
	ErrTokenNotActive        = errors.New("token not active")
	ErrTokenInvalidType      = errors.New("token invalid type")
	ErrLogin                 = errors.New("failed to login to keycloak")
	ErrLogout                = errors.New("failed to logout")
	ErrEmptyUser             = errors.New("user is nil")
	ErrGetUser               = errors.New("failed to get user")
	ErrCreateUser            = errors.New("failed to create user")
	ErrSetPassword           = errors.New("failed to set password")
	ErrGetRole               = errors.New("failed to get role by name")
	ErrSetRole               = errors.New("failed to assign role")
	ErrParseID               = errors.New("failed to parse user id")
	ErrUserWithNilAttributes = errors.New("user with empty attributes")
)

Functions

Types

type KeycloakRepository

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

func (*KeycloakRepository) GetAccessTokenFromClientCode

func (r *KeycloakRepository) GetAccessTokenFromClientCode(ctx context.Context, code, redirectURL string) (*entities.ClientToken, error)

func (*KeycloakRepository) GetAccessTokenFromClientCredentials added in v1.1.0

func (r *KeycloakRepository) GetAccessTokenFromClientCredentials(ctx context.Context, clientID, clientSecret string) (*entities.ClientToken, error)

func (*KeycloakRepository) RefreshToken

func (r *KeycloakRepository) RefreshToken(ctx context.Context, refreshToken string) (*entities.ClientToken, error)

func (*KeycloakRepository) RetrospectToken

func (r *KeycloakRepository) RetrospectToken(ctx context.Context, token string) (*entities.IntroSpectTokenResult, error)

type UserRepository

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

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, user *entities.User, password string, roles []string) (*entities.User, error)

func (*UserRepository) GetAll added in v1.1.0

func (r *UserRepository) GetAll(ctx context.Context) ([]*entities.User, error)

func (*UserRepository) GetByIDs added in v1.1.0

func (r *UserRepository) GetByIDs(ctx context.Context, ids []string) ([]*entities.User, error)

func (*UserRepository) RemoveSession

func (r *UserRepository) RemoveSession(ctx context.Context, refreshToken string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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