Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireTokenAuthentication ¶
func RequireTokenAuthentication( rw http.ResponseWriter, req *http.Request, next http.HandlerFunc)
RequireTokenAuthentication is middleware to protect endpoints from unauthorized access.
Types ¶
type JWTAuthenticationBackend ¶
type JWTAuthenticationBackend struct { PublicKey *rsa.PublicKey // contains filtered or unexported fields }
A JWTAuthenticationBackend does stuff
func InitJWTAuthenticationBackend ¶
func InitJWTAuthenticationBackend() *JWTAuthenticationBackend
InitJWTAuthenticationBackend is a very long and non-descriptive name
func (*JWTAuthenticationBackend) Authenticate ¶
func (backend *JWTAuthenticationBackend) Authenticate(user *models.User) bool
Authenticate user
func (*JWTAuthenticationBackend) GenerateToken ¶
func (backend *JWTAuthenticationBackend) GenerateToken( userUUID string) (string, error)
GenerateToken will generate a token, obviously.
Click to show internal directories.
Click to hide internal directories.