Revoking a clearance rotates the label key, or it revokes nothing #4

Merged
paulhitt merged 10 commits from feat/revocation-rotates-the-label-key into main 2026-09-03 11:07:50 +00:00
paulhitt commented 2026-09-03 01:13:24 +00:00 (Migrated from gitlab.com)

The roadmap has carried this as a known hole: "Revoking a compartment should
rotate the label key and re-encrypt; today a revoked holder keeps the old key
and prior content stays readable to them." There was no revoke path at all —
label_key_grants carried SELECT and INSERT to the tenant role and nothing
else.

That gap was not an oversight about DELETE. Deleting the grant row is the
DANGEROUS version of this feature: the key is already on the revoked
person's device, so removing their row removes a record rather than an
ability, and every node key at that label stays wrapped to the key they
still hold. A screen saying "access removed" on the strength of that would
be stating something untrue.

So revocation is modelled as the two separate things it actually is:
withdrawing the grant, which is immediate and worth little on its own, and
rotating the label key, which ends access to anything filed afterwards and
which the SERVER CANNOT DO — it holds no key that opens anything. Only a
cleared client can perform the rewrap.

That is the shape regrade_requests already uses, and this follows it
rather than inventing a second vocabulary: the server records intent, a
cleared client moves it to done and must name itself to do so.

🔴 The status vocabulary refuses to lie. There is no revoked state
reachable by withdrawing a grant alone. The states are what is true —
requested (the grant is gone, the key is not), rotating, rotated.

Also here, because both were found while writing it:

  • The incremental tenant scripts were never parse-tested. Only the baseline
    schema was, and the baseline runs once per tenant and never again — so an
    unparseable incremental breaks upgrades for every existing deployment
    while a fresh install stays healthy. Both tenant scripts are now covered.
  • Those scripts exist twice, at sql/tenant/ and in the bundled resources,
    kept in step by hand. A test now fails if they drift, because the bundled
    copy is the one that runs and the other is the one people read.

Not yet done, and deliberately a separate change: the client side that
performs the rewrap, and the controller that drives the state machine.
23 tests, 0 failures.

The roadmap has carried this as a known hole: "Revoking a compartment should rotate the label key and re-encrypt; today a revoked holder keeps the old key and prior content stays readable to them." There was no revoke path at all — `label_key_grants` carried SELECT and INSERT to the tenant role and nothing else. That gap was not an oversight about DELETE. Deleting the grant row is the DANGEROUS version of this feature: the key is already on the revoked person's device, so removing their row removes a record rather than an ability, and every node key at that label stays wrapped to the key they still hold. A screen saying "access removed" on the strength of that would be stating something untrue. So revocation is modelled as the two separate things it actually is: withdrawing the grant, which is immediate and worth little on its own, and rotating the label key, which ends access to anything filed afterwards and which the SERVER CANNOT DO — it holds no key that opens anything. Only a cleared client can perform the rewrap. That is the shape `regrade_requests` already uses, and this follows it rather than inventing a second vocabulary: the server records intent, a cleared client moves it to done and must name itself to do so. 🔴 The status vocabulary refuses to lie. There is no `revoked` state reachable by withdrawing a grant alone. The states are what is true — `requested` (the grant is gone, the key is not), `rotating`, `rotated`. Also here, because both were found while writing it: - The incremental tenant scripts were never parse-tested. Only the baseline schema was, and the baseline runs once per tenant and never again — so an unparseable incremental breaks upgrades for every existing deployment while a fresh install stays healthy. Both tenant scripts are now covered. - Those scripts exist twice, at sql/tenant/ and in the bundled resources, kept in step by hand. A test now fails if they drift, because the bundled copy is the one that runs and the other is the one people read. Not yet done, and deliberately a separate change: the client side that performs the rewrap, and the controller that drives the state machine. 23 tests, 0 failures.
paulhitt commented 2026-09-03 01:13:24 +00:00 (Migrated from gitlab.com)

assigned to @paulhitt

assigned to @paulhitt
paulhitt commented 2026-09-03 01:15:42 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 7fdcf3a4 - The server as a courier, without deleting what it already holds

Compare with previous version

added 1 commit <ul><li>7fdcf3a4 - The server as a courier, without deleting what it already holds</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001216349&start_sha=cbcbe44234ce2a3a0b8e928d0279dfb85bb6aca9)
paulhitt commented 2026-09-03 01:19:46 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 689f5516 - Decide what a courier sweep deletes, separately from deleting it

Compare with previous version

added 1 commit <ul><li>689f5516 - Decide what a courier sweep deletes, separately from deleting it</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001220386&start_sha=7fdcf3a4d1fc708cfa10ef5588efdc5b0d27a089)
paulhitt commented 2026-09-03 01:22:38 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 50f1cc27 - The sweep that does the deleting, switched off

Compare with previous version

added 1 commit <ul><li>50f1cc27 - The sweep that does the deleting, switched off</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001223120&start_sha=689f55168de4ae7e5bb7140b21397dff216befd1)
paulhitt commented 2026-09-03 01:31:45 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 27e452fd - One device list, shared between Files and Messenger

Compare with previous version

added 1 commit <ul><li>27e452fd - One device list, shared between Files and Messenger</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001230563&start_sha=50f1cc27c63216cb3c150eefa37c0ea8853d2b54)
paulhitt commented 2026-09-03 02:27:36 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 3f682eef - Upload as a transfer, and collect it

Compare with previous version

added 1 commit <ul><li>3f682eef - Upload as a transfer, and collect it</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001281705&start_sha=27e452fd4fc664703d43696f3cb640b579c6fe73)
paulhitt commented 2026-09-03 02:28:50 +00:00 (Migrated from gitlab.com)

added 1 commit

  • fd8624f4 - Specify the wallet, and say why its seed is not derived

Compare with previous version

added 1 commit <ul><li>fd8624f4 - Specify the wallet, and say why its seed is not derived</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001283110&start_sha=3f682eef7a1811ba1c0964e13f8d9913a5c62bbe)
paulhitt commented 2026-09-03 09:17:27 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 5e1bcf09 - Rotate the label key on the client, which is the only place it can happen

Compare with previous version

added 1 commit <ul><li>5e1bcf09 - Rotate the label key on the client, which is the only place it can happen</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2001941131&start_sha=fd8624f4bb1b025a495ea038343371638d19dbc1)
paulhitt commented 2026-09-03 10:37:23 +00:00 (Migrated from gitlab.com)

added 1 commit

  • cbeff790 - Wallet seeds: BIP-39, and the two doors from SPEC §8

Compare with previous version

added 1 commit <ul><li>cbeff790 - Wallet seeds: BIP-39, and the two doors from SPEC §8</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2002156341&start_sha=5e1bcf09fde353b04b37793b8014567f88314539)
paulhitt commented 2026-09-03 10:50:41 +00:00 (Migrated from gitlab.com)

added 1 commit

  • cae48d9e - Vendor the BIP-39 wordlist, and prove it against the published vectors

Compare with previous version

added 1 commit <ul><li>cae48d9e - Vendor the BIP-39 wordlist, and prove it against the published vectors</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/4/diffs?diff_id=2002188209&start_sha=cbeff790370181978df9a7339d9736de977ef4fd)
paulhitt commented 2026-09-03 11:07:50 +00:00 (Migrated from gitlab.com)

mentioned in commit 3f1e98d60f

mentioned in commit 3f1e98d60ff001060c800f2f8b341e54f0717a32
paulhitt (Migrated from gitlab.com) merged commit 3f1e98d60f into main 2026-09-03 11:07:51 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: extant2000/flamenet-files#4