Documentation
¶
Overview ¶
Package users is the user-account domain service: registration validation, profile reads, and password changes. Admin user management also lives here. It never imports HTTP; handlers translate its errors.
Index ¶
- type AdminListFilters
- type AdminListResult
- type RegisterInput
- type Service
- func (s *Service) AdminResetPassword(ctx context.Context, targetID uuid.UUID, newPassword string) error
- func (s *Service) AdminUpdate(ctx context.Context, actorID, targetID uuid.UUID, banned, hidden *bool, ...) (gen.User, error)
- func (s *Service) ChangePassword(ctx context.Context, userID uuid.UUID, ...) error
- func (s *Service) Get(ctx context.Context, id uuid.UUID) (gen.User, error)
- func (s *Service) ListAdmin(ctx context.Context, p pagination.Params, f AdminListFilters) (AdminListResult, error)
- func (s *Service) Register(ctx context.Context, in RegisterInput) (gen.User, error)
- func (s *Service) RehashPassword(ctx context.Context, userID uuid.UUID, newHash string) error
- func (s *Service) Solves(ctx context.Context, userID uuid.UUID) ([]gen.ListUserSolvesRow, error)
- func (s *Service) TeamOf(ctx context.Context, userID uuid.UUID) (*TeamRef, error)
- type TeamRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminListFilters ¶
AdminListFilters narrows the admin user list.
type AdminListResult ¶
type AdminListResult struct {
Items []gen.ListUsersAdminRow
Total int64
}
AdminListResult is a page of users with their team refs.
type RegisterInput ¶
RegisterInput is the validated registration payload.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements user-account operations over the store.
func (*Service) AdminResetPassword ¶
func (s *Service) AdminResetPassword(ctx context.Context, targetID uuid.UUID, newPassword string) error
AdminResetPassword sets a new password and revokes the user's sessions.
func (*Service) AdminUpdate ¶
func (s *Service) AdminUpdate(ctx context.Context, actorID, targetID uuid.UUID, banned, hidden *bool, role *string) (gen.User, error)
AdminUpdate toggles banned/hidden or changes role. Banning revokes the user's sessions. Admins cannot ban or demote themselves.
func (*Service) ChangePassword ¶
func (s *Service) ChangePassword(ctx context.Context, userID uuid.UUID, current, newPassword, keepSessionToken string) error
ChangePassword verifies the current password and swaps in the new one, revoking every other session of the user.
func (*Service) ListAdmin ¶
func (s *Service) ListAdmin(ctx context.Context, p pagination.Params, f AdminListFilters) (AdminListResult, error)
ListAdmin returns a page of users for the admin panel.
func (*Service) RehashPassword ¶
RehashPassword persists a transparently upgraded hash (login-time rehash).