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 ¶
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 ¶
NewMatcher creates a Matcher from the given patterns. Returns an error if any pattern has invalid path.Match syntax.
func (*Matcher) Match ¶
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.