Close client token, live revocation and journal validation gaps (#426) #482

Open
kayg wants to merge 6 commits from issue/426-client-review into dev
Owner

Builds on #481 for #426. An approved device code could return a raw CLI token to a browser request. Live sockets could miss Installation revocation during upgrade or journal catch-up. The client could commit an inconsistent or backwards journal cursor.

Reject browser requests on device-token redemption without consuming the approval, recheck the live socket's original credential before processing traffic and enforce revocation in catch-up, and validate journal ordering and tokens before changing local state.

Four regression tests fail against the unchanged #481 head and pass with these fixes. Added real two-user device-token checks for HTTP actions, journal cursors and websocket rooms, extended the whole-server isolation suite, and tested credential hashing, 0600 database files, CLI output, lost acknowledgements and replay to the wrong note. Yrs writer IDs and clocks provide the persisted operation idempotency keys; replay keeps the original operations and checks server lineage.

Validation: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace all passed through the shared build-slot wrapper with the requested target directory. The final workspace run passed 472 tests; three existing internet/performance tests remain ignored by the default gate. An initial run failed the unchanged engine sweeper scheduling assertion; it passed on the complete rerun. Full gate output and findings are posted on #426.

The review base is issue/426-client-2 at 20a23d9ff5; the comparison base origin/dev is c82161d7c6. This PR targets dev as requested and includes #481's commits. Review the four additional commits for this audit. No app-password route exists in the reviewed diff. No merge or deployment was performed.

Builds on #481 for #426. An approved device code could return a raw CLI token to a browser request. Live sockets could miss Installation revocation during upgrade or journal catch-up. The client could commit an inconsistent or backwards journal cursor. Reject browser requests on device-token redemption without consuming the approval, recheck the live socket's original credential before processing traffic and enforce revocation in catch-up, and validate journal ordering and tokens before changing local state. Four regression tests fail against the unchanged #481 head and pass with these fixes. Added real two-user device-token checks for HTTP actions, journal cursors and websocket rooms, extended the whole-server isolation suite, and tested credential hashing, 0600 database files, CLI output, lost acknowledgements and replay to the wrong note. Yrs writer IDs and clocks provide the persisted operation idempotency keys; replay keeps the original operations and checks server lineage. Validation: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace all passed through the shared build-slot wrapper with the requested target directory. The final workspace run passed 472 tests; three existing internet/performance tests remain ignored by the default gate. An initial run failed the unchanged engine sweeper scheduling assertion; it passed on the complete rerun. Full gate output and findings are posted on #426. The review base is issue/426-client-2 at 20a23d9ff5b45b6c310266022e784dcb8197627b; the comparison base origin/dev is c82161d7c6fefcd476d73a92f1fbc2461ef2fef1. This PR targets dev as requested and includes #481's commits. Review the four additional commits for this audit. No app-password route exists in the reviewed diff. No merge or deployment was performed.
Client: one Rust client for every app, slice 1 (#426)
Some checks failed
CI / server (pull_request) Successful in 29s
CI / rust (pull_request) Successful in 3m4s
CI / web (pull_request) Failing after 47m19s
81491beee9
ADR 0041: macOS toolkit is proposed, decided by a Catalyst vs AppKit spike (#426)
Some checks failed
CI / server (pull_request) Successful in 26s
CI / rust (pull_request) Successful in 1m59s
CI / web (pull_request) Failing after 46m56s
20a23d9ff5
kayg: not set in stone; no mobile UI on the desktop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QGa6qjALuHyi8H1naGp6b
Audit client credential isolation and offline replay through real protocols
Some checks failed
CI / server (pull_request) Successful in 24s
CI / rust (pull_request) Successful in 3m23s
CI / web (pull_request) Failing after 44m7s
f6cd9d82af
Author
Owner

stale? #931 suggests folding this into #481, but neither a replacement nor completion of the client gaps is proved in dev.

stale? #931 suggests folding this into #481, but neither a replacement nor completion of the client gaps is proved in dev.
Author
Owner

housekeeping #1009: needs-decision.

Follow-up to the unrevived Rust client #481. #931 proposes folding it into that slice; only an archive head matches this migrated PR, and the requested client validation gaps are not proved complete.

original head: f6cd9d82af7a0b0f3c7b62a9a53ae658c8b60fe8. against dev cd7f84432febfc63b788fbb9b9f9950452982d74, git cherry reports 6 unmatched and 0 equivalent patches. the landing audit lists each candidate missing commit and stable patch match in pr-482.md; unmatched patches can include superseded behavior.

left open, source branch unchanged. no rebase or new test claim for this decision lane.

housekeeping #1009: needs-decision. Follow-up to the unrevived Rust client #481. #931 proposes folding it into that slice; only an archive head matches this migrated PR, and the requested client validation gaps are not proved complete. original head: `f6cd9d82af7a0b0f3c7b62a9a53ae658c8b60fe8`. against dev `cd7f84432febfc63b788fbb9b9f9950452982d74`, git cherry reports 6 unmatched and 0 equivalent patches. the [landing audit](https://git.kayg.org/attachments/fe3c09dc-dea3-47a0-92e2-b44a777083e5) lists each candidate missing commit and stable patch match in `pr-482.md`; unmatched patches can include superseded behavior. left open, source branch unchanged. no rebase or new test claim for this decision lane.
Some checks failed
CI / server (pull_request) Successful in 24s
CI / rust (pull_request) Successful in 3m23s
CI / web (pull_request) Failing after 44m7s
This pull request has changes conflicting with the target branch.
  • Cargo.lock
  • crates/auth/src/lib.rs
  • crates/calternal/src/isolation.rs
  • docs/adr/0040-one-rust-client-for-every-app.md
  • docs/adr/README.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'issue/426-client-review:issue/426-client-review'
git switch 'issue/426-client-review'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'dev'
git merge --no-ff 'issue/426-client-review'
git switch 'issue/426-client-review'
git rebase 'dev'
git switch 'dev'
git merge --ff-only 'issue/426-client-review'
git switch 'issue/426-client-review'
git rebase 'dev'
git switch 'dev'
git merge --no-ff 'issue/426-client-review'
git switch 'dev'
git merge --squash 'issue/426-client-review'
git switch 'dev'
git merge --ff-only 'issue/426-client-review'
git switch 'dev'
git merge 'issue/426-client-review'
git push origin 'dev'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!482
No description provided.