bypass

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBypassPath

func AddBypassPath(path string) error

AddBypassPath adds an exact path to the list of paths that bypass middleware. Paths can include wildcards, such as /api/*. Paths are matched using path.Match. Returns an error if the path has invalid pattern.

func GetList

func GetList() []string

GetList returns a list of all bypass paths.

func RemovePath

func RemovePath(path string)

RemovePath removes a path from the list of paths that bypass middleware.

func ShouldBypass

func ShouldBypass(requestPath string, h http.Handler, w http.ResponseWriter, r *http.Request) bool

ShouldBypass checks if the request path is one of the auth bypass paths and returns true if the middleware should be bypassed. This can be used to bypass authz/authn middlewares for certain paths, such as webhooks that implement their own authentication.

Types

This section is empty.

Jump to

Keyboard shortcuts

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