This repository has been archived on 2026-11-14. You can view files and clone it. You cannot open issues or pull requests or push a commit.
1andClaude Opus 5.5 594234c263 Mint one token per relay with iss, aud and jti (todo 370)
POST /sessions/relay trades a session token for a 5 minute token naming
one relay. Session tokens are unchanged, so shipped apps keep working.
A token with aud is refused as a session here and at the file server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:44:52 -05:00
2026-08-21 13:46:23 -04:00

The Flamenet account service

One Flamenet handle and passphrase, checked here, so a relay never sees either.

A relay can keep its own accounts and most do. This service exists for the other case: one credential that works across relays, verified by a signed token that any relay can check and none can mint.

It stores an opaque id, a handle, the parameters a client needs to stretch a passphrase, and a verifier to compare against. There is no email column.

What it is not

This repository was a file service, Flamenet Files, with the account service beside it. Files was folded into the messenger on 2026-09-21 and the file server, its web client, its tenant schemas and its documentation were removed. Anything you remember here about blobs, tenants, labels or classification is gone with it. ARCHITECTURE.md describes what is left.

Running it

docker compose up -d

docker-compose.yml brings up Postgres, runs the migrations, and starts the service on port 8100. It needs ENCLAVE_JWT_SECRET and ENCLAVE_ACCOUNTS_SECRET, both at least 32 characters, and a POSTGRES_PASSWORD. SELF-HOSTING.md covers a real deployment; deploy/RUNBOOK-accounts.md covers the one we run.

The routes

POST /accounts Register. Takes a derived secret, never a passphrase.
GET /accounts/:handle/params The stretch parameters. Answers for handles that do not exist, on purpose.
POST /accounts/passphrase Change a passphrase.
POST /accounts/rotate Re-establish access with a recovery code.
POST /accounts/delete Delete an account and everything keyed to it.
POST /sessions Sign in. Returns the signed token a relay verifies.
POST /sessions/relay Bearer session. Body {"audience": <relay FN_RELAY_AUDIENCE>}. Returns a 5 minute token for that one relay with iss, aud and a fresh jti. Refused here and at the file server as a session.
GET /.well-known/jwks.json The public half, so a relay can verify without being able to mint.
GET / POST /identity Read or enrol a per-product identity record. Enrolment is optional and nothing currently uses it.
POST /identity/rekey Re-wrap an identity record under a new passphrase.
GET /identity/principals/:pseudonym Somebody's public key, by their product pseudonym.
POST /clearance/check Ask whether a pseudonym holds a clearance.

Every route that takes a passphrase answers in constant time and gives an unknown handle and a wrong passphrase the same reply, so none of them can be used to find out who has an account.

Testing

TESTING.md. The short version is swift test for the fast suites and ./scripts/test-account-delete.sh for the ones that need a real Postgres.

S
Description
Self-hostable encrypted file storage with multi-level security. Encrypted in your browser; every file carries a classification label enforced by both row-level security and the key hierarchy.
Readme MIT
1.6 MiB
Languages
Swift 81.2%
Shell 9.9%
PLpgSQL 5.1%
Python 2.9%
Dockerfile 0.9%