auth

package
v0.0.0-...-646f264 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreCredentialsValid

func AreCredentialsValid(username, password string, dbClient database.Client) (bool, error)

AreCredentialsValid validates user credentials checking users from the database

func CreateJWTToken

func CreateJWTToken(username, JWTKey string) (string, error)

CreateJWTToken function creates a JWT token using username and JWT secret

func ExtractCredentialsFromHeader

func ExtractCredentialsFromHeader(basicAuthHeader string) (string, string, error)

ExtractCredentialsFromHeader provides username, password provided in the Basic Auth header and eventually an error

func ExtractTokenFromHeader

func ExtractTokenFromHeader(jwtAuthHeader string) (string, error)

ExtractTokenFromHeader provides token provided in the JWT Auth header and eventually an error

func IsTokenValid

func IsTokenValid(token, JWTKey string) (bool, error)

IsTokenValid function validates JWT token checking the signature and expiration time

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL