Skip to content

Expand cascade-revoke and replay-window coverage for companion sessions#11

Merged
SiteRelEnby merged 2 commits intomainfrom
watchos-refresh-token-coverage
Apr 28, 2026
Merged

Expand cascade-revoke and replay-window coverage for companion sessions#11
SiteRelEnby merged 2 commits intomainfrom
watchos-refresh-token-coverage

Conversation

@SiteRelEnby
Copy link
Copy Markdown
Contributor

The first watchOS-refresh-token PR shipped with coverage of the basics (mint, /logout cascade, solo revoke, change-password carve-out) but missed several paths that the cascade contract has to honour, and a report came back that paired devices still see refresh-related logouts. Filling the obvious gaps so a backend regression here can't slip past again:

  • /sessions/{id} DELETE — same cascade as /logout, but a different code path. Without it a fix to one path could regress the other silently.
  • /sessions/revoke-others — children of the calling session must survive, children of revoked siblings must not. Previously only the keep-the-watch half was covered.
  • Grandchild cascade — the contract is recursive even though no feature mints grandchildren today; future work will rely on it.
  • Multiple children of one parent all cascade.
  • Concurrent /refresh on a child token — the replay-window grace that protects the phone has to apply to the watch too, otherwise parallel refresh-rotation races on the watch nuke the session.
  • Mint after parent session revoked — must 401, otherwise a stolen access token outliving its session could spawn fresh refresh JWTs indefinitely.

All ten companion-session tests pass; full main-config suite remains green at 254 passed.

The first watchOS-refresh-token PR shipped with coverage of the basics
(mint, /logout cascade, solo revoke, change-password carve-out) but
missed several paths that the cascade contract has to honour, and a
report came back that paired devices still see refresh-related logouts.
Filling the obvious gaps so a backend regression here can't slip past
again:

  * /sessions/{id} DELETE — same cascade as /logout, but a different
    code path. Without it a fix to one path could regress the other
    silently.
  * /sessions/revoke-others — children of the calling session must
    survive, children of revoked siblings must not. Previously only
    the keep-the-watch half was covered.
  * Grandchild cascade — the contract is recursive even though no
    feature mints grandchildren today; future work will rely on it.
  * Multiple children of one parent all cascade.
  * Concurrent /refresh on a child token — the replay-window grace
    that protects the phone has to apply to the watch too, otherwise
    parallel refresh-rotation races on the watch nuke the session.
  * Mint after parent session revoked — must 401, otherwise a stolen
    access token outliving its session could spawn fresh refresh
    JWTs indefinitely.

All ten companion-session tests pass; full main-config suite remains
green at 254 passed.
@SiteRelEnby SiteRelEnby merged commit a64ba76 into main Apr 28, 2026
3 checks passed
@SiteRelEnby SiteRelEnby deleted the watchos-refresh-token-coverage branch April 28, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant