feat(registry): require a second factor before publishing tokens #273
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/228-registry-factor-before-tokens"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #228
Per criterion:
canPublishSql/Registry.canPublish(member of any owner asownerorpublisher).POST /api/1/tokenswithpublishis a 403 with a clear message while the account has no factor (TOTP, or an unmarked passkey on its own). The token recordsfactor(newtokens.factorcolumn, migrated to 0).BEGIN IMMEDIATE, guarded deletes), for both passkey and app removal; documented in RELEASE.md 7.6 and the write-service table.factor-before-tokens.test.trb(each rule working and refused);account,server,totp-accounttests adjusted to the new rules.tools/registry/README.md; sign-in second step stays under "Not built yet".Known limits (documented): the first token of a new account and operator tokens for an account without a factor are not bound; the
ownersaction is not bound; minting checks that a factor is enrolled, not a fresh proof. Candidates for a follow-up.Architect-reviewed; fixed a parse error, test names and doc claims. Nothing built locally (CI only).
Approved. Checklist on
d87348e:factor-before-tokens.test.trbcovers each rule working and refused (mint with app / passkey / none / marked passkey, operator, non-publisher, use after loss and regain, unbound tokens, removal of last passkey / app / allowed cases); adjacent tests adapted. CI green for this head.createToken, first token, trusted exchange) pass the rightfactorflag; the use-time check sits after the trusted return and only forpublish; removal is decided inside the transaction (guarded deletes,removing/leavingtemp tables) with a post-check for the concurrent-removal case; the migration addstokens.factorat 0 so older tokens keep working, as decided on #228.canPublishSql, mint refusal, use refusal, removal refused and documented, trusted publishing unaffected). No workflow, port, secret or dependency changes.Non-blocking (documented known limits, good follow-up candidates):
everyAction, 90 days) and theownersaction are not bound to a factor; a fresh proof of the factor at minting would close the second.