bypass

package
v0.0.0-...-53bd38a Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 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 reports whether requestPath, a decoded path with no query, is a canonical path that matches a pattern as written. The app gets the path as sent and may route any other form elsewhere, so a dot segment, a doubled slash, or a ';', '\', '%' or '?' never matches, and a path with a trailing slash matches only a pattern that ends in one.

Jump to

Keyboard shortcuts

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