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
- func (s AccountStatus) Anonymize() (*AccountStatus, error)
- func (s AccountStatus) Check() error
- func (s AccountStatus) Disable(reason *string) (*AccountStatus, error)
- func (s AccountStatus) Reenable() (*AccountStatus, error)
- func (s AccountStatus) ScheduleAnonymizationByAdmin(anonymizeAt time.Time) (*AccountStatus, error)
- func (s AccountStatus) ScheduleDeletionByAdmin(deleteAt time.Time) (*AccountStatus, error)
- func (s AccountStatus) ScheduleDeletionByEndUser(deleteAt time.Time) (*AccountStatus, error)
- func (s AccountStatus) Type() AccountStatusType
- func (s AccountStatus) UnscheduleAnonymizationByAdmin() (*AccountStatus, error)
- func (s AccountStatus) UnscheduleDeletionByAdmin() (*AccountStatus, error)
- type AccountStatusType
- 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 AccountStatus) 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
- 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) Anonymize(ctx context.Context, userID string) error
- 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) UpdateAccountStatus(ctx context.Context, userID string, accountStatus AccountStatus) 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) 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 DeactivatedUser = apierrors.Forbidden.WithReason("DeactivatedUser")
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 ErrDeactivatedUser = DeactivatedUser.New("user is deactivated")
View Source
var ErrUserNotFound = errors.New("user not found")
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")
Functions ¶
func IsAccountStatusError ¶
func NewErrDisabledUser ¶
Types ¶
type AccountStatus ¶
type AccountStatus struct { IsDisabled bool IsDeactivated bool DisableReason *string DeleteAt *time.Time IsAnonymized bool AnonymizeAt *time.Time }
AccountStatus represents disabled, deactivated, or scheduled deletion state. The zero value means normal.
func (AccountStatus) Anonymize ¶
func (s AccountStatus) Anonymize() (*AccountStatus, error)
func (AccountStatus) Check ¶
func (s AccountStatus) Check() error
func (AccountStatus) Disable ¶
func (s AccountStatus) Disable(reason *string) (*AccountStatus, error)
func (AccountStatus) Reenable ¶
func (s AccountStatus) Reenable() (*AccountStatus, error)
func (AccountStatus) ScheduleAnonymizationByAdmin ¶
func (s AccountStatus) ScheduleAnonymizationByAdmin(anonymizeAt time.Time) (*AccountStatus, error)
func (AccountStatus) ScheduleDeletionByAdmin ¶
func (s AccountStatus) ScheduleDeletionByAdmin(deleteAt time.Time) (*AccountStatus, error)
func (AccountStatus) ScheduleDeletionByEndUser ¶
func (s AccountStatus) ScheduleDeletionByEndUser(deleteAt time.Time) (*AccountStatus, error)
func (AccountStatus) Type ¶
func (s AccountStatus) Type() AccountStatusType
func (AccountStatus) UnscheduleAnonymizationByAdmin ¶
func (s AccountStatus) UnscheduleAnonymizationByAdmin() (*AccountStatus, error)
func (AccountStatus) UnscheduleDeletionByAdmin ¶
func (s AccountStatus) UnscheduleDeletionByAdmin() (*AccountStatus, error)
type AccountStatusType ¶
type AccountStatusType string
const ( AccountStatusTypeNormal AccountStatusType = "normal" AccountStatusTypeDisabled AccountStatusType = "disabled" AccountStatusTypeDeactivated AccountStatusType = "deactivated" AccountStatusTypeScheduledDeletionDisabled AccountStatusType = "scheduled_deletion_disabled" AccountStatusTypeScheduledDeletionDeactivated AccountStatusType = "scheduled_deletion_deactivated" AccountStatusTypeAnonymized AccountStatusType = "anonymized" AccountStatusTypeScheduledAnonymizationDisabled AccountStatusType = "scheduled_anonymization_disabled" )
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 }
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 AccountStatus) error
func (*RawCommands) UpdateLoginTime ¶
func (*RawCommands) UpdateMFAEnrollment ¶
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) UpdateAccountStatus ¶
func (*Store) UpdateCustomAttributes ¶
func (*Store) UpdateLastIndexedAt ¶
func (*Store) UpdateLoginTime ¶
func (*Store) UpdateMFAEnrollment ¶
type User ¶
type User struct { ID string CreatedAt time.Time UpdatedAt time.Time MostRecentLoginAt *time.Time LessRecentLoginAt *time.Time IsDisabled bool DisableReason *string IsDeactivated bool DeleteAt *time.Time IsAnonymized bool AnonymizeAt *time.Time StandardAttributes map[string]interface{} CustomAttributes map[string]interface{} LastIndexedAt *time.Time RequireReindexAfter *time.Time MFAGracePeriodtEndAt *time.Time }
func (*User) AccountStatus ¶
func (u *User) AccountStatus() AccountStatus
type UserForExport ¶
Click to show internal directories.
Click to hide internal directories.