authentication

package
v0.0.0-...-8a0c629 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL