biztiphereth

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewUserCountCache added in v0.2.8

func NewUserCountCache(
	t TipherethRepo,
	store libcache.Store,
) *libcache.Key[modeltiphereth.UserCount]

Types

type Tiphereth added in v0.0.2

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

func NewTiphereth added in v0.0.2

func NewTiphereth(
	app *libapp.Settings,
	repo TipherethRepo,
	auth *libauth.Auth,
	supv *supervisor.Supervisor,

	sClient *client.Searcher,
	pullAccount *libmq.Topic[modeltiphereth.PullAccountInfo],
	cron *libcron.Cron,
	userCountCache *libcache.Key[modeltiphereth.UserCount],
) (*Tiphereth, error)

func (*Tiphereth) CreateConfiguredAdmin added in v0.2.2

func (t *Tiphereth) CreateConfiguredAdmin()

func (*Tiphereth) CreateUser added in v0.0.6

func (t *Tiphereth) CreateUser(ctx context.Context, user *modeltiphereth.User) (*model.InternalID, *errors.Error)

func (*Tiphereth) DeleteUserSession added in v0.2.1

func (t *Tiphereth) DeleteUserSession(ctx context.Context, id model.InternalID) *errors.Error

func (*Tiphereth) GainUserPrivilege added in v0.2.0

func (t *Tiphereth) GainUserPrivilege(
	ctx context.Context,
	userID model.InternalID,
) (modeltiphereth.AccessToken, *errors.Error)

func (*Tiphereth) GetToken added in v0.0.2

func (t *Tiphereth) GetToken(
	ctx context.Context,
	username, password string,
	deviceID *model.InternalID,
) (modeltiphereth.AccessToken, modeltiphereth.RefreshToken, *errors.Error)

func (*Tiphereth) GetUser added in v0.0.8

func (*Tiphereth) LinkAccount added in v0.0.2

func (*Tiphereth) ListLinkAccounts added in v0.0.10

func (t *Tiphereth) ListLinkAccounts(
	ctx context.Context, id model.InternalID,
) ([]*modeltiphereth.Account, *errors.Error)

func (*Tiphereth) ListPorters added in v0.2.0

func (t *Tiphereth) ListPorters(
	ctx context.Context,
	paging model.Paging,
) ([]*modeltiphereth.PorterInstance, int64, *errors.Error)

func (*Tiphereth) ListRegisteredDevices added in v0.2.3

func (t *Tiphereth) ListRegisteredDevices(ctx context.Context) ([]*modeltiphereth.DeviceInfo, *errors.Error)

func (*Tiphereth) ListUserSessions added in v0.2.1

func (t *Tiphereth) ListUserSessions(ctx context.Context) ([]*modeltiphereth.UserSession, *errors.Error)

func (*Tiphereth) ListUsers added in v0.0.10

func (t *Tiphereth) ListUsers(
	ctx context.Context, paging model.Paging, types []libauth.UserType, statuses []modeltiphereth.UserStatus,
) ([]*modeltiphereth.User, int64, *errors.Error)

func (*Tiphereth) RefreshToken added in v0.0.2

func (*Tiphereth) RegisterDevice added in v0.2.1

func (t *Tiphereth) RegisterDevice(
	ctx context.Context,
	device *modeltiphereth.DeviceInfo,
) (model.InternalID, *errors.Error)

func (*Tiphereth) RegisterUser added in v0.2.8

func (t *Tiphereth) RegisterUser(
	ctx context.Context,
	username string,
	password string,
	captchaReq *modeltiphereth.CaptchaAns,
) (*modeltiphereth.CaptchaQue, string, *errors.Error)

func (*Tiphereth) UnLinkAccount added in v0.0.6

func (t *Tiphereth) UnLinkAccount(ctx context.Context, a modeltiphereth.Account) *errors.Error

func (*Tiphereth) UpdatePorterPrivilege added in v0.2.0

func (t *Tiphereth) UpdatePorterPrivilege(
	ctx context.Context,
	id model.InternalID,
	privilege *modeltiphereth.PorterInstancePrivilege,
) *errors.Error

func (*Tiphereth) UpdatePorterStatus added in v0.2.0

func (t *Tiphereth) UpdatePorterStatus(
	ctx context.Context,
	id model.InternalID,
	status modeltiphereth.PorterInstanceStatus,
) *errors.Error

func (*Tiphereth) UpdateUser added in v0.0.2

func (t *Tiphereth) UpdateUser(
	ctx context.Context, user *modeltiphereth.User, originPassword string,
) *errors.Error

type TipherethRepo

type TipherethRepo interface {
	FetchUserByPassword(context.Context, string, string) (*modeltiphereth.User, error)
	CreateUser(context.Context, *modeltiphereth.User, model.InternalID) error
	UpdateUser(context.Context, *modeltiphereth.User, string) error
	ListUsers(context.Context, model.Paging, []model.InternalID,
		[]libauth.UserType, []modeltiphereth.UserStatus, []model.InternalID,
		model.InternalID) ([]*modeltiphereth.User, int64, error)
	GetUserCount(context.Context) (int, error)
	LinkAccount(context.Context, modeltiphereth.Account, model.InternalID) (model.InternalID, error)
	UnLinkAccount(context.Context, modeltiphereth.Account, model.InternalID) error
	ListLinkAccounts(context.Context, model.InternalID) ([]*modeltiphereth.Account, error)
	GetUser(context.Context, model.InternalID) (*modeltiphereth.User, error)
	UpsertPorters(context.Context, []*modeltiphereth.PorterInstance) error
	ListPorters(context.Context, model.Paging) ([]*modeltiphereth.PorterInstance, int64, error)
	UpdatePorterStatus(context.Context, model.InternalID, modeltiphereth.PorterInstanceStatus) error
	UpdatePorterPrivilege(context.Context, model.InternalID, model.InternalID,
		*modeltiphereth.PorterInstancePrivilege) error
	FetchPorterPrivilege(context.Context, model.InternalID, model.InternalID) (
		*modeltiphereth.PorterInstancePrivilege, error)
	CreateDevice(context.Context, *modeltiphereth.DeviceInfo) error
	ListUserSessions(context.Context, model.InternalID) ([]*modeltiphereth.UserSession, error)
	DeleteUserSession(context.Context, model.InternalID, model.InternalID) error
	FetchDeviceInfo(context.Context, model.InternalID) (*modeltiphereth.DeviceInfo, error)
	CreateUserSession(context.Context, *modeltiphereth.UserSession) error
	FetchUserSession(context.Context, model.InternalID, string) (*modeltiphereth.UserSession, error)
	UpdateUserSession(context.Context, *modeltiphereth.UserSession) error
	ListDevices(context.Context, model.InternalID) ([]*modeltiphereth.DeviceInfo, error)
}

Jump to

Keyboard shortcuts

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