Repository navigation
Fixes GRE-798: authenticate job WebSocket upgrades - #1254
Merged
Merged
Conversation
GET and HEAD /ws/jobs/{id} refuse a bad origin, listener, or credential before subscribe. An admitted upgrade calls read_public, then subscribe, and holds the socket without sending snapshots. HEAD uses the same admission and does not subscribe.
HTTP 404 before upgrade stays in this slice and matches read-one. GRE-799 must accept the socket and close 1008 Job not found before the web client uses the route. The mutation test name now matches the mounted WebSocket route.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Job WebSocket upgrades at
/ws/jobs/{id}now refuse a bad origin, listener, or credential before any subscription. An admitted caller is checked withread_public, then the socket is held with no snapshots.HEADuses the same check and does not subscribe.A missing or foreign job stays HTTP 404, matching read-one. Node accepts the socket and closes 1008
Job not found. The web client treats only that close as final. GRE-799 owns that close.Definition of done
See the definition of done.
Evidence
CARGO_TARGET_DIR=/persist/targets/gre-798-job-ws,CARGO_BUILD_JOBS=2, head720d62113a4afadc387e21a2d3048b93669a6d32.cargo test -p pp-api --locked --manifest-path rust/Cargo.toml --features desktop_rebuild --test jobs_http -- --test-threads=2: 14 passed, 0 failed.cargo test -p pp-api --locked --manifest-path rust/Cargo.toml --test jobs_http job_ws_rejects_invalid_origin_or_principal: feature off, 1 passed.cargo test -p pp-api --locked --manifest-path rust/Cargo.toml --test jobs_http job_ws_head_does_not_subscribe: feature off, 1 passed.cargo clippy -p pp-api --locked --manifest-path rust/Cargo.toml --features desktop_rebuild --all-targets -- -D warnings: finished clean.cargo check -p pp-api --locked --manifest-path rust/Cargo.toml --no-default-features: finished.Exemption
Exemption: none
Reviewed with sol-loop: 1 round with Claude Opus 5.5 on xhigh. Sol asked for a change on the HTTP 404 for a missing job. This slice keeps that 404, matching read-one, and records the Node 1008 close on GRE-799. The stale mutation test name was renamed. A live 101 hold test was declined. The named tests are the two refusal tests.
Council review
Rounds: 1 of 4. Head
720d62113a4afadc387e21a2d3048b93669a6d32. All three approved. No code change.Declined, no code change:
101, slot taken, silent socket, slot freed on close). The ticket names the two refusal tests. Claude checked that path by hand on this head and deleted the scratch test. GRE-799 pumps the socket and can pin the hold with that work.404is asserted forHEAD, and another tenant's session is asserted forGETandHEAD. A missing-idGETand a foreign API key use the sameread_publicmap as read-one.Connection header did not include 'upgrade', for both an existing job and a missing job. That is not an upgrade, and it does not leak which id exists.1008 Job not found.jobs_routeris not mounted outside tests, and the route stays behinddesktop_rebuildplusPP_DESKTOP_REBUILD. The doc already assigns that close to GRE-799.Created with Grok 4.7 in T3 Code.