keycloakx

package
v0.0.0-...-7cdc305 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound = errors.New("user not found")
)

Functions

func GetAllGroupsForUser

func GetAllGroupsForUser(ctx context.Context, userID string) ([]*gocloak.Group, error)

func GetGroupByID

func GetGroupByID(ctx context.Context, groupID string) (*gocloak.Group, error)

func GetGroupByName

func GetGroupByName(ctx context.Context, groupName string) (*gocloak.Group, error)

func GetUser

func GetUser(ctx context.Context, idpSub string) (*gocloak.User, error)

func GetUserByUsername

func GetUserByUsername(ctx context.Context, username string) (*gocloak.User, error)

func Initialize

func Initialize(ctx context.Context) error

func IsMemberOfGroup

func IsMemberOfGroup(ctx context.Context, userID string, group string) (bool, error)

func MustGetGroupID

func MustGetGroupID(groupName string) string

MustGetGroupID converts a group name to a group ID. Do not use for group names not listed in config.UserGroups and subsequently in keycloakx.initializeGroups panics if the group name is not found

Types

type ChangeGroupMembershipAction

type ChangeGroupMembershipAction string
const (
	ChangeGroupMembershipActionAdd    ChangeGroupMembershipAction = "add"
	ChangeGroupMembershipActionRemove ChangeGroupMembershipAction = "remove"
)

type ChangeGroupMembershipArgs

type ChangeGroupMembershipArgs struct {
	UserID  int32
	GroupID string
	Action  ChangeGroupMembershipAction
}

func (ChangeGroupMembershipArgs) Kind

type ChangeGroupMembershipWorker

type ChangeGroupMembershipWorker struct {
	river.WorkerDefaults[ChangeGroupMembershipArgs]
}

func (*ChangeGroupMembershipWorker) Work

type GroupNotFoundError

type GroupNotFoundError struct {
	Group string
}

func (GroupNotFoundError) Error

func (g GroupNotFoundError) Error() string

type SetUserAttributesArgs

type SetUserAttributesArgs struct {
	KeycloakID string
}

func (SetUserAttributesArgs) Kind

type SetUserAttributesWorker

type SetUserAttributesWorker struct {
	river.WorkerDefaults[SetUserAttributesArgs]
}

func (*SetUserAttributesWorker) Work

type SyncUserArgs

type SyncUserArgs struct {
	Username  string
	Groups    []string
	InvitedBy pgtype.Int4
}

func (SyncUserArgs) Kind

func (SyncUserArgs) Kind() string

type SyncUserWorker

type SyncUserWorker struct {
	river.WorkerDefaults[SyncUserArgs]
}

func (*SyncUserWorker) Work

Jump to

Keyboard shortcuts

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