proxy

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 14 Imported by: 0

README

Auth Proxy

Getting Started

This application is based on Caddy Server.

The only system requirement for running this application is Docker. Once the source is cloned, all you have to do to get it running is:

  1. Copy local-example.env to local.env and update values as described in the file. Secrets may be provided by another team member via Signal or other secure communication tool.
  2. Run make

At this point you'll have a running instance of this application available at http://localhost:53060.

Documentation

Index

Constants

View Source
const (
	CaddyVarUpstream    = "upstream"
	CaddyVarRedirectURL = "redirect_url"
)
View Source
const CookieFlag = "cf"

CookieFlag is a query string flag to indicate a cookie has been requested. It remains set until the requested cookie has been verified. This is required to support user agents that do not allow cookies.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthSites

type AuthSites map[string]string

func (*AuthSites) Decode

func (a *AuthSites) Decode(input string) error

type Error

type Error struct {
	// Message contains a message that is safe for display to the end user
	Message string

	// Status is the http status code for the response
	Status int
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

type Proxy

type Proxy struct {
	Host          string    `required:"true"`
	TokenSecret   string    `required:"true" split_words:"true"`
	Sites         AuthSites `required:"true" split_words:"true"`
	ManagementAPI string    `required:"true" split_words:"true"`

	// optional params
	CookieName       string `default:"_auth_proxy" split_words:"true"`
	ReturnToParam    string `default:"returnTo" split_words:"true"`
	RobotsTxtDisable bool   `default:"false" split_words:"true"`
	TokenParam       string `default:"token" split_words:"true"`
	TokenPath        string `default:"/auth/token" split_words:"true"`

	// Secret is the binary token secret. Must be exported to be valid after being passed back from Caddy.
	Secret []byte `ignored:"true"`
	// contains filtered or unexported fields
}

func (Proxy) CaddyModule

func (Proxy) CaddyModule() caddy.ModuleInfo

func (*Proxy) Provision

func (p *Proxy) Provision(ctx caddy.Context) error

func (Proxy) ServeHTTP

func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

type ProxyClaim

type ProxyClaim struct {
	Level   string `json:"level"`
	IsValid bool
	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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