jwt

package
v0.0.0-...-d370aa6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2016 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Bearer is a prefix of JWT header value
	Bearer = "Bearer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	AuthHeader string `long:"auth_token_header" default:"X-Elfire-Token" description:"Header field to store auth token"`
	AuthCookie string `long:"auth_token_cookie" default:"elfire_sso_token" description:"Cookie name to store auth token"`
}

Flags is a package flags sample in form ready for use with github.com/jessevdk/go-flags

type Middleware

type Middleware struct {
	Log    *log.Logger
	Config *Flags
	Token  *jwtutil.App
	Field  string // Context field for Profile data
}

Middleware is a struct that has a ServeHTTP method

func New

func New(logger *log.Logger, cfg *Flags, token *jwtutil.App, field string) *Middleware

func (*Middleware) ServeHTTP

func (mw *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

ServeHTTP is the middleware handler

Jump to

Keyboard shortcuts

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