Documentation ¶
Index ¶
- func HasReachedFailedAttemptsLimit(limit int, timeout string) bool
- func IsJwtTokenValid(token string, ab backends.Authentication, secret []byte, exp int) bool
- func Login(requestUser *backends.User, ab backends.Authentication, secret []byte, exp int) (int, []byte)
- func Logout(req *http.Request, ab backends.Authentication, secret []byte, exp int) error
- func RefreshToken(requestUser *backends.User, ab backends.Authentication, secret []byte, exp int) []byte
- type FailedAttempts
- type JWTAuthenticationBackend
- func (backend *JWTAuthenticationBackend) Authenticate(user *backends.User) bool
- func (backend *JWTAuthenticationBackend) GenerateToken(userUUID, username string) (string, error)
- func (backend *JWTAuthenticationBackend) IsInBlacklist(token string) bool
- func (backend *JWTAuthenticationBackend) Logout(tokenString string) error
- type Token
- type TokenAuthentication
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasReachedFailedAttemptsLimit ¶ added in v0.11.2
func IsJwtTokenValid ¶ added in v0.11.2
func RefreshToken ¶
Types ¶
type FailedAttempts ¶ added in v0.11.2
var Attempts FailedAttempts
type JWTAuthenticationBackend ¶
type JWTAuthenticationBackend struct { SecretKey []byte JWTExpirationDelta int AuthBackend backends.Authentication }
func InitJWTAuthenticationBackend ¶
func InitJWTAuthenticationBackend(ab backends.Authentication, secret []byte, exp int) *JWTAuthenticationBackend
func (*JWTAuthenticationBackend) Authenticate ¶
func (backend *JWTAuthenticationBackend) Authenticate(user *backends.User) bool
func (*JWTAuthenticationBackend) GenerateToken ¶
func (backend *JWTAuthenticationBackend) GenerateToken(userUUID, username string) (string, error)
func (*JWTAuthenticationBackend) IsInBlacklist ¶
func (backend *JWTAuthenticationBackend) IsInBlacklist(token string) bool
func (*JWTAuthenticationBackend) Logout ¶
func (backend *JWTAuthenticationBackend) Logout(tokenString string) error
type TokenAuthentication ¶
type TokenAuthentication struct {
Token string `json:"token" form:"token"`
}
Click to show internal directories.
Click to hide internal directories.