Documentation
¶
Index ¶
- Variables
- func DecryptEmail(ciphertext string, key []byte) (string, error)
- func EncryptEmail(plain string, key []byte) (string, error)
- func HashEmail(normalized string) string
- func NormalizeEmail(email string) string
- type CreateInvitationRequest
- type CreateUserRequest
- type DisableMFARequest
- type LoginRequest
- type LoginResult
- type MFAService
- func (s *MFAService) DisableMFA(ctx context.Context, req DisableMFARequest) error
- func (s *MFAService) GetUserByID(ctx context.Context, id string) (*models.User, error)
- func (s *MFAService) StartEnrollment(ctx context.Context, userID string) (*StartEnrollmentResult, error)
- func (s *MFAService) UpdateProfile(ctx context.Context, req UpdateProfileRequest) error
- func (s *MFAService) VerifyChallenge(ctx context.Context, req VerifyChallengeRequest) (*VerifyChallengeResult, error)
- func (s *MFAService) VerifyEnrollment(ctx context.Context, req VerifyEnrollmentRequest) (*VerifyChallengeResult, error)
- type Service
- func NewService(repo repository.UserRepository, jwtSecret, emailEncryptionKey string) *Service
- func NewServiceFromDB(db *mongo.Database, jwtSecret, emailEncryptionKey string) *Service
- func NewServiceWithSettings(repo repository.UserRepository, settingsRepo repository.SettingsRepository, ...) *Service
- func (s *Service) AuthenticateSSO(ctx context.Context, rawToken string) (*LoginResult, error)
- func (s *Service) CreateInvitation(ctx context.Context, req CreateInvitationRequest) (*models.UserInvitation, error)
- func (s *Service) CreateUser(ctx context.Context, req CreateUserRequest) (*models.User, error)
- func (s *Service) DecryptStoredEmail(ciphertext string) (string, error)
- func (s *Service) EmailExists(ctx context.Context, email string) (bool, error)
- func (s *Service) EncryptForStorage(email string) (encrypted string, emailHash string, normalized string, err error)
- func (s *Service) FindUserByEmail(ctx context.Context, email string) (*models.User, error)
- func (s *Service) GetUserByID(ctx context.Context, id string) (*models.User, error)
- func (s *Service) Login(ctx context.Context, req LoginRequest) (*LoginResult, error)
- type StartEnrollmentResult
- type UpdateProfileRequest
- type VerifyChallengeRequest
- type VerifyChallengeResult
- type VerifyEnrollmentRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMFARequired = errors.New("mfa is required") ErrInvalidMFACode = errors.New("invalid mfa code") ErrInvalidPassword = errors.New("invalid password") )
View Source
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrSSONotConfigured = errors.New("sso_not_configured") ErrSSODisabled = errors.New("sso_disabled") ErrInvalidToken = errors.New("invalid_token") ErrUserNotFound = errors.New("user_not_found") ErrSSONotAllowed = errors.New("sso_not_allowed") )
Functions ¶
func NormalizeEmail ¶
Types ¶
type CreateInvitationRequest ¶
type CreateUserRequest ¶
type DisableMFARequest ¶
type LoginRequest ¶
type LoginResult ¶
type MFAService ¶
type MFAService struct {
// contains filtered or unexported fields
}
func NewMFAService ¶
func NewMFAService(repo repository.UserRepository, jwtSecret, mfaSecretKey, emailEncryptionKey, issuer string) *MFAService
func (*MFAService) DisableMFA ¶
func (s *MFAService) DisableMFA(ctx context.Context, req DisableMFARequest) error
func (*MFAService) GetUserByID ¶
func (*MFAService) StartEnrollment ¶
func (s *MFAService) StartEnrollment(ctx context.Context, userID string) (*StartEnrollmentResult, error)
func (*MFAService) UpdateProfile ¶
func (s *MFAService) UpdateProfile(ctx context.Context, req UpdateProfileRequest) error
func (*MFAService) VerifyChallenge ¶
func (s *MFAService) VerifyChallenge(ctx context.Context, req VerifyChallengeRequest) (*VerifyChallengeResult, error)
func (*MFAService) VerifyEnrollment ¶
func (s *MFAService) VerifyEnrollment(ctx context.Context, req VerifyEnrollmentRequest) (*VerifyChallengeResult, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo repository.UserRepository, jwtSecret, emailEncryptionKey string) *Service
func NewServiceFromDB ¶
func NewServiceWithSettings ¶
func NewServiceWithSettings(repo repository.UserRepository, settingsRepo repository.SettingsRepository, jwtSecret, emailEncryptionKey string) *Service
func (*Service) AuthenticateSSO ¶
func (*Service) CreateInvitation ¶
func (s *Service) CreateInvitation(ctx context.Context, req CreateInvitationRequest) (*models.UserInvitation, error)
func (*Service) CreateUser ¶
func (*Service) DecryptStoredEmail ¶
func (*Service) EmailExists ¶
func (*Service) EncryptForStorage ¶
func (*Service) FindUserByEmail ¶
func (*Service) GetUserByID ¶
func (*Service) Login ¶
func (s *Service) Login(ctx context.Context, req LoginRequest) (*LoginResult, error)
type StartEnrollmentResult ¶
type UpdateProfileRequest ¶
type VerifyChallengeRequest ¶
type VerifyChallengeResult ¶
type VerifyEnrollmentRequest ¶
Click to show internal directories.
Click to hide internal directories.