Documentation ¶
Index ¶
- Constants
- func NewAuthRouter(cookieName string, loginURL string, logoutURL, verifyURL string, ...) (http.Handler, error)
- func RegistrateCustomVldtrs() (*validator.Validate, ut.Translator, error)
- func RegistrateVldtrs(validatorsList map[string]validatorCfg) (*validator.Validate, ut.Translator, error)
- func SessionValidator() func(fl validator.FieldLevel) bool
- func TokenValidator() func(fl validator.FieldLevel) bool
- type AuthMW
- type AuthUser
- type AuthUserService
- type ErrorResponse
- type ErrorValidationResponse
- type LoginRequest
- type ProcessLoginData
- type ValidationError
- type VerifyRequest
- type VerifyResponse
Constants ¶
View Source
const ( CstmSessionValidatorKey = "custom_session_format" CstmTokenValidatorKey = "custom_token_format" DfltEmailKey = "email" DfltRequiredKey = "required" )
View Source
const (
SesKeyLogin string = "login"
)
Variables ¶
This section is empty.
Functions ¶
func NewAuthRouter ¶
func NewAuthRouter( cookieName string, loginURL string, logoutURL, verifyURL string, resendURL string, sservice session.Service, tservice token.Service, aus AuthUserService, cc session.CookieConf, sc session.Conf, logger logr.Logger, resendAttempts int, resendTimeout time.Duration, ) (http.Handler, error)
func RegistrateCustomVldtrs ¶
func RegistrateCustomVldtrs() (*validator.Validate, ut.Translator, error)
func RegistrateVldtrs ¶
func RegistrateVldtrs(validatorsList map[string]validatorCfg) (*validator.Validate, ut.Translator, error)
func SessionValidator ¶
func SessionValidator() func(fl validator.FieldLevel) bool
func TokenValidator ¶
func TokenValidator() func(fl validator.FieldLevel) bool
Types ¶
type AuthMW ¶
type AuthUserService ¶
type ErrorResponse ¶
type ErrorValidationResponse ¶
type ErrorValidationResponse struct { Code int `json:"code"` Message string `json:"message"` Description string `json:"description"` Details []ValidationError `json:"details"` }
type LoginRequest ¶
type LoginRequest struct {
Login string `json:"login" validate:"required,email"`
}
type ProcessLoginData ¶
type ValidationError ¶
type VerifyRequest ¶
type VerifyRequest struct {
Token string `json:"token" validate:"required,custom_token_format"`
}
type VerifyResponse ¶
Click to show internal directories.
Click to hide internal directories.