bypass

package
v0.0.0-...-4ef879c Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bypass provides path pattern matching for skipping JWT validation on public endpoints (e.g., health probes, agent card discovery).

Index

Constants

This section is empty.

Variables

View Source
var DefaultPatterns = []string{"/.well-known/*", "/healthz", "/readyz", "/livez", "/metrics"}

DefaultPatterns are paths that skip inbound JWT validation by default.

Functions

This section is empty.

Types

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher checks request paths against a set of bypass patterns. Patterns use Go's path.Match syntax (e.g., "/.well-known/*"). Note: path.Match's "*" does NOT cross "/" separators, so "/.well-known/*" matches "/.well-known/agent.json" but NOT "/.well-known/foo/bar".

func NewMatcher

func NewMatcher(patterns []string) (*Matcher, error)

NewMatcher creates a Matcher from the given patterns. Returns an error if any pattern has invalid path.Match syntax.

func (*Matcher) Match

func (m *Matcher) Match(requestPath string) bool

Match checks if the given request path matches any bypass pattern. Query strings are stripped and the path is normalized via path.Clean to prevent bypass via non-canonical forms (e.g., //healthz, /./healthz).

Jump to

Keyboard shortcuts

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