All blog posts
Updates 3 min read

Rust Authentication Foundations and Entity Permissions

Commonveil's Rust backend gained the foundational cryptography, session handling, request validation and row-based entity permissions used by sign-in flows.

By Comutability Published Update from
A permissions checklist symbol on a dark software architecture illustration.

Project update: 15 November 2026. GitHub pull request #9: merged into GitHub source, not necessarily deployed. Commonveil has not been independently security audited.

Commonveil's Rust backend gained the foundational cryptography, session handling, request validation and row-based entity permissions used by sign-in flows.

Why this matters

Replacing a server's authentication layer is a high-risk transition. Tokens, password checks, permission boundaries and error responses need to behave consistently or members could lose access or gain access they should not have. This stage concentrates on shared primitives and authorisation rules before more user-facing functions move.

Detailed change record

The public engineering notes below describe what was implemented or proposed and the evidence recorded with the change. Historical instructions in the notes describe the pull request at the time it was raised.

The next step of the Rust server (rust/commonveil-server). The Docker image is unchanged and this is not a release.

What's in it

  • Sign-in cryptography (crypto): base64url, HMAC, PBKDF2 password hashing with the same chained rounds and NFKC normalisation, and Ed25519.
  • Sessions: access tokens, refresh tokens, the security epoch, live sessions and user records.
  • The action runner and validators (api), which the identity functions will use next.
  • Who's calling: the bearer token is checked, and /api/entities/* now works under the row rules.

Checked against the TypeScript and the Node server

  • Passwords: hashes made by either side check out on the other.
  • Tokens: access tokens are byte-identical. Bent tokens are judged the same (extra parts, wrong prefix or signature, expiry boundaries, unparseable claims), as are unusable password hashes and odd Ed25519 signatures (non-canonical, all-zero key).
  • Entities: 110 requests as nobody, three people of different roles and a bent token give the same status and answer from both servers, starting from the same data. This check found one more difference, now matched: a JSON array sent as a query is read as conditions on fields "0", "1" and so on.

Deliberate differences

  • An entity request body over 256 KB gets a 413. The Node server answers 500, because its size error isn't one it expects.
  • A body that isn't valid JSON gets a fixed message, where Node passes on V8's own message, which changes between versions.

Next (B2): the identity functions, passkeys and first-run setup.

Decisions and principles behind the work

Comutability is building towards privacy, user control and genuinely self-hostable software. That does not mean every proposal is already deployed. The Rust backend is being checked for parity with Node.js before it can replace the existing Docker image.

What comes next

Continue verifying negative and expired-session cases with identical tests against both backends.

Check the sources

Sources and further reading

Explore the evidence and original project records behind this article.