Skip to content

Per-project actor IDs via HMAC-SHA256#77

Merged
shikokuchuo merged 4 commits intomainfrom
actor-id
Mar 22, 2026
Merged

Per-project actor IDs via HMAC-SHA256#77
shikokuchuo merged 4 commits intomainfrom
actor-id

Conversation

@shikokuchuo
Copy link
Collaborator

@shikokuchuo shikokuchuo commented Mar 22, 2026

Closes #75.

fyi @cscheid this is the follow up to #71 as we discussed on Friday.

Previously, every user had a single actor ID across all projects (SHA-256 of their OIDC sub claim). This meant anyone who could observe Automerge sync traffic across several projects could trivially correlate activity to the same user.

This PR makes actor IDs project-scoped.

How it works

Actor IDs are derived by signing the combination of the user's identity and the project ID with a server-held secret. This means the same user gets a different actor ID in each project, so activity cannot be correlated across projects. Within a single project, the ID is stable across sessions and devices.

Server changes

A new /auth/actor?project=<id> endpoint returns the actor ID for the authenticated user scoped to a specific project. The HMAC key is a 32-byte secret stored in hub.json, auto-generated on first startup. It can be overridden via the QUARTO_HUB_SERVER_SECRET environment variable for container deployments. The hub.json file is written with restricted permissions (0o600) so other system users cannot read it.

/auth/me no longer returns an actor ID, since the ID depends on which project is being accessed.

Client changes

The actor ID is no longer fetched at login. Instead, it is fetched from the server just before connecting to a project, since the ID depends on which project is being opened. If the session has expired at that point, the user is sent to the login screen immediately.

@shikokuchuo shikokuchuo merged commit d20e340 into main Mar 22, 2026
4 checks passed
@shikokuchuo shikokuchuo deleted the actor-id branch March 22, 2026 06:37
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.

hub: actor ID hash

1 participant