userinfo

package
v0.0.0-...-ef7d844 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(UserInfoService), "*"),
	wire.Struct(new(Sink), "*"),
)

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"`
	EffectiveRoleKeys []string    `json:"effective_role_keys"`
}

type UserInfoService

type UserInfoService struct {
	Redis                 *appredis.Handle
	AppID                 config.AppID
	UserQueries           UserQueries
	RolesAndGroupsQueries RolesAndGroupsQueries
}

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