lib

package
v1.17.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 31 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPoliciesOrDefault

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

Types

type Options

type Options struct {
	Next            http.Handler
	Policy          *policy.ParsedConfig
	RedirectDomains []string
	ServeRobotsTXT  bool
	PrivateKey      ed25519.PrivateKey

	CookieDomain      string
	CookieName        string
	CookiePartitioned bool

	OGPassthrough bool
	OGTimeToLive  time.Duration
	Target        string

	WebmasterEmail string
	BasePrefix     string
}

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)

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) TestError

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

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

Jump to

Keyboard shortcuts

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