Documentation
¶
Index ¶
- Variables
- func IsAccountStatusError(err error) bool
- func NewErrDisabledUser(reason *string) error
- func NewErrScheduledAnonymizationByAdmin(anonymizeAt time.Time) error
- func NewErrScheduledDeletionByAdmin(deleteAt time.Time) error
- func NewErrScheduledDeletionByEndUser(deleteAt time.Time) error
- type AccountStatus
- type AccountStatusVariantDisabledIndefinitely
- type AccountStatusVariantDisabledTemporarily
- type AccountStatusVariantNormal
- type AccountStatusVariantScheduledAnonymizationByAdmin
- type AccountStatusVariantScheduledDeletionByAdmin
- type AccountStatusVariantScheduledDeletionByEndUser
- type AccountStatusWithRefTime
- func (s AccountStatusWithRefTime) AccountStatusStaleFrom() *time.Time
- func (s AccountStatusWithRefTime) AccountValidFrom() *time.Time
- func (s AccountStatusWithRefTime) AccountValidUntil() *time.Time
- func (s AccountStatusWithRefTime) Anonymize() (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) AnonymizeAt() *time.Time
- func (s AccountStatusWithRefTime) Check() error
- func (s AccountStatusWithRefTime) DeleteAt() *time.Time
- func (s AccountStatusWithRefTime) DeleteReason() *string
- func (s AccountStatusWithRefTime) DisableIndefinitely(reason *string) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) DisableReason() *string
- func (s AccountStatusWithRefTime) DisableTemporarily(from *time.Time, until *time.Time, reason *string) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) IsAnonymized() bool
- func (s AccountStatusWithRefTime) IsDeactivated() bool
- func (s AccountStatusWithRefTime) IsDisabled() bool
- func (s AccountStatusWithRefTime) Reenable() (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) ScheduleAnonymizationByAdmin(anonymizeAt time.Time) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) ScheduleDeletionByAdmin(deleteAt time.Time, reason string) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) ScheduleDeletionByEndUser(deleteAt time.Time, reason string) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) SetAccountValidFrom(t *time.Time) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) SetAccountValidPeriod(from *time.Time, until *time.Time) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) SetAccountValidUntil(t *time.Time) (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) TemporarilyDisabledFrom() *time.Time
- func (s AccountStatusWithRefTime) TemporarilyDisabledUntil() *time.Time
- func (s AccountStatusWithRefTime) UnscheduleAnonymizationByAdmin() (*AccountStatusWithRefTime, error)
- func (s AccountStatusWithRefTime) UnscheduleDeletionByAdmin() (*AccountStatusWithRefTime, error)
- type AuthenticatorService
- type Commands
- type CustomAttributesService
- type EventService
- type FilterOptions
- type IdentityService
- type ListOptions
- type Provider
- type Queries
- func (p *Queries) CountAll(ctx context.Context) (count uint64, err error)
- func (p *Queries) Get(ctx context.Context, id string, role accesscontrol.Role) (*model.User, error)
- func (p *Queries) GetMany(ctx context.Context, ids []string, role accesscontrol.Role) (users []*model.User, err error)
- func (p *Queries) GetPageForExport(ctx context.Context, offset uint64, limit uint64) (users []*UserForExport, err error)
- type RawCommands
- func (c *RawCommands) AfterCreate(userModel *model.User, identities []*identity.Info) error
- func (c *RawCommands) Anonymize(ctx context.Context, userID string) error
- func (c *RawCommands) Create(ctx context.Context, userID string) (*User, error)
- func (c *RawCommands) Delete(ctx context.Context, userID string) error
- func (c *RawCommands) New(userID string) *User
- func (c *RawCommands) UpdateAccountStatus(ctx context.Context, userID string, accountStatus AccountStatusWithRefTime) error
- func (c *RawCommands) UpdateLoginTime(ctx context.Context, userID string, loginAt time.Time) error
- func (c *RawCommands) UpdateMFAEnrollment(ctx context.Context, userID string, endAt *time.Time) error
- func (c *RawCommands) UpdateOptOutPasskeyUpselling(ctx context.Context, userID string, optout bool) error
- type RawQueries
- func (p *RawQueries) Count(ctx context.Context) (uint64, error)
- func (p *RawQueries) GetManyRaw(ctx context.Context, ids []string) ([]*User, error)
- func (p *RawQueries) GetRaw(ctx context.Context, id string) (*User, error)
- func (p *RawQueries) QueryPage(ctx context.Context, listOption ListOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
- type RolesAndGroupsService
- type SortBy
- type SortOption
- type StandardAttributesService
- type Store
- func (s *Store) Count(ctx context.Context) (uint64, error)
- func (s *Store) Create(ctx context.Context, u *User) (err error)
- func (s *Store) Delete(ctx context.Context, userID string) error
- func (s *Store) Get(ctx context.Context, userID string) (*User, error)
- func (s *Store) GetByIDs(ctx context.Context, userIDs []string) ([]*User, error)
- func (s *Store) MarkAsReindexRequired(ctx context.Context, userIDs []string) error
- func (s *Store) QueryForExport(ctx context.Context, offset uint64, limit uint64) ([]*User, error)
- func (s *Store) QueryPage(ctx context.Context, listOption ListOptions, pageArgs graphqlutil.PageArgs) ([]*User, uint64, error)
- func (s *Store) SetAllAttributesToNull(ctx context.Context, userID string) error
- func (s *Store) UpdateAccountStatus(ctx context.Context, userID string, accountStatus AccountStatusWithRefTime) error
- func (s *Store) UpdateCustomAttributes(ctx context.Context, userID string, customAttrs map[string]interface{}) error
- func (s *Store) UpdateLastIndexedAt(ctx context.Context, userIDs []string, at time.Time) error
- func (s *Store) UpdateLoginTime(ctx context.Context, userID string, loginAt time.Time) error
- func (s *Store) UpdateMFAEnrollment(ctx context.Context, userID string, endAt *time.Time) error
- func (s *Store) UpdateOptOutPasskeyUpselling(ctx context.Context, userID string, optout bool) error
- func (s *Store) UpdateStandardAttributes(ctx context.Context, userID string, stdAttrs map[string]interface{}) error
- type User
- type UserForExport
- type VerificationService
Constants ¶
This section is empty.
Variables ¶
View Source
var AnonymizedUser = apierrors.Forbidden.WithReason("AnonymizedUser")
View Source
var DependencySet = wire.NewSet( wire.Struct(new(Store), "*"), wire.Bind(new(store), new(*Store)), wire.Struct(new(Commands), "*"), wire.Struct(new(Queries), "*"), wire.Struct(new(RawQueries), "*"), wire.Struct(new(RawCommands), "*"), wire.Struct(new(Provider), "*"), )
View Source
var DisabledUser = apierrors.Forbidden.WithReason("DisabledUser")
View Source
var ErrAnonymizedUser = AnonymizedUser.New("user is anonymized")
View Source
var ErrUserNotFound = api.UserNotFound.New("user not found")
View Source
var ErrUserOutsideValidPeriod = UserOutsideValidPeriod.New("user is outside valid period")
View Source
var InvalidAccountStatusTransition = apierrors.Invalid.WithReason("InvalidAccountStatusTransition")
View Source
var ScheduledAnonymizationByAdmin = apierrors.Forbidden.WithReason("ScheduledAnonymizationByAdmin")
View Source
var ScheduledDeletionByAdmin = apierrors.Forbidden.WithReason("ScheduledDeletionByAdmin")
View Source
var ScheduledDeletionByEndUser = apierrors.Forbidden.WithReason("ScheduledDeletionByEndUser")
View Source
var UserOutsideValidPeriod = apierrors.Forbidden.WithReason("UserOutsideValidPeriod")
Functions ¶
func IsAccountStatusError ¶
func NewErrDisabledUser ¶
Types ¶
type AccountStatus ¶
type AccountStatus struct {
// contains filtered or unexported fields
}
func (AccountStatus) WithRefTime ¶
func (s AccountStatus) WithRefTime(refTime time.Time) AccountStatusWithRefTime
type AccountStatusVariantDisabledIndefinitely ¶
type AccountStatusVariantDisabledIndefinitely struct {
// contains filtered or unexported fields
}
type AccountStatusVariantDisabledTemporarily ¶
type AccountStatusVariantDisabledTemporarily struct {
// contains filtered or unexported fields
}
type AccountStatusVariantNormal ¶
type AccountStatusVariantNormal struct{}
type AccountStatusVariantScheduledAnonymizationByAdmin ¶
type AccountStatusVariantScheduledAnonymizationByAdmin struct {
// contains filtered or unexported fields
}
type AccountStatusVariantScheduledDeletionByAdmin ¶
type AccountStatusVariantScheduledDeletionByAdmin struct {
// contains filtered or unexported fields
}
type AccountStatusVariantScheduledDeletionByEndUser ¶
type AccountStatusVariantScheduledDeletionByEndUser struct {
// contains filtered or unexported fields
}
type AccountStatusWithRefTime ¶
type AccountStatusWithRefTime struct {
// contains filtered or unexported fields
}
func (AccountStatusWithRefTime) AccountStatusStaleFrom ¶
func (s AccountStatusWithRefTime) AccountStatusStaleFrom() *time.Time
func (AccountStatusWithRefTime) AccountValidFrom ¶
func (s AccountStatusWithRefTime) AccountValidFrom() *time.Time
func (AccountStatusWithRefTime) AccountValidUntil ¶
func (s AccountStatusWithRefTime) AccountValidUntil() *time.Time
func (AccountStatusWithRefTime) Anonymize ¶
func (s AccountStatusWithRefTime) Anonymize() (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) AnonymizeAt ¶
func (s AccountStatusWithRefTime) AnonymizeAt() *time.Time
func (AccountStatusWithRefTime) Check ¶
func (s AccountStatusWithRefTime) Check() error
func (AccountStatusWithRefTime) DeleteAt ¶
func (s AccountStatusWithRefTime) DeleteAt() *time.Time
func (AccountStatusWithRefTime) DeleteReason ¶
func (s AccountStatusWithRefTime) DeleteReason() *string
func (AccountStatusWithRefTime) DisableIndefinitely ¶
func (s AccountStatusWithRefTime) DisableIndefinitely(reason *string) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) DisableReason ¶
func (s AccountStatusWithRefTime) DisableReason() *string
func (AccountStatusWithRefTime) DisableTemporarily ¶
func (s AccountStatusWithRefTime) DisableTemporarily(from *time.Time, until *time.Time, reason *string) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) IsAnonymized ¶
func (s AccountStatusWithRefTime) IsAnonymized() bool
func (AccountStatusWithRefTime) IsDeactivated ¶
func (s AccountStatusWithRefTime) IsDeactivated() bool
func (AccountStatusWithRefTime) IsDisabled ¶
func (s AccountStatusWithRefTime) IsDisabled() bool
func (AccountStatusWithRefTime) Reenable ¶
func (s AccountStatusWithRefTime) Reenable() (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) ScheduleAnonymizationByAdmin ¶
func (s AccountStatusWithRefTime) ScheduleAnonymizationByAdmin(anonymizeAt time.Time) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) ScheduleDeletionByAdmin ¶
func (s AccountStatusWithRefTime) ScheduleDeletionByAdmin(deleteAt time.Time, reason string) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) ScheduleDeletionByEndUser ¶
func (s AccountStatusWithRefTime) ScheduleDeletionByEndUser(deleteAt time.Time, reason string) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) SetAccountValidFrom ¶
func (s AccountStatusWithRefTime) SetAccountValidFrom(t *time.Time) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) SetAccountValidPeriod ¶
func (s AccountStatusWithRefTime) SetAccountValidPeriod(from *time.Time, until *time.Time) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) SetAccountValidUntil ¶
func (s AccountStatusWithRefTime) SetAccountValidUntil(t *time.Time) (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) TemporarilyDisabledFrom ¶
func (s AccountStatusWithRefTime) TemporarilyDisabledFrom() *time.Time
func (AccountStatusWithRefTime) TemporarilyDisabledUntil ¶
func (s AccountStatusWithRefTime) TemporarilyDisabledUntil() *time.Time
func (AccountStatusWithRefTime) UnscheduleAnonymizationByAdmin ¶
func (s AccountStatusWithRefTime) UnscheduleAnonymizationByAdmin() (*AccountStatusWithRefTime, error)
func (AccountStatusWithRefTime) UnscheduleDeletionByAdmin ¶
func (s AccountStatusWithRefTime) UnscheduleDeletionByAdmin() (*AccountStatusWithRefTime, error)
type AuthenticatorService ¶
type AuthenticatorService interface {
ListByUserIDs(ctx context.Context, userIDs []string, filters ...authenticator.Filter) (map[string][]*authenticator.Info, error)
}
type Commands ¶
type Commands struct {
*RawCommands
RawQueries *RawQueries
Events EventService
Verification VerificationService
UserProfileConfig *config.UserProfileConfig
StandardAttributes StandardAttributesService
CustomAttributes CustomAttributesService
RolesAndGroups RolesAndGroupsService
}
type CustomAttributesService ¶
type CustomAttributesService interface {
ReadCustomAttributesInStorageForm(ctx context.Context, role accesscontrol.Role, userID string, storageForm map[string]interface{}) (map[string]interface{}, error)
ReadCustomAttributesInStorageFormForUsers(
ctx context.Context,
role accesscontrol.Role,
userIDs []string,
storageForms []map[string]interface{},
) (map[string]map[string]interface{}, error)
}
type EventService ¶
type FilterOptions ¶
func (FilterOptions) IsFilterEnabled ¶
func (o FilterOptions) IsFilterEnabled() bool
type IdentityService ¶
type ListOptions ¶
type ListOptions struct {
SortOption SortOption
}
type Queries ¶
type Queries struct {
*RawQueries
Store store
Identities IdentityService
Authenticators AuthenticatorService
Verification VerificationService
StandardAttributes StandardAttributesService
CustomAttributes CustomAttributesService
RolesAndGroups RolesAndGroupsService
Clock clock.Clock
}
func (*Queries) GetPageForExport ¶
type RawCommands ¶
func (*RawCommands) AfterCreate ¶
func (*RawCommands) Anonymize ¶
func (c *RawCommands) Anonymize(ctx context.Context, userID string) error
func (*RawCommands) New ¶
func (c *RawCommands) New(userID string) *User
func (*RawCommands) UpdateAccountStatus ¶
func (c *RawCommands) UpdateAccountStatus(ctx context.Context, userID string, accountStatus AccountStatusWithRefTime) error
func (*RawCommands) UpdateLoginTime ¶
func (*RawCommands) UpdateMFAEnrollment ¶
func (*RawCommands) UpdateOptOutPasskeyUpselling ¶
type RawQueries ¶
type RawQueries struct {
Store store
}
func (*RawQueries) GetManyRaw ¶
func (*RawQueries) QueryPage ¶
func (p *RawQueries) QueryPage(ctx context.Context, listOption ListOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
type RolesAndGroupsService ¶
type RolesAndGroupsService interface {
ListRolesByUserID(ctx context.Context, userID string) ([]*model.Role, error)
ListGroupsByUserID(ctx context.Context, userID string) ([]*model.Group, error)
ListRolesByUserIDs(ctx context.Context, userIDs []string) (map[string][]*model.Role, error)
ListGroupsByUserIDs(ctx context.Context, userIDs []string) (map[string][]*model.Group, error)
}
type SortOption ¶
type SortOption struct {
SortBy SortBy
SortDirection model.SortDirection
}
func (SortOption) Apply ¶
func (o SortOption) Apply(builder db.SelectBuilder, after string) db.SelectBuilder
func (SortOption) GetSortBy ¶
func (o SortOption) GetSortBy() SortBy
func (SortOption) GetSortDirection ¶
func (o SortOption) GetSortDirection() model.SortDirection
type StandardAttributesService ¶
type StandardAttributesService interface {
DeriveStandardAttributes(ctx context.Context, role accesscontrol.Role, userID string, updatedAt time.Time, attrs map[string]interface{}) (map[string]interface{}, error)
DeriveStandardAttributesForUsers(
ctx context.Context,
role accesscontrol.Role,
userIDs []string,
updatedAts []time.Time,
attrsList []map[string]interface{},
) (map[string]map[string]interface{}, error)
}
type Store ¶
type Store struct {
SQLBuilder *appdb.SQLBuilderApp
SQLExecutor *appdb.SQLExecutor
Clock clock.Clock
AppID config.AppID
}
func (*Store) MarkAsReindexRequired ¶
func (*Store) QueryForExport ¶
func (*Store) QueryPage ¶
func (s *Store) QueryPage(ctx context.Context, listOption ListOptions, pageArgs graphqlutil.PageArgs) ([]*User, uint64, error)
func (*Store) SetAllAttributesToNull ¶
func (*Store) UpdateAccountStatus ¶
func (*Store) UpdateCustomAttributes ¶
func (*Store) UpdateLastIndexedAt ¶
func (*Store) UpdateLoginTime ¶
func (*Store) UpdateMFAEnrollment ¶
func (*Store) UpdateOptOutPasskeyUpselling ¶
type User ¶
type User struct {
ID string
CreatedAt time.Time
UpdatedAt time.Time
MostRecentLoginAt *time.Time
LessRecentLoginAt *time.Time
StandardAttributes map[string]interface{}
CustomAttributes map[string]interface{}
LastIndexedAt *time.Time
RequireReindexAfter *time.Time
MFAGracePeriodtEndAt *time.Time
OptOutPasskeyUpsell bool
// contains filtered or unexported fields
}
func (*User) AccountStatus ¶
func (u *User) AccountStatus(refTime time.Time) AccountStatusWithRefTime
type UserForExport ¶
Click to show internal directories.
Click to hide internal directories.