📝 docs: logout does not invalidate server-side (live probe 2026-10-27) #162

Merged
mat merged 1 commit from docs/logout-not-server-side into main 2026-10-27 10:27:20 +00:00
Owner

Summary

 logout() docstring / README / auth.md
-  "POST /v1/logout invalidates the cwt_session cookie server-side"
+  "clears the cookie client-side only; the session is not revocable"

Today's live probes (while scoping #158) refuted a standing assumption: POST /v1/logout responds 200 with Set-Cookie: cwt_session=; Expires=1970 (client-side clearing only), and the old cookie value keeps working afterwards — GET /users/authenticated → 200, GET /sites → 200, and a fresh WS handshake is accepted. The cwt_session JWE (alg: dir) appears stateless: there is no server-side session to revoke, the cookie lives until its embedded expiry (the x-cwt-token instant). The docstring, README and field notes now say what was actually observed, including the security implication: a leaked cookie is valid until expiry — only time kills it.

The client behavior itself is unchanged and remains sensible: logout() drops the cookie from the jar and clears stored credentials so auto_reauth cannot silently restore the session.

Evidence

  • Before: docs claimed server-side invalidation — an untested inference from the bundle ("referenced from the bundle" in auth.md).
  • After: every claim carries its live-verification date; pytest = 197 passed, mypy clean (docstring/README/field-notes only).

Merge Danger

Door: two-way — documentation only.

Blast Radius: none in code; corrects a security-relevant claim in the docs.

## Summary ```diff logout() docstring / README / auth.md - "POST /v1/logout invalidates the cwt_session cookie server-side" + "clears the cookie client-side only; the session is not revocable" ``` Today's live probes (while scoping #158) refuted a standing assumption: `POST /v1/logout` responds 200 with `Set-Cookie: cwt_session=; Expires=1970` (client-side clearing only), and the old cookie value **keeps working afterwards** — `GET /users/authenticated` → 200, `GET /sites` → 200, and a fresh WS handshake is accepted. The `cwt_session` JWE (`alg: dir`) appears stateless: there is no server-side session to revoke, the cookie lives until its embedded expiry (the `x-cwt-token` instant). The docstring, README and field notes now say what was actually observed, including the security implication: a leaked cookie is valid until expiry — only time kills it. The client behavior itself is unchanged and remains sensible: `logout()` drops the cookie from the jar and clears stored credentials so `auto_reauth` cannot silently restore the session. ## Evidence - **Before:** docs claimed server-side invalidation — an untested inference from the bundle ("referenced from the bundle" in auth.md). - **After:** every claim carries its live-verification date; `pytest` = 197 passed, `mypy` clean (docstring/README/field-notes only). ## Merge Danger **Door:** two-way — documentation only. **Blast Radius:** none in code; corrects a security-relevant claim in the docs.
📝 docs: logout does not invalidate server-side (live probe 2026-10-27)
All checks were successful
Tests / forgejo-pytest (pull_request) Successful in 43s
Tests / forgejo-pytest (push) Successful in 42s
8f10aff70a
mat changed title from WIP: 📝 docs: logout does not invalidate server-side (live probe 2026-10-27) to 📝 docs: logout does not invalidate server-side (live probe 2026-10-27) 2026-10-27 10:27:15 +00:00
mat merged commit 7d1c6d11de into main 2026-10-27 10:27:20 +00:00
mat deleted branch docs/logout-not-server-side 2026-10-27 10:27:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
mat/python-comwatt-client!162
No description provided.