lib

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 44 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

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) (*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
	CookieSameSite       http.SameSite
	Logger               *slog.Logger
	PublicUrl            string
	JWTRestrictionHeader string
	DifficultyInJWT      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
metarefresh
templ: version: v0.3.924
templ: version: v0.3.924
preact
templ: version: v0.3.924
templ: version: v0.3.924
proofofwork
templ: version: v0.3.924
templ: version: v0.3.924
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