lib

package
v1.20.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 36 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPoliciesOrDefault

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

Types

type Options

type Options struct {
	Next              http.Handler
	Policy            *policy.ParsedConfig
	Target            string
	CookieDomain      string
	CookieName        string
	BasePrefix        string
	WebmasterEmail    string
	RedirectDomains   []string
	PrivateKey        ed25519.PrivateKey
	CookieExpiration  time.Duration
	StripBasePrefix   bool
	OpenGraph         config.OpenGraph
	CookiePartitioned bool
	ServeRobotsTXT    bool
}

type Server

type Server struct {
	DNSBLCache *decaymap.Impl[string, dnsbl.DroneBLResponse]
	OGTags     *ogtags.OGTagCache
	// contains filtered or unexported fields
}

func New

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

func (*Server) CleanupDecayMap added in v1.16.0

func (s *Server) CleanupDecayMap()

func (*Server) ClearCookie

func (s *Server) ClearCookie(w http.ResponseWriter, name, path string)

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, 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, name, value, path string)

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
metarefresh
templ: version: v0.3.898
templ: version: v0.3.898
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.

Jump to

Keyboard shortcuts

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