fix(security): replace stream URL JWTs with one-time grants - #513
Draft
seonghobae wants to merge 11 commits into
Draft
fix(security): replace stream URL JWTs with one-time grants#513seonghobae wants to merge 11 commits into
seonghobae wants to merge 11 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
marked this pull request as ready for review
August 15, 2026 21:10
seonghobae
marked this pull request as draft
August 16, 2026 08:11
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.
Buyer/security outcome
Refs #413. This stacked slice replaces the browser realtime stream's broad session-JWT query credential with a short-lived, one-time, project-bound opaque
streamgrant. Calendar subscription credentials remain separate because they require a durable rotation/revocation lifecycle rather than a one-time connection grant.Exact current stack
fix/attachment-view-grant-runtime-413@712be4148637ebd69334ca34245e4b2ab41b0305(fix(security): replace attachment-view URL JWTs with one-time grants #512);569ffa00fc0f75f36c3615d34121927748f28c8f;d6f1efec51a38ac052db4d0cfe0608c488817807;cloud-sync.js,docs/doctoring/stream-access-grant-runtime.md,package.json,server/app.mjs,stream-access-grant.js,tests/api/session-revocation.test.mjs,tests/api/smoke.mjs,tests/api/stream-access-grant.test.mjs, andtests/unit/stream-access-grant-client.test.mjs.The current parent attachment-view grant runtime, SQLite persistence/audit outbox, tenant-bound contextual-orchestrator cost attribution, current dependency versions/test registrations, Microsoft Project XML hardening, accessible toast regression, and protected security/documentation behavior are preserved outside those nine paths.
Reconciliation repair
Fresh state showed this child had diverged from its live parent after #512 was repaired, leaving it 42 parent commits behind. The old child package also carried stale dependency versions and omitted current parent OpenCode/changelog/orchestrator-attribution test registrations. Reusing that stale tree would therefore have silently weakened already-integrated parent evidence.
The causal repair at
569ffa00...rebuilds the stream child from exact current parent treeed1714d6d257e657e081a1a91ba1fba5f560ec95and overlays only the stream-owned semantic files.package.jsonis merged semantically: it retains parent@hono/node-server ^2.1.1, Playwright 1.62.1, OpenCode/changelog/orchestrator-attribution and attachment-view coverage/test registrations while adding the stream grant API/client andstream-access-grant.jscoverage. Fresh comparison now proves exact-parent ancestry and the intended nine-file delta only.Implemented contract
Authorization: Bearerheader onPOST /api/projects/:id/access-grantswith{ purpose: "stream" };grant, not a session JWT or legacytokenquery parameter;TDD and current evidence
The stream runtime was built test-first: missing-module/client contracts and focused fan-out/revocation assertions preceded the production gateway. All predecessor-head CI/review evidence is historical. Fresh exact-current-head Server Tests, Dependency Review and OSV workflows for
569ffa00...have been created and are non-passing until terminal. The central organization-owned exact-head SAST/Security evidence defect remains tracked on its existing.github#1222owner path; synthetic/predecessor/status-only evidence is not merge authority.No current review submissions or unresolved review threads exist on this exact head. This PR remains Draft until every applicable repository and organization check is terminal-success, exact owned-production coverage/docstrings are established, valid findings are zero, and qualifying independent current-head/last-push approval exists under live policy.
Standards, rollback, and integration boundary
docs/doctoring/stream-access-grant-runtime.mdrecords the transport threat, staged gateway boundary, acceptance/rollback conditions, and APA 7 references to final RFC 6750 and RFC 9700. Rollback must not represent broad JWT query transport as a secure steady state; operational rollback should disable the affected browser realtime capability or use a controlled compatibility boundary while restoring the scoped-grant path.This PR does not close #413. Calendar subscription rotation/revocation, PostgreSQL adapter parity, management UI/Figma flows, observability/quotas, and final rejection of all general session JWT query transports remain separate bounded work.
Do not integrate independently of #512, #510 and #506. After the prerequisite stack reaches protected
develop, reconcile this bounded semantic diff onto the resulting live protected head and regenerate every then-applicable CI, browser E2E, coverage/docstring, SAST/security/dependency/supply-chain, package/provenance, migration/recovery, resolved-thread and qualifying independent-approval gate.