lib

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 40 Imported by: 10

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 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
	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
}

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