upstream

package
Version: v0.0.0-...-6064aa9 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BackendName = "upstream"

BackendName name

Variables

This section is empty.

Functions

This section is empty.

Types

type Upstream

type Upstream struct {
	URL                *jsontypes.URL     `json:"url,omitempty"`
	Timeout            jsontypes.Duration `json:"timeout,omitempty"`
	InsecureSkipVerify bool               `json:"insecure_skip_verify,omitempty"`
	FollowRedirects    bool               `json:"follow_redirects,omitempty"`
	PassCookies        bool               `json:"pass_cookies,omitempty"`
	Match              *jsontypes.Regexp  `json:"match,omitempty"`

	Forward struct {
		URL     bool     `json:"url,omitempty"`
		Method  bool     `json:"method,omitempty"`
		IP      bool     `json:"ip,omitempty"`
		Headers []string `json:"headers,omitempty"`
	} `json:"forward"`
}

Upstream backend provides authentication against an upstream http server. If the upstream request returns a http 200 status code then the user is considered logged in.

func NewDriver

func NewDriver() *Upstream

NewDriver returns a new instance of Upstream with some defaults

func (Upstream) Authenticate

func (h Upstream) Authenticate(r *http.Request) (string, error)

Authenticate fulfils the backend interface

func (Upstream) Validate

func (h Upstream) Validate() error

Validate verifies that this module is functional with the given configuration

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL