Skip to content

invalidate other sessions on password change#68

Open
fabracht wants to merge 3 commits into
mainfrom
fix/invalidate-sessions-on-password-change
Open

invalidate other sessions on password change#68
fabracht wants to merge 3 commits into
mainfrom
fix/invalidate-sessions-on-password-change

Conversation

@fabracht
Copy link
Copy Markdown
Contributor

Summary

  • Adds SessionStore::destroy_others_by_canonical_id(canonical_id, keep_session_id) -> Vec<String> returning JWTs of removed sessions so callers can revoke their JTIs.
  • POST /auth/password/change now keeps the caller's session and destroys every other session for the same canonical_id. JTIs from those JWTs are added to JtiRevocationStore.
  • POST /auth/password/reset/submit destroys all sessions for the target user (no current session at reset time) and revokes their JTIs.
  • MQTT password-change path ($DB/_auth/password/change) is intentionally out of scope — AdminContext has no reference to SessionStore, and threading it through is plumbing for a separate PR.

Closes #37 (HTTP scope); MQTT path tracked as follow-up.

Test plan

  • cargo make dev (format + clippy + 750 tests)
  • 3 new unit tests in session_store.rs for the new method (keep-current-session / destroy-all / unknown-user)

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.

invalidate other sessions on password change

1 participant