auth

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrClaims indicates the JWT is did not have the expected claims.
	ErrClaims = errors.New("the JWT did not have the expected claims")

	// ErrInvalidJWT indicates the JWT is invalid.
	ErrInvalidJWT = errors.New("the JWT is invalid")
)

Functions

This section is empty.

Types

type JWTHandler

type JWTHandler func(jwtB64 string) (principal *models.Principal, err error)

JWTHandler is a function signature that takes in a Base64 encoded JWT and returns the auth principal from it.

func HandleJWT

func HandleJWT(ctx context.Context, client *http.Client, jwksURL string, logger *zap.SugaredLogger, sleep time.Duration) (authHandler JWTHandler, err error)

HandleJWT creates a JWT auth handler via a closure.

TODO Add logging. Error is returned to user. Log error. Generic thing back to user.

Jump to

Keyboard shortcuts

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