authentication

package
v0.0.0-...-c5d597e Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExpirationKey = "exp"
	UserIDKey     = "uid"
	IssuerKey     = "iss"
)

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(h http.Handler) http.Handler

AuthMiddleware provides a middleware that retrieves the authentication header from the request and inject into the context

func GetAuthFromContext

func GetAuthFromContext(ctx context.Context) (string, error)

GetAuthFromContext retrieves the Authorization from context

Types

type AuthData

type AuthData struct {
	Expiration int64
	Issuer     string
	UserID     uint64
}

func ParseAuthData

func ParseAuthData(ctx context.Context) (AuthData, error)

type ContextKey

type ContextKey string

Jump to

Keyboard shortcuts

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