Documentation ¶
Index ¶
- type PasswordValidationErrorType
- type PasswordValidationResult
- type UserManager
- func (um *UserManager) AddUser(user models.User) *UserManagerError
- func (um *UserManager) GenerateUserEmailVerificationToken(user models.User) string
- func (um *UserManager) GenerateUserOtpCode(user models.User) string
- func (um *UserManager) GetCurrentRecoveryToken(userId string) (*string, *UserManagerError)
- func (um *UserManager) GetUser(id string) *models.User
- func (um *UserManager) GetUserByEmail(email string) *models.User
- func (um *UserManager) GetUserById(id string) *models.User
- func (um *UserManager) GetUserByUsername(username string) *models.User
- func (um *UserManager) GetUserClaimsById(id string) []models.UserClaim
- func (um *UserManager) GetUserRefreshToken(id string) *string
- func (um *UserManager) GetUserRolesById(id string) []models.UserRole
- func (um *UserManager) RemoveUser(id string) bool
- func (um *UserManager) SetEmailVerificationState(userID string, state bool) *UserManagerError
- func (um *UserManager) UpdateEmailVerificationToken(userID string) (*models.User, *UserManagerError)
- func (um *UserManager) UpdatePassword(userId string, password string) *UserManagerError
- func (um *UserManager) UpdateRecoveryToken(userID string) (*models.User, *UserManagerError)
- func (um *UserManager) UpdateUserRefreshToken(id string, token string) bool
- func (um *UserManager) UpsertUser(user models.User) error
- func (um *UserManager) UpsertUserClaims(user models.User) error
- func (um *UserManager) UpsertUserRoles(user models.User) error
- func (um *UserManager) ValidateEmailVerificationToken(userID string, token string, scope string) *UserManagerError
- func (um *UserManager) ValidatePassword(password string) PasswordValidationResult
- func (um *UserManager) ValidateRecoveryToken(userId string, token string, scope string, cleanup bool) *UserManagerError
- type UserManagerError
- type UserManagerErrorType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PasswordValidationErrorType ¶
type PasswordValidationErrorType int64
const ( InvalidMinimumSize PasswordValidationErrorType = iota MissingSpecial MissingNumber MissingCapital ContainsDisallowedSpace )
func (PasswordValidationErrorType) FromString ¶
func (PasswordValidationErrorType PasswordValidationErrorType) FromString(keyType string) PasswordValidationErrorType
func (PasswordValidationErrorType) String ¶
func (PasswordValidationErrorType PasswordValidationErrorType) String() string
type PasswordValidationResult ¶
type PasswordValidationResult struct { Errors []PasswordValidationErrorType `json:"error"` // contains filtered or unexported fields }
func NewPasswordValidationResult ¶
func NewPasswordValidationResult() PasswordValidationResult
func (PasswordValidationResult) IsValid ¶
func (val PasswordValidationResult) IsValid() bool
type UserManager ¶
type UserManager struct { ExecutionContext *execution_context.Context AuthorizationContext *authorization_context.AuthorizationContext UserContext interfaces.UserContextAdapter }
func Get ¶
func Get() *UserManager
func New ¶
func New() *UserManager
func (*UserManager) AddUser ¶
func (um *UserManager) AddUser(user models.User) *UserManagerError
func (*UserManager) GenerateUserEmailVerificationToken ¶ added in v0.0.8
func (um *UserManager) GenerateUserEmailVerificationToken(user models.User) string
func (*UserManager) GenerateUserOtpCode ¶ added in v0.0.19
func (um *UserManager) GenerateUserOtpCode(user models.User) string
func (*UserManager) GetCurrentRecoveryToken ¶
func (um *UserManager) GetCurrentRecoveryToken(userId string) (*string, *UserManagerError)
func (*UserManager) GetUser ¶ added in v0.0.22
func (um *UserManager) GetUser(id string) *models.User
func (*UserManager) GetUserByEmail ¶
func (um *UserManager) GetUserByEmail(email string) *models.User
func (*UserManager) GetUserById ¶
func (um *UserManager) GetUserById(id string) *models.User
func (*UserManager) GetUserByUsername ¶
func (um *UserManager) GetUserByUsername(username string) *models.User
func (*UserManager) GetUserClaimsById ¶
func (um *UserManager) GetUserClaimsById(id string) []models.UserClaim
func (*UserManager) GetUserRefreshToken ¶
func (um *UserManager) GetUserRefreshToken(id string) *string
func (*UserManager) GetUserRolesById ¶
func (um *UserManager) GetUserRolesById(id string) []models.UserRole
func (*UserManager) RemoveUser ¶
func (um *UserManager) RemoveUser(id string) bool
func (*UserManager) SetEmailVerificationState ¶
func (um *UserManager) SetEmailVerificationState(userID string, state bool) *UserManagerError
func (*UserManager) UpdateEmailVerificationToken ¶
func (um *UserManager) UpdateEmailVerificationToken(userID string) (*models.User, *UserManagerError)
func (*UserManager) UpdatePassword ¶
func (um *UserManager) UpdatePassword(userId string, password string) *UserManagerError
func (*UserManager) UpdateRecoveryToken ¶
func (um *UserManager) UpdateRecoveryToken(userID string) (*models.User, *UserManagerError)
func (*UserManager) UpdateUserRefreshToken ¶
func (um *UserManager) UpdateUserRefreshToken(id string, token string) bool
func (*UserManager) UpsertUser ¶
func (um *UserManager) UpsertUser(user models.User) error
func (*UserManager) UpsertUserClaims ¶
func (um *UserManager) UpsertUserClaims(user models.User) error
func (*UserManager) UpsertUserRoles ¶
func (um *UserManager) UpsertUserRoles(user models.User) error
func (*UserManager) ValidateEmailVerificationToken ¶
func (um *UserManager) ValidateEmailVerificationToken(userID string, token string, scope string) *UserManagerError
func (*UserManager) ValidatePassword ¶
func (um *UserManager) ValidatePassword(password string) PasswordValidationResult
func (*UserManager) ValidateRecoveryToken ¶
func (um *UserManager) ValidateRecoveryToken(userId string, token string, scope string, cleanup bool) *UserManagerError
type UserManagerError ¶
type UserManagerError struct { Error UserManagerErrorType `json:"error"` InnerErrors []error `json:"inner_error,omitempty"` // contains filtered or unexported fields }
func NewUserManagerError ¶
func NewUserManagerError(err UserManagerErrorType, innerErrors ...error) UserManagerError
func (UserManagerError) Log ¶
func (uError UserManagerError) Log()
func (UserManagerError) String ¶
func (uError UserManagerError) String() string
type UserManagerErrorType ¶
type UserManagerErrorType int64
UserManagerErrorType Enum
const ( DatabaseError UserManagerErrorType = iota UserAlreadyExistsError InvalidModelError InvalidTokenError InvalidKeyError PasswordValidationError EmailValidationError UnknownError )
func (UserManagerErrorType) FromString ¶
func (UserManagerErrorType UserManagerErrorType) FromString(keyType string) UserManagerErrorType
func (UserManagerErrorType) String ¶
func (UserManagerErrorType UserManagerErrorType) String() string
Click to show internal directories.
Click to hide internal directories.