Skip to content

feat: Add inbound bypass paths for public endpoints#133

Merged
mrsabath merged 2 commits into
rossoctl:mainfrom
huang195:feat/bypass-inbound-paths
Feb 20, 2026
Merged

feat: Add inbound bypass paths for public endpoints#133
mrsabath merged 2 commits into
rossoctl:mainfrom
huang195:feat/bypass-inbound-paths

Conversation

@huang195

Copy link
Copy Markdown
Member

Summary

Closes #124

AuthBridge's ext-proc now skips inbound JWT validation for configurable path patterns, allowing agents and tools to expose public endpoints without requiring OAuth.

  • Default bypass paths are built into the go-processor: /.well-known/*, /healthz, /readyz, /livez. These work out of the box with no configuration needed.
  • Override via env var: Set BYPASS_INBOUND_PATHS to a comma-separated list of path patterns to replace the defaults entirely (e.g., BYPASS_INBOUND_PATHS=/.well-known/*,/metrics).
  • Patterns use Go's path.Match glob syntax: * matches any sequence of non-/ characters, so /.well-known/* matches /.well-known/agent.json but not /.well-known/a/b.
  • Query strings are stripped before matching.

Files changed

  • AuthBridge/AuthProxy/go-processor/main.go — bypass path matching logic, default patterns, env var override parsing, bypass check in handleInbound()
  • AuthBridge/AuthProxy/go-processor/main_test.go — unit tests for pattern matching and default behavior

How it works

  1. On startup, the go-processor initializes bypassInboundPaths with the built-in defaults.
  2. If BYPASS_INBOUND_PATHS is set, the defaults are replaced with the env var values.
  3. On each inbound request, the :path pseudo-header is checked against the bypass list before JWT validation. If matched, the request is forwarded without authentication.

Example: override defaults

To disable all bypasses:

BYPASS_INBOUND_PATHS=""

To add a custom set:

BYPASS_INBOUND_PATHS="/.well-known/*,/healthz,/metrics,/custom-public"

Test plan

  • go build ./... passes
  • go test ./... — 13 unit tests pass (exact match, glob match, query string, empty list, defaults)
  • make test in kagenti-webhook passes
  • Cluster test: GET /.well-known/agent.json from another pod returns 200 without auth
  • Cluster test: GET /healthz from another pod bypasses (404 from app, not 401)
  • Cluster test: GET /, /api/data, /v1/tasks from another pod all return 401

🤖 Generated with Claude Code

AuthBridge's ext-proc now skips JWT validation for configurable path
patterns. Sensible defaults are built in: /.well-known/*, /healthz,
/readyz, /livez. This allows agents and tools to expose public
endpoints (e.g., Agent Card discovery at /.well-known/agent.json)
without requiring OAuth.

Defaults can be overridden by setting the BYPASS_INBOUND_PATHS
environment variable to a comma-separated list of path patterns
using Go's path.Match glob syntax. Setting the env var replaces
the defaults entirely.

Closes rossoctl#124

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds configurable path bypass functionality to AuthBridge's go-processor, allowing specific endpoints to skip inbound JWT validation for public access. This addresses issue #124 by enabling agents and tools to expose public endpoints like AgentCard discovery and health checks without OAuth requirements.

Changes:

  • Added bypass path matching with default patterns for common public endpoints (/.well-known/*, /healthz, /readyz, /livez)
  • Implemented BYPASS_INBOUND_PATHS environment variable for custom configuration with comma-separated glob patterns
  • Integrated bypass logic into the inbound authentication flow to skip JWT validation for matched paths

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
AuthBridge/AuthProxy/go-processor/main.go Adds matchBypassPath function, default bypass patterns, env var parsing, and bypass check in handleInbound before JWT validation
AuthBridge/AuthProxy/go-processor/main_test.go Adds comprehensive unit tests for pattern matching including exact matches, globs, query strings, empty lists, and default behaviors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AuthBridge/AuthProxy/go-processor/main.go Outdated
Comment thread AuthBridge/AuthProxy/go-processor/main.go Outdated
Comment thread AuthBridge/AuthProxy/go-processor/main_test.go
Comment thread AuthBridge/AuthProxy/go-processor/main.go
Comment thread AuthBridge/AuthProxy/go-processor/main_test.go
Address review feedback:
- Normalize request paths with path.Clean before matching to prevent
  bypass via non-canonical forms (//healthz, /./healthz, /../x)
- Log invalid patterns in matchBypassPath instead of silently skipping
- Validate patterns at startup when parsing BYPASS_INBOUND_PATHS and
  reject malformed entries with a log message
- Add tests for malformed patterns and non-normalized paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
@huang195
huang195 force-pushed the feat/bypass-inbound-paths branch from 0c4b162 to 8c7f6f5 Compare February 20, 2026 21:41

@mrsabath mrsabath left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mrsabath
mrsabath merged commit 5539567 into rossoctl:main Feb 20, 2026
3 checks passed
@huang195
huang195 deleted the feat/bypass-inbound-paths branch May 20, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: AuthBridge should have options to NOT validate on selected routes

3 participants