Skip to content

refactor(network): consolidate proxy egress pipeline#2373

Draft
johntmyers wants to merge 13 commits into
mainfrom
refactor/proxy-egress-pipeline
Draft

refactor(network): consolidate proxy egress pipeline#2373
johntmyers wants to merge 13 commits into
mainfrom
refactor/proxy-egress-pipeline

Conversation

@johntmyers

@johntmyers johntmyers commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactor sandbox proxy egress so CONNECT and forward-proxy traffic share explicit destination authorization and relay primitives while preserving the existing user-facing network behavior. This establishes the RFC #2155 foundation without introducing the later DNS or arbitrary TCP features, and keeps the shared path compatible with the middleware framework from #2027.

Related Issue

Related design: #2155
Related middleware implementation: #2027

Changes

  • Introduce a shared egress pipeline with explicit destination intent, authorization, endpoint decisions, and relay preparation.
  • Route CONNECT and non-CONNECT traffic through common HTTP, raw-stream, credential, and policy-generation boundaries.
  • Preserve metadata-service handling, inference routing, credential injection, HTTP upgrades, raw relay, and current denial behavior.
  • Pin relays to policy generations and close stale HTTP, upgraded, long-lived, and raw streams after policy activation changes.
  • Reject overlapping endpoint selectors when connection or request-processing metadata is ambiguous.
  • Configure rejected policy generation posture with [openshell.gateway] policy_validation_failure_mode in gateway.toml; default to fail_closed and allow the explicit retain_last_valid availability mode.
  • Propagate the gateway TOML posture to sandbox supervisors as part of the effective config revision; individual sandboxes cannot override it.
  • Emit OCSF configuration, finding, and denial rationale for validation failures and quarantine state.
  • Add compatibility baselines, middleware coverage, ambiguity/recovery coverage, and shared-path E2E tests.
  • Update gateway, Helm, architecture, and policy documentation for the new invariants and operator-visible failure posture.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)
  • Live Docker gateway proxy E2E target: 10 passed
  • cargo test -p openshell-core -p openshell-server -p openshell-sandbox
  • mise run helm:lint
  • mise run helm:test (64 passed)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
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.

1 participant