Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyMiddleware ¶
type APIKeyMiddleware struct { Path string // contains filtered or unexported fields }
APIKeyMiddleware is a simplified shared secret authentication for api requests
func (*APIKeyMiddleware) Middleware ¶
func (akm *APIKeyMiddleware) Middleware(next http.Handler) http.Handler
Middleware function, which will be called for each api request
type Claims ¶
type Claims struct { Username string `json:"username"` jwt.StandardClaims }
Claims a struct that will be encoded to a JWT. We add jwt.StandardClaims as an embedded type, to provide fields like expiry time
type JWTAuthentication ¶
type JWTAuthentication struct { PublicKey *rsa.PublicKey // contains filtered or unexported fields }
JWTAuthentication ...
func InitJWTAuthentication ¶
func InitJWTAuthentication() *JWTAuthentication
InitJWTAuthentication method initialize the JWTAuthentication model
func (*JWTAuthentication) Authenticate ¶
func (backend *JWTAuthentication) Authenticate(user *models.UserAuthentication) bool
Authenticate method used to authenticate the users
func (*JWTAuthentication) GenerateToken ¶
GenerateToken method generates the User JWT Token
func (*JWTAuthentication) ValidateToken ¶
func (backend *JWTAuthentication) ValidateToken(token string) (int, bool)
ValidateToken ...
Click to show internal directories.
Click to hide internal directories.