Documentation ¶
Index ¶
Constants ¶
View Source
const (
ConfigKey key = iota
)
RSA keys
Variables ¶
View Source
var SignKey []byte
SignKey key is use to sign jwt with rsa
Functions ¶
func Authenticate ¶
Authenticate middleware to check if a request it Authenticated
func CompareHash ¶
CompareHash compares users provided password with the hash
func GenerateJWTTokken ¶
GenerateJWTTokken generates a jwt web token with username as claim, and the user uuid TODO add more claims , roles claims
func HashPassword ¶
HashPassword creates a hash of a password
Types ¶
type JwtClaims ¶
type JwtClaims struct { Name string `json:"name"` jwt.StandardClaims }
Click to show internal directories.
Click to hide internal directories.