feat(identity): enforce recent-authentication policy for data rights - #136
Conversation
|
Warning Review limit reached
Next review available in: 20 seconds You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
|
@coderabbitai review |
|
* test(planning): define durable Today synchronization contract * feat(planning): implement durable Today domain contract * test(planning): define atomic Today persistence contract * feat(planning): persist Today with atomic optimistic writes * feat(planning): add durable Today persistence schema * feat(planning): compose durable Today runtime * test(planning): define Today HTTP precondition boundary * feat(planning): enforce authenticated Today HTTP preconditions * feat(planning): expose authenticated Today sync API * fix(planning): avoid duplicate migration ordinal * fix(planning): order durable Today migration after repository constraints * test(planning): verify durable Today PostgreSQL behavior * test(web): define authenticated Today sync BFF contract * feat(web): add authenticated durable Today BFF * feat(web): expose same-origin Today sync route * test(web): include durable Today sync in quality gates * test(web): define explicit local-to-workspace Today migration * feat(web): implement explicit local-to-workspace Today migration * test(web): verify workspace Today migration path * feat(web): label local and durable Today states * feat(web): localize durable Today sync states * feat(web): add explicit durable Today controls * feat(web): connect explicit workspace Today controls * test(web): verify explicit durable Today migration * test(ci): require browser journey verification * ci(web): execute Playwright buyer journeys * test(web): verify stale Today reconciliation * docs(research): ground durable Today synchronization * docs(planning): add durable Today operations runbook * docs(planning): design durable Today workspace sync * docs(planning): plan durable Today workspace sync * test(web): preserve local Today across retry * test(web): scope accessibility live-region assertions * test(web): bind durable search acceptance to semantic controls * test(web): follow the current Today capture label * style(planning): restore canonical provider formatting * style(planning): format concurrent Today assertion * fix(web): remove unreachable Today save disabled check * fix(web): narrow optional Today request body * test(web): make Today fetch fixtures exact-optional safe * test(web): preserve explicit optional fetch init in Today sync * style(web): format Today workspace synchronization * fix(planning): acquire Today advisory locks in order * test(planning): enforce deterministic Today lock order * test(planning): stress identical Today replay concurrency * style(web): format Today sync boundary * style(web): format Today workspace client * style(web): format Today sync tests * style(web): format Today workspace tests * test(planning): match SQL client result contract * test(planning): isolate lock-order integration fixture * test(planning): move lock-order fixture out of production source * test(planning): remove dynamic SQL from lock-order fixture * style(web): format Today workspace sync client * style(web): format Today sync boundary * style(web): format Today sync tests * fix(web): parse strong ETags with valid regex syntax * fix(web): use valid strong ETag parser in BFF * feat(identity): enforce recent-authentication policy for data rights (#136) Add a fail-closed recent-authentication policy that uses the preserved authentication provenance from #134, distinguishing authentication age from session rotation. Includes test-first boundary, stale/future/malformed provenance rejection, and exact-head CI/security validation. * test(planning): exercise Today concurrency independently * fix(planning): make Today date constraint DateStyle-independent * fix(planning): type Today SQL parameters explicitly * test(identity): bind data-rights ownership to recent authenticated session (#137) * test(identity): define recent authentication gate for data rights * feat(identity): enforce recent authentication policy * test(identity): define authenticated data-rights context boundary * feat(identity): bind data-rights export to recent authenticated session * fix(planning): serialize Today writes in explicit transactions * fix(planning): pin Today transactions to one PostgreSQL connection * test(planning): cover transactional Today persistence * test(planning): verify transaction lifecycle and cleanup * test(ci): bind Today concurrency to contributor head * test(planning): remove SQL-text lock-order surrogate * ci: capture exact Today prettier patch * test(web): expose in-flight Today save overwrite * fix(web): preserve edits during Today save * ci: apply bounded Today formatting * ci: expose read-only Today format patch * style(web): format Today sync client * style(web): format Today workspace sync * style(web): format Today sync tests * chore(ci): remove Today format diagnostic * test(planning): reject malformed Today lookup scope before SQL * ci: verify Today lookup validation red * ci: apply verified Today lookup validation * fix(ci): compare repair lease to contributor head * fix(ci): include staged self-removal in repair lease * test(planning): reject malformed Today repository lookups * test(planning): distinguish corrupted Today persistence * fix(planning): classify invalid Today persistence separately * fix(planning): validate Today lookup scope before SQL * test(planning): fail explicitly on leaked Today connections * chore(ci): remove superseded Today repair workflow * fix(web): lint complete source globs * test(planning): make Today concurrency cleanup deterministic * docs(today): classify standards publication status * docs(today): align validation and readiness plan * test(planning): define shared Today invariants contract * feat(planning): centralize Today validation invariants * refactor(planning): reuse shared Today invariants * refactor(planning): share Today invariants with persistence * refactor(planning): reuse Today invariants at HTTP boundary * test(planning): import Today persistence error from domain boundary * test(planning): use shared Today persistence error boundary * fix(web): preserve destructive-copy warning in Korean * test(ci): bind browser acceptance to its workflow job * test(web): close Today BFF authority branch gaps * ci(web): stage one-shot canonical formatter * style(web): apply canonical formatter output * feat(identity): persist data-rights request receipts (#138) * test(identity): define durable data-rights request ledger * feat(identity): persist data-rights request state * feat(identity): add data-rights request ledger schema * test(identity): preserve data-rights receipts through erasure * fix(identity): retain data-rights receipts after erasure * chore(identity): sequence data-rights request migration * chore(identity): remove duplicate migration sequence * docs(identity): record durable data-rights ledger boundary * test(identity): expose request-id collision as domain conflict * fix(identity): normalize request ledger conflicts * test(identity): harden data-rights ledger integration harness * test(identity): cover dual request conflict evidence * docs(identity): align data-rights ledger implementation status * docs(changelog): record durable data-rights ledger * fix(identity): resolve ledger migration path portably * test(identity): require immutable terminal receipt storage * test(identity): model pg timestamp rows as Date values * test(identity): satisfy pg parameter mutability contract * fix(identity): enforce immutable terminal data-rights receipts * test(identity): assert immutable receipt no-op at database boundary * test(identity): bind migration fixture lock to one PostgreSQL session * test(web): expose Today media-type and conflict coupling * test(web): execute Today review regressions * fix(web): preserve existing test dependencies * fix(web): normalize Today media types and conflict semantics --------- Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Intent
Advance the remaining #55 data-rights gap from the protected-main authentication-age primitive merged in #134. This slice adds a fail-closed recent-authentication policy that future data-rights HTTP/gateway entrypoints can enforce without treating session rotation as a new authentication event.
TDD evidence
RED —
d3f6d19feea8c7b7d578334358b46e36bf997fc1The test-only head added
data-rights-recent-auth.test.ts. Fresh CI reached the identity suite and failed all three new tests for exactly one reason:requireRecentAuthenticationwas absent (expected 'undefined' to be 'function'). Existing identity tests continued to pass; this established the intended missing policy rather than a setup/import failure.GREEN —
a0f7a7314dfdb6a3fe7ed048dc9c09f976b71536The minimum implementation in
oauth-http-boundary.tsnow:Fresh exact-head evidence on
a0f7a7314dfdb6a3fe7ed048dc9c09f976b71536:Standards rationale
The boundary is intentionally independent from session rotation. Current NIST SP 800-63B session guidance distinguishes session lifetime/activity from authentication or reauthentication time, and OWASP ASVS 5.0 V7.5.3 requires further authentication or secondary verification before highly sensitive operations. The exact data-rights policy window remains a deployment/product decision; this slice provides deterministic fail-closed enforcement semantics rather than inventing a universal timeout.
Scope / next work
This is a prerequisite, not completion of #55. Protected-main still needs the data-rights HTTP/gateway transaction itself, concrete domain contributors, durable request/receipt/reconciliation, protected export delivery/download audit, legal-hold/retention/backup-expiry behavior, and operator recovery.
Refs #55, #134, #21.