Documentation
¶
Overview ¶
internal/auth/auth.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = errors.New("bad request") ErrTokenMalformed = errors.New("malformed token") ErrTokenExpired = errors.New("token is expired or not valid yet") ErrTokenInvalid = errors.New("invalid token") ErrTokenClaimsInvalid = errors.New("invalid token claims") ErrInternalServer = errors.New("authorization error") ErrForbidden = errors.New("invalid api key") ErrUnexpectedSigningMethod = errors.New("unexpected token signing method") )
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash compares a plaintext password with a stored bcrypt hash
func GenerateJWT ¶
GenerateJWT creates a signed JWT string for a given userID
func HashPassword ¶
HashPassword generates a bcrypt hash for the given password
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.