Documentation ¶
Index ¶
- func AreCredentialsValid(username, password string, dbClient database.Client) (bool, error)
- func CreateJWTToken(username, JWTKey string) (string, error)
- func ExtractCredentialsFromHeader(basicAuthHeader string) (string, string, error)
- func ExtractTokenFromHeader(jwtAuthHeader string) (string, error)
- func IsTokenValid(token, JWTKey string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreCredentialsValid ¶
AreCredentialsValid validates user credentials checking users from the database
func CreateJWTToken ¶
CreateJWTToken function creates a JWT token using username and JWT secret
func ExtractCredentialsFromHeader ¶
ExtractCredentialsFromHeader provides username, password provided in the Basic Auth header and eventually an error
func ExtractTokenFromHeader ¶
ExtractTokenFromHeader provides token provided in the JWT Auth header and eventually an error
func IsTokenValid ¶
IsTokenValid function validates JWT token checking the signature and expiration time
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.