userinfo

package
v0.0.0-...-39bdb22 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(UserInfoService), "*"),
	wire.Struct(new(Sink), "*"),
)
View Source
var UserInfoCacheLogger = slogutil.NewLogger("userinfo-cache")

Functions

This section is empty.

Types

type RolesAndGroupsQueries

type RolesAndGroupsQueries interface {
	ListEffectiveRolesByUserID(ctx context.Context, userID string) ([]*model.Role, error)
}

type Sink

type Sink struct {
	UserInfoService *UserInfoService
}

func (*Sink) ReceiveBlockingEvent

func (s *Sink) ReceiveBlockingEvent(ctx context.Context, e *event.Event) error

func (*Sink) ReceiveNonBlockingEvent

func (s *Sink) ReceiveNonBlockingEvent(ctx context.Context, e *event.Event) error

type UserInfo

type UserInfo struct {
	User                    *model.User                   `json:"user,omitempty"`
	AccountAccountStaleFrom *time.Time                    `json:"account_status_stale_from,omitempty"`
	EffectiveRoleKeys       []string                      `json:"effective_role_keys"`
	Authenticators          []model.UserInfoAuthenticator `json:"authenticators"`
	RecoveryCodeEnabled     bool                          `json:"recovery_code_enabled"`
}

type UserInfoAuthenticatorService

type UserInfoAuthenticatorService interface {
	List(ctx context.Context, userID string, filters ...authenticator.Filter) ([]*authenticator.Info, error)
}

type UserInfoMFAService

type UserInfoMFAService interface {
	ListRecoveryCodes(ctx context.Context, userID string) ([]*mfa.RecoveryCode, error)
}

type UserInfoService

type UserInfoService struct {
	Redis                 *appredis.Handle
	Clock                 clock.Clock
	AppID                 config.AppID
	AuthenticationConfig  *config.AuthenticationConfig
	UserQueries           UserQueries
	RolesAndGroupsQueries RolesAndGroupsQueries
	AuthenticatorService  UserInfoAuthenticatorService
	MFAService            UserInfoMFAService
}

func (*UserInfoService) GetUserInfoBearer

func (s *UserInfoService) GetUserInfoBearer(ctx context.Context, userID string) (*UserInfo, error)

func (*UserInfoService) GetUserInfoGreatest

func (s *UserInfoService) GetUserInfoGreatest(ctx context.Context, userID string) (*UserInfo, error)

func (*UserInfoService) PurgeUserInfo

func (s *UserInfoService) PurgeUserInfo(ctx context.Context, userID string) error

type UserQueries

type UserQueries interface {
	Get(ctx context.Context, id string, role accesscontrol.Role) (*model.User, error)
}

Jump to

Keyboard shortcuts

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