Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { }
func (*Auth) CreateToken ¶
CreateToken generates a signed JWT string based on user info.
func (*Auth) ReadAndSetKeys ¶
func (a *Auth) ReadAndSetKeys()
ReadAndSetKeys will read public and private RSA keys and create a key for signing JWTs.
func (*Auth) UserIsInRole ¶
UserIsInRole accepts a list of roles and determines whether a user's role in a JWT is in that list.
func (*Auth) UserIsLoggedIn ¶
func (a *Auth) UserIsLoggedIn() gin.HandlerFunc
UserIsLoggedIn will read the JWT in the request header and verify that it is legitimate.
Click to show internal directories.
Click to hide internal directories.