keycloak

package
v0.12.78 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeycloakClientInterface

type KeycloakClientInterface interface {
	GetUsersWithResponse(ctx context.Context, realm string, params *keycloakClient.GetUsersParams, reqEditors ...keycloakClient.RequestEditorFn) (*keycloakClient.GetUsersResponse, error)
}

KeycloakClientInterface defines the subset of Keycloak client methods we use

type KeycloakService

type KeycloakService interface {
	// UserByMail retrieves a user by their email address
	UserByMail(ctx context.Context, userID string) (*graph.User, error)

	// GetUsersByEmails retrieves multiple users by their email addresses in a single batch call
	// Returns a map of email -> User for efficient lookups
	GetUsersByEmails(ctx context.Context, emails []string) (map[string]*graph.User, error)

	// EnrichUserRoles enriches user roles with complete user information from Keycloak
	// Updates the UserRoles slice in-place with FirstName, LastName, and UserID from Keycloak
	EnrichUserRoles(ctx context.Context, userRoles []*graph.UserRoles) error

	// GetUsers retrieves all users from Keycloak
	GetUsers(ctx context.Context) ([]*graph.User, error)
}

KeycloakService defines the interface for Keycloak user management operations

type Service

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

func New

func New(ctx context.Context, cfg *config.ServiceConfig) (*Service, error)

func (*Service) EnrichUserRoles

func (s *Service) EnrichUserRoles(ctx context.Context, userRoles []*graph.UserRoles) error

EnrichUserRoles enriches user roles with complete user information from Keycloak Updates the UserRoles slice in-place with FirstName, LastName, and UserID from Keycloak

func (*Service) GetUsers added in v0.10.1

func (s *Service) GetUsers(ctx context.Context) ([]*graph.User, error)

func (*Service) GetUsersByEmails

func (s *Service) GetUsersByEmails(ctx context.Context, emails []string) (map[string]*graph.User, error)

func (*Service) UserByMail

func (s *Service) UserByMail(ctx context.Context, userID string) (*graph.User, error)

Directories

Path Synopsis
Package keycloak provides primitives to interact with the openapi HTTP API.
Package keycloak provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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