Documentation
¶
Index ¶
- func CheckCredentials() func(username, password string) (db.User, string, error)
- func CheckToken(restrictedTo db.UserType) func(c *fiber.Ctx) error
- func GetClaimsFromAccessToken(bearerStr string) (jwt.MapClaims, error)
- func HashPW(password string) (string, error)
- func InitAuth() error
- func RefreshAccessToken(token string) (string, error)
- type Auth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCredentials ¶
Helper to generate a refresh JWT token on login
func CheckToken ¶
Middleware that checks if the user is authenticated and authorized under under given restriction
func GetClaimsFromAccessToken ¶
expects a bearer string with a jwt token signed by our jwt access key if successful the claims of said token are returned
func RefreshAccessToken ¶
takes a refresh token as parameter and returns a new access token
Types ¶
type Auth ¶
type Auth struct {
JWTAccessKeypair *rsa.PrivateKey
JWTRefreshKeypair *rsa.PrivateKey
}
Click to show internal directories.
Click to hide internal directories.