lib

package
v1.28.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 53 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRedirect           = errors.New("invalid redirect")
	ErrRedirectDomainNotAllowed  = errors.New("redirect domain not allowed")
	ErrUnknownChallengeExtension = errors.New("unknown challenge extension")
)
View Source
var (
	ErrActualAnubisBug = errors.New("this is an actual bug in Anubis, please file an issue with the magic string 'taco bell'")
)

Functions

func LoadPoliciesOrDefault

func LoadPoliciesOrDefault(ctx context.Context, fname string, defaultDifficulty int, logLevel string, subrequestMode bool) (*policy.ParsedConfig, error)

Types

type CookieOpts added in v1.21.0

type CookieOpts struct {
	Value  string
	Host   string
	Path   string
	Name   string
	Expiry time.Duration
}

type Options

type Options struct {
	Next                      http.Handler
	Policy                    *policy.ParsedConfig
	Target                    string
	TargetHost                string
	TargetSNI                 string
	TargetInsecureSkipVerify  bool
	CookieDynamicDomain       bool
	CookieDomain              string
	CookieExpiration          time.Duration
	CookiePartitioned         bool
	BasePrefix                string
	WebmasterEmail            string
	RedirectDomains           []string
	ED25519PrivateKey         ed25519.PrivateKey
	HS512Secret               []byte
	StripBasePrefix           bool
	OpenGraph                 config.OpenGraph
	ServeRobotsTXT            bool
	CookieSecure              bool
	CookieHttpOnly            bool
	CookieSameSite            http.SameSite
	Logger                    *slog.Logger
	LogLevel                  string
	PublicUrl                 string
	JWTRestrictionHeader      string
	DifficultyInJWT           bool
	PreserveRefererQueryParam bool
}

type Server

type Server struct {
	OGTags *ogtags.OGTagCache
	// contains filtered or unexported fields
}

func New

func New(opts Options) (*Server, error)

func (*Server) ClearCookie

func (s *Server) ClearCookie(w http.ResponseWriter, cookieOpts CookieOpts)

func (*Server) MakeChallenge

func (s *Server) MakeChallenge(w http.ResponseWriter, r *http.Request)

func (*Server) PassChallenge

func (s *Server) PassChallenge(w http.ResponseWriter, r *http.Request)

func (*Server) RenderBench added in v1.16.0

func (s *Server) RenderBench(w http.ResponseWriter, r *http.Request)

func (*Server) RenderIndex

func (s *Server) RenderIndex(w http.ResponseWriter, r *http.Request, cr policy.CheckResult, rule *policy.Bot, returnHTTPStatusOnly bool)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) ServeHTTPNext added in v1.17.0

func (s *Server) ServeHTTPNext(w http.ResponseWriter, r *http.Request)

func (*Server) SetCookie added in v1.19.0

func (s *Server) SetCookie(w http.ResponseWriter, cookieOpts CookieOpts)

type UnixRoundTripper

type UnixRoundTripper struct {
	Transport *http.Transport
}

https://github.com/oauth2-proxy/oauth2-proxy/blob/master/pkg/upstream/http.go#L124

func (UnixRoundTripper) RoundTrip

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

set bare minimum stuff

Directories

Path Synopsis
challengepage
Package challengepage holds the parts of the challenge page that every JavaScript-driven challenge method needs.
Package challengepage holds the parts of the challenge page that every JavaScript-driven challenge method needs.
metarefresh
templ: version: v0.3.1020
templ: version: v0.3.1020
preact
templ: version: v0.3.1020
templ: version: v0.3.1020
proofofwork
templ: version: v0.3.1020
templ: version: v0.3.1020
wasm
templ: version: v0.3.1020
templ: version: v0.3.1020
checker
Package checker defines the Checker interface and a helper utility to avoid import cycles.
Package checker defines the Checker interface and a helper utility to avoid import cycles.
all
Package all is a meta-package that imports all store implementations.
Package all is a meta-package that imports all store implementations.

Jump to

Keyboard shortcuts

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