egress: preserve_auth flag for per-route Authorization passthrough #453

Merged
didericis merged 1 commits from egress-preserve-auth-for-registry-routes into main 2026-07-21 15:02:02 -04:00
Collaborator

Closes #392.

Summary

  • Adds a preserve_auth: true boolean field to egress route entries. When set, the gateway skips its normal Authorization header strip for that host, allowing the agent's own bearer token to reach the upstream.
  • Intended for registry endpoints like Docker Hub (registry-1.docker.io) and GHCR (ghcr.io), where the agent must supply a client-fetched per-scope token the gateway cannot inject itself.
  • Threaded through ManifestEgressRouteEgressRouteRoute, serialized in route_to_yaml_dict, and parsed in parse_routes in the addon core.
  • The auth strip in egress_addon.py now checks route.preserve_auth before popping the header.
  • Default is false; no existing behavior changes.

Usage

In a bottle manifest:

egress:
  routes:
    - host: registry-1.docker.io
      preserve_auth: true
    - host: ghcr.io
      preserve_auth: true
Closes #392. ## Summary - Adds a `preserve_auth: true` boolean field to egress route entries. When set, the gateway skips its normal Authorization header strip for that host, allowing the agent's own bearer token to reach the upstream. - Intended for registry endpoints like Docker Hub (`registry-1.docker.io`) and GHCR (`ghcr.io`), where the agent must supply a client-fetched per-scope token the gateway cannot inject itself. - Threaded through `ManifestEgressRoute` → `EgressRoute` → `Route`, serialized in `route_to_yaml_dict`, and parsed in `parse_routes` in the addon core. - The auth strip in `egress_addon.py` now checks `route.preserve_auth` before popping the header. - Default is `false`; no existing behavior changes. ## Usage In a bottle manifest: ```yaml egress: routes: - host: registry-1.docker.io preserve_auth: true - host: ghcr.io preserve_auth: true ```
didericis-claude added 1 commit 2026-07-21 14:10:06 -04:00
feat(egress): add preserve_auth flag to pass agent Authorization through
tracker-policy-pr / check-pr (pull_request) Successful in 6s
test / integration-docker (pull_request) Successful in 13s
test / unit (pull_request) Successful in 35s
lint / lint (push) Successful in 2m28s
test / integration-firecracker (pull_request) Successful in 3m34s
test / coverage (pull_request) Successful in 16s
test / publish-infra (pull_request) Has been skipped
b1ef83ac84
Adds a per-route boolean field preserve_auth (default false) that skips
the gateway's Authorization header stripping for that host. Intended for
registry endpoints like Docker Hub (registry-1.docker.io) and GHCR
(ghcr.io) where the agent must supply its own per-scope bearer token.

Threaded through ManifestEgressRoute → EgressRoute → Route, serialized
in route_to_yaml_dict, and parsed in parse_routes. The strip at
egress_addon.py now checks route.preserve_auth before popping the header.

Closes #392
didericis merged commit ccd987a501 into main 2026-07-21 15:02:02 -04:00
didericis deleted branch egress-preserve-auth-for-registry-routes 2026-07-21 15:02:03 -04:00
Sign in to join this conversation.