Skip to content

feat(gateway): add local-domain service routing#1101

Merged
drew merged 19 commits into
mainfrom
feat/local-domain-gateway-proxy
May 13, 2026
Merged

feat(gateway): add local-domain service routing#1101
drew merged 19 commits into
mainfrom
feat/local-domain-gateway-proxy

Conversation

@pimlock
Copy link
Copy Markdown
Collaborator

@pimlock pimlock commented Apr 30, 2026

Summary

Adds the first pass of gateway-owned domain routing for sandbox-local HTTP and WebSocket services.

Related Issue

Linear: OS-153

Changes

  • Adds ExposeService API plumbing and persisted service_endpoint metadata for named sandbox endpoints.
  • Adds openshell service expose <sandbox> <service> --target-port <port> to create browser-facing endpoint URLs.
  • Adds host-first gateway routing for <sandbox>--<service>.<cluster>.<suffix> before normal gateway HTTP routes, so sandbox app paths like /auth are preserved.
  • Proxies HTTP requests to sandbox-local loopback ports through supervisor target-port relays.
  • Adds explicit WebSocket upgrade forwarding for domain-routed services.
  • Strips gateway/client auth credentials before forwarding requests into sandbox apps.
  • Adds local-domain gateway config, cert SAN/deployment wiring, and docs for service exposure, gateway proxying, and browser certificates.
  • Preserves gateway TLS/plaintext and domain routing values during fast deploy.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Targeted checks run during the spike:

  • cargo fmt --all
  • cargo check -p openshell-bootstrap -p openshell-server -p openshell-cli
  • cargo check -p openshell-cli
  • helm lint deploy/helm/openshell
  • cargo test -p openshell-cli gateway_proxy --lib
  • cargo test -p openshell-cli service_url_for_gateway --lib
  • cargo test -p openshell-server local_domain --lib
  • bash -n tasks/scripts/cluster-deploy-fast.sh

Still required before merge:

  • Full mise run pre-commit
  • Full mise run test or equivalent CI suite
  • E2E coverage for local gateway HTTP routing
  • E2E coverage for local gateway WebSocket routing
  • E2E coverage for auth header/cookie stripping
  • E2E coverage for target-port relay through the sandbox network namespace
  • E2E coverage for gateway proxy if remote proxy remains in scope

Checklist

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

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 30, 2026

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

github-actions Bot commented May 1, 2026

@pimlock pimlock added the test:e2e Requires end-to-end coverage label May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Label test:e2e applied, but pull-request/1101 is at {"messa while the PR head is bb1ef60. A maintainer needs to comment /ok to test bb1ef6055f96af573b821024b6da27a7aec614d7 to refresh the mirror. Once the mirror catches up, re-run Branch E2E Checks from the Actions tab.

@pimlock
Copy link
Copy Markdown
Collaborator Author

pimlock commented May 1, 2026

/ok to test bb1ef60

@pimlock pimlock removed the test:e2e Requires end-to-end coverage label May 1, 2026
@drew drew force-pushed the feat/local-domain-gateway-proxy branch from 1a0edfd to e35fd16 Compare May 12, 2026 04:19
@drew drew force-pushed the feat/local-domain-gateway-proxy branch from e35fd16 to 3b01d18 Compare May 12, 2026 04:44
@drew drew marked this pull request as ready for review May 12, 2026 20:37
@drew drew requested a review from a team as a code owner May 12, 2026 20:37
TaylorMutch
TaylorMutch previously approved these changes May 12, 2026
Copy link
Copy Markdown
Collaborator

@TaylorMutch TaylorMutch left a comment

Choose a reason for hiding this comment

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

One comment for my own understanding, otherwise LGTM

Comment thread crates/openshell-server/src/service_routing.rs
@drew drew merged commit 0797fef into main May 13, 2026
27 checks passed
@drew drew deleted the feat/local-domain-gateway-proxy branch May 13, 2026 00:44
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.

3 participants