Documentation
¶
Index ¶
- Variables
- func Hash(password string) (string, error)
- func SanitizeUsername(s string) string
- func SecureFiveDigits() (int64, error)
- func ValidateUsername(username string) error
- func Verify(password, encoded string) (bool, error)
- type Config
- type CurrentUser
- type LoginInput
- type Service
- func (s *Service) ChangeUsername(ctx context.Context, userID uuid.UUID, username string) error
- func (s *Service) DeleteUser(ctx context.Context, userID uuid.UUID) error
- func (s *Service) DisableUser(ctx context.Context, userID uuid.UUID) error
- func (s *Service) GetCurrentUser(ctx context.Context, userID uuid.UUID) (*CurrentUser, error)
- func (s *Service) GetUser(ctx context.Context, userID uuid.UUID) (*domain.User, error)
- func (s *Service) Login(ctx context.Context, in LoginInput) (*domain.User, error)
- func (s *Service) Signup(ctx context.Context, in SignupInput) (*domain.User, error)
- type SignupInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrUserAlreadyExists = errors.New("user already exists") ErrUnsupportedProvider = errors.New("auth provider is not supported") ErrAccountExistsMustLink = errors.New("account exists; must link provider explicitly") ErrUsernameTaken = errors.New("username already taken") ErrInvalidUsername = errors.New("invalid username") ErrNoRolesInContext = errors.New("no roles in context for user") ErrEmailNotAllowed = errors.New("email is not allowed to access the application") )
Functions ¶
func SanitizeUsername ¶
sanitizeUsername: - keeps only [a-zA-z0-9_-] - turns runs of other chars into a single '-' - trims leading/trailing '-' and '_'
func SecureFiveDigits ¶
func ValidateUsername ¶
Types ¶
type Config ¶
type Config struct {
Store *store.Store
Tx *tx.Manager
WebhookPublisher webhook.Publisher
Logger *slog.Logger
AccessPolicy accesspolicy.EmailAccessPolicy
}
type LoginInput ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ChangeUsername ¶
func (*Service) DeleteUser ¶
func (*Service) DisableUser ¶
func (*Service) GetCurrentUser ¶
Click to show internal directories.
Click to hide internal directories.