handlers

package
v0.0.0-...-c7b5264 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheCreator

type CacheCreator (func(r *http.Request) http.Handler)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	whiteListPaths []string,
	whiteList http.Handler,
	other http.Handler,
) *Controller

func (*Controller) ServeHTTP

func (c *Controller) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(
	skipSSLValidation bool,
	domains []string,
	f TokenFetcher,
	cacheCreator func(func(r *http.Request) http.Handler) *cache.Cache,
	a TokenAnalyzer,
	log *log.Logger,
) *Proxy

func (*Proxy) CurrentToken

func (p *Proxy) CurrentToken() string

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ReverseProxy

type ReverseProxy struct {
	// contains filtered or unexported fields
}

func NewReverseProxy

func NewReverseProxy(h http.Handler, v Validator) *ReverseProxy

func (*ReverseProxy) ServeHTTP

func (p *ReverseProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TokenAnalyzer

type TokenAnalyzer interface {
	Analyze(token string) (expired bool)
}

type TokenAnalyzerFunc

type TokenAnalyzerFunc func(token string) bool

func (TokenAnalyzerFunc) Analyze

func (f TokenAnalyzerFunc) Analyze(token string) bool

type TokenFetcher

type TokenFetcher interface {
	Token() string
}

type TokenFetcherFunc

type TokenFetcherFunc func() string

func (TokenFetcherFunc) Token

func (f TokenFetcherFunc) Token() string

type Validator

type Validator interface {
	Validate(token string) bool
}

Jump to

Keyboard shortcuts

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