Documentation
¶
Index ¶
- Variables
- type NativeScheme
- func (s NativeScheme) AppLogin(appName string) (auth.Token, error)
- func (s NativeScheme) Auth(token string) (auth.Token, error)
- func (s NativeScheme) ChangePassword(token auth.Token, oldPassword string, newPassword string) error
- func (s NativeScheme) Create(user *auth.User) (*auth.User, error)
- func (s NativeScheme) Info() (auth.SchemeInfo, error)
- func (s NativeScheme) Login(params map[string]string) (auth.Token, error)
- func (s NativeScheme) Logout(token string) error
- func (s NativeScheme) Name() string
- func (s NativeScheme) Remove(token auth.Token) error
- func (s NativeScheme) ResetPassword(user *auth.User, resetToken string) error
- func (s NativeScheme) StartPasswordReset(user *auth.User) error
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingPasswordError = &tsuruErrors.ValidationError{Message: "You must provide a password to login"} ErrMissingEmailError = &tsuruErrors.ValidationError{Message: "You must provide a email to login"} ErrInvalidEmail = &tsuruErrors.ValidationError{Message: "Invalid email."} ErrInvalidPassword = &tsuruErrors.ValidationError{Message: "Password length should be least 6 characters and at most 50 characters."} ErrEmailRegistered = &tsuruErrors.ConflictError{Message: "This email is already registered."} ErrPasswordMismatch = &tsuruErrors.NotAuthorizedError{Message: "The given password didn't match the user's current password."} )
Functions ¶
This section is empty.
Types ¶
type NativeScheme ¶
type NativeScheme struct{}
func (NativeScheme) ChangePassword ¶
func (NativeScheme) Info ¶
func (s NativeScheme) Info() (auth.SchemeInfo, error)
func (NativeScheme) Logout ¶
func (s NativeScheme) Logout(token string) error
func (NativeScheme) Name ¶
func (s NativeScheme) Name() string
func (NativeScheme) ResetPassword ¶
func (s NativeScheme) ResetPassword(user *auth.User, resetToken string) error
ResetPassword actually resets the password of the user. It needs the token string. The new password will be a random string, that will be then sent to the user email.
func (NativeScheme) StartPasswordReset ¶
func (s NativeScheme) StartPasswordReset(user *auth.User) error
type Token ¶
type Token struct { Token string `json:"token"` Creation time.Time `json:"creation"` Expires time.Duration `json:"expires"` UserEmail string `json:"email"` AppName string `json:"app"` }
func (*Token) GetAppName ¶
func (*Token) GetUserName ¶
func (*Token) IsAppToken ¶
Click to show internal directories.
Click to hide internal directories.