Skip to content

fix(network): align REST and WebSocket endpoint handling - #5336

Merged
johntmyers merged 1 commit into
mainfrom
fix/rest-protocol-consistency/johntmyers
Nov 6, 2026
Merged

johntmyers merged 1 commit into
mainfrom
fix/rest-protocol-consistency/johntmyers

Conversation

@johntmyers

Copy link
Copy Markdown
Collaborator

Summary

Keep REST endpoints on HTTP request handling and require explicit WebSocket endpoints for WebSocket upgrades. Apply consistent validation for credential-rewrite settings across policies, provider profiles, and runtime configuration.

Changes

  • Use the same REST upgrade response across relay and forwarding paths.
  • Restrict WebSocket credential rewriting to WebSocket endpoints, including consistent validation of mixed-case protocol names.
  • Update policy documentation, migration guidance, and regression coverage.

Release Notes

REST endpoints return 403 for HTTP upgrade requests in both enforce and audit modes. Configure WebSocket traffic with protocol: websocket and explicit handshake and message rules. websocket_credential_rewrite: true requires a WebSocket endpoint.

Testing

  • 1,999 library tests passed; two tests ignored.
  • Scoped Clippy, Rust formatting, and documentation checks passed.
  • Repository pre-commit checks passed.
  • Four Docker E2E tests passed: REST endpoint handling and WebSocket conformance.

Checklist

  • Follows Conventional Commits.
  • Commit is signed off (DCO).
  • Relevant documentation and policy-generation guidance updated.

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

copy-pr-bot Bot commented Nov 6, 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

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

@johntmyers
johntmyers marked this pull request as ready for review November 6, 2026 15:37
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. policy — No explicit risk acceptance found

REST endpoints previously relayed allowed WebSocket upgrades and supported websocket_credential_rewrite: true; the candidate refuses upgrades and rejects that configuration.

  • Impact: Existing WebSocket clients receive HTTP 403 even in audit mode, while affected sandbox policies, provider profiles, and stored policy revisions fail validation.
  • Action: Preserve REST upgrade and credential-rewrite compatibility for v0.1.8; defer mandatory protocol: websocket migration to a breaking-allowed train with handling for existing stored policies.
  • PR: fix(network): align REST and WebSocket endpoint handling #5336
Review details
  • Execution: complete
  • Candidate: PR #5336 (fd922893bf6c1acc33f92805ddd34787a5970d9b)
  • Baseline: e9ba8d9e3568f7ca1a6320914d0b17e0572fac2d (e9ba8d9e3568f7ca1a6320914d0b17e0572fac2d)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

@johntmyers johntmyers added area:runtime test:e2e Requires end-to-end coverage labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Label test:e2e applied for 7b26195. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@johntmyers

Copy link
Copy Markdown
Collaborator Author

gator-agent

PR Review Status

Reviewed the complete REST/WebSocket handling change and found no blocking findings. REST upgrades are refused across relay and forwarding paths, credential-rewrite validation is consistent across policies, provider profiles, and runtime configuration, and the docs explain the migration to explicit WebSocket endpoints.

Required checks are still running. I applied area:runtime for reviewer routing and test:e2e for policy and network coverage, then followed E2E Label Help's instructions to rerun the current-head Branch E2E Checks workflow; attempt 2 is running. Maintainer approval remains outstanding after CI completes.

Blocking findings: None.

Carried findings: None.

Gator metadata
  • Validation: Focused network-policy correction from a verified repository administrator.
  • Docs: Relevant Fern policy schema, network-rule migration guidance, provider documentation, and policy-generation skill updated.
  • Checks: DCO and vouch passed; Branch Checks pending; Helm Lint and Trivy Changes green. Area label applied to repair Review Readiness routing; its next result remains to be checked.
  • E2E: test:e2e applied; current-head Branch E2E Checks run 42244869447, attempt 2, in progress. No Windows/GPU-specific change requires another label.
  • Review validation: Independent code-only review; findings JSON validated. No local test execution by Gator.
  • Head SHA: 7b26195d4400ce8e32425ec545cce6bbacb9b9f4
  • Base SHA: e9ba8d9e3568f7ca1a6320914d0b17e0572fac2d
  • Merge base SHA: e9ba8d9e3568f7ca1a6320914d0b17e0572fac2d
  • Patch ID: 1a7bfba5e5ab1b8cc0c2f4c002596ec320bdd23e
  • Gator payload: 13
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added the gator:watch-pipeline Gator is monitoring PR CI/CD status label Nov 6, 2026

@russellb russellb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, thanks!

I reviewed this prior to posting and it has since been updated to address the one finding I had.

@johntmyers johntmyers added gator:blocked Gator is blocked by process or repository gates and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Nov 6, 2026

@purp purp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚢

@johntmyers
johntmyers added this pull request to the merge queue Nov 6, 2026
@johntmyers johntmyers added gator:merge-ready and removed gator:blocked Gator is blocked by process or repository gates labels Nov 6, 2026
Merged via the queue into main with commit 9321d16 Nov 6, 2026
397 of 407 checks passed
@johntmyers
johntmyers deleted the fix/rest-protocol-consistency/johntmyers branch November 6, 2026 17:57
@johntmyers

Copy link
Copy Markdown
Collaborator Author

gator-agent

Monitoring Complete

Monitoring is complete because this PR has merged. The prior Gator review found no blocking findings, and the last active state was gator:merge-ready.

I removed the active gator:* label because there is nothing left for Gator to monitor on this PR.

Gator metadata
  • Head SHA: 7b26195d4400ce8e32425ec545cce6bbacb9b9f4
  • Gator payload: 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants