middleware

package
v0.0.0-...-7ba06b6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(h http.Handler, adapters ...Adapter) http.Handler

func FromAuthHeader

func FromAuthHeader(r *http.Request) (string, error)

FromAuthHeader is a "TokenExtractor" that takes a give request and extracts the JWT token from the Authorization header.

func Handler

func Handler(realm string, users []User) func(http.Handler) http.Handler

Handler enforces basic authenthication.

Types

type Adapter

type Adapter func(http.Handler) http.Handler

func CORSHandler

func CORSHandler() Adapter

CORSHandler allows http to be served adding necessary headers to response

func JwtHandler

func JwtHandler() Adapter

func Notify

func Notify() Adapter

type User

type User struct {
	Username string
	Password string
}

User is a set of username and password.

Jump to

Keyboard shortcuts

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