routes

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContextClient

func FromContextClient(ctx context.Context) *http.Client

func GetHostName

func GetHostName(r *http.Request) string

func NewAuthorizationTransport

func NewAuthorizationTransport(tokenType, token string, transport http.RoundTripper) http.RoundTripper

func NewClient

func NewClient(ctx context.Context) *http.Client

func NewContextClient

func NewContextClient(ctx context.Context, client *http.Client) context.Context

func NewDumpTransport

func NewDumpTransport(ctx context.Context, transport http.RoundTripper) http.RoundTripper

func Token

func Token(ctx context.Context, tokenKey string, oidcConf config.Oidc, session *sessions.Session) (string, bool, error)

func UnAuthorizedResponse

func UnAuthorizedResponse(w http.ResponseWriter, location string)

Types

type AuthorizationTransaport

type AuthorizationTransaport struct {
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

func (*AuthorizationTransaport) RoundTrip

func (a *AuthorizationTransaport) RoundTrip(r *http.Request) (*http.Response, error)

type DumpTransport

type DumpTransport struct {
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

func (*DumpTransport) RoundTrip

func (t *DumpTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Handler

type Handler interface {
	http.Handler
	Login(pattern string)
	Callback(pattern string)
	Logout(pattern string)
	Proxy(pattern string, targetURL *url.URL, host, typ, tokenKey string, isProxySslVerify bool)
}

func New

func New(configuration config.GetConfiguration) (Handler, error)

type MultiHost

type MultiHost map[string]Handler

func (MultiHost) ServeHTTP

func (m MultiHost) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RoundTrip

type RoundTrip func(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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