Skip to content

Server 2.0.0-alpha.3: share a vault between accounts, and keep a log - #12

Merged
usermaneGermane merged 1 commit into
mainfrom
v3-sharing
Nov 11, 2026
Merged

usermaneGermane merged 1 commit into
mainfrom
v3-sharing

Conversation

@usermaneGermane

Copy link
Copy Markdown
Owner

SecretSpace 3, phase 4, server side: a vault can be shared between accounts, and the server keeps a log. Server version 2.0.0-alpha.3 (a test version; Latest stays as it is).

What changes

  • Members and roles. An owner adds an account to a vault as owner, editor or reader (PUT /v2/vaults/<id>/members/<user>). The vault key arrives wrapped to that account's public key by the owner's device; the server never holds a vault key. A reader's upload is refused.
  • Removing a member changes the key (POST /v2/vaults/<id>/rotate). The re-encrypted vault, its re-sealed name and a wrapped key for every member who stays are swapped in together, or nothing changes. Earlier revisions are dropped, because they are under the old key.
  • Key generation is enforced. An upload whose header carries another key generation is refused (409), so a device that missed a key change cannot put back a copy the removed member can read.
  • Leaving. A member can take themself out (DELETE /v2/vaults/<id>/members/<me>); the only owner cannot.
  • Keys of accounts. GET /v2/accounts/<user>/public-key, and PUT /v2/me/signing-key (set once).
  • The log. _v2/vaults/<id>/audit.log per vault (owners read it with GET /v2/vaults/<id>/log) and _v2/logins.log. One JSON line per event, appended, rotated at 2 MB. No vault content, keys or names, and nothing about who viewed or copied an entry.
  • /health lists "sharing".
  • Names in /v2/ paths are percent-decoded, so an account with a space in its name can log in.
  • The 50-vault limit counts the vaults an account made, not the ones shared with it.

What does not change

  • The 2.x routes (/vault/<user> with the token).
  • Accounts and vaults made with 2.0.0-alpha.1 or alpha.2 keep working.

Tests

  • New tests/test_server_v2_sharing.py: 151 tests over real HTTP. Every refused call is also checked to have changed nothing on disk.
  • 26 deliberately broken guards were each caught by a test (one needed a test added first).
  • Full suite green locally.

server/passman_server.py is the same file in SecretSpace-Server-Linux and SecretSpace-Server-Windows.

🤖 Generated with Claude Code

https://claude.ai/code/session_011ojnyVg7ccsR3pZ64s7aRH

SecretSpace 3, phase 4. A vault can now have several members:

- PUT /v2/vaults/<id>/members/<user>: an owner adds an account (role owner,
  editor or reader) with the vault key wrapped to that account's public key
  by the owner's device, or changes a member's role. The server never holds
  a vault key. A reader's upload is refused, as before.
- POST /v2/vaults/<id>/rotate: an owner gives the vault a new key and can
  remove members in the same call. The re-encrypted vault, its re-sealed
  name and a wrapped key for every member who stays are swapped in together;
  earlier revisions (under the old key) are dropped. The vault's key
  generation goes up, and an upload whose header carries another generation
  is refused, so a device that missed the change cannot put back a copy the
  removed members can read.
- DELETE /v2/vaults/<id>/members/<me>: a member leaves. The only owner cannot.
- GET /v2/vaults/<id>/members, GET /v2/accounts/<user>/public-key,
  PUT /v2/me/signing-key (set once; the key an account signs its changes with).
- The log: _v2/vaults/<id>/audit.log per vault (made, renamed, deleted,
  uploads, members, key changes; owners read it with GET .../log) and
  _v2/logins.log (logins, failed logins, accounts made, password changes).
  One JSON line each, appended, rotated at 2 MB. No vault content, key or
  name is in it, and nothing about who viewed or copied an entry.
- /health lists "sharing". Names in /v2/ paths are percent-decoded, so an
  account with a space in its name can log in.
- The limit of 50 vaults per account counts the vaults an account made, not
  the ones shared with it.

2.x routes are unchanged. Accounts and vaults made with 2.0.0-alpha.1/2 keep
working (a vault without a stored key generation is at 0).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ojnyVg7ccsR3pZ64s7aRH
@usermaneGermane
usermaneGermane merged commit 2eb4973 into main Nov 11, 2026
3 checks passed
@usermaneGermane
usermaneGermane deleted the v3-sharing branch November 11, 2026 20:50
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