Login security - #45
Draft
ArtyomSavchenko wants to merge 16 commits into
Draft
Conversation
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Account security: login history, active sessions & token rotation
Builds on the login-security branch: adds a Login history / Active sessions UI,
durable sessions with per-session revocation, and short-lived access tokens with
rotating refresh tokens.
Highlights
Login history shows only real logins/logouts (server-side
eventTypefiltering;workspace-switch
sessionchurn hidden). Active sessions lists the user'ssessions with a "This device" badge and a Sign out (revoke) action.
ActiveSessionrecord (Postgres + Mongo)tied to a
sessionIdtoken claim. Checked at connect (getLoginWithWorkspaceInfo)and pushed to transactors over Kafka (
SessionRevoked→closeSessionByLoginId)for immediate live-socket teardown.
kind:'access'+ shortexp; a rotatingrefresh token (
kind:'refresh') is exchanged at a newrefreshTokenendpoint withreuse detection (replaying an old generation revokes the session). The refresh
token lives in an httpOnly cookie set by the account service; the front runs a
single-flight, cross-tab refresh loop.
purgeRevokedActiveSessions), reuse observability(
session_revoked_reuseevents + warn logs).Config / rollout
ACCESS_TOKEN_TTL_SEC(default 0 = off),REFRESH_TOKEN_TTL_SEC(default 30d),ACTIVE_SESSION_RETENTION_DAYS(default 30).docs/token-rotation-plan.mdafter validating the front refresh loop in a realbuild. Keep
ACCESS_TOKEN_TTL_SECwell above the transactor reconnect window.@hcengineering/kafkatopods/account→ runrush update.Testing
tscclean (token, account-client, account, account-service, transactor);svelte-checkclean for the touched plugins.eventTypeclassification, and session GC.build (see runbook).