registry: bind first/operator tokens and the owners action to a second factor, step-up on minting #277
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/274-registry-factor-binding"
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 #274
The registry now asks for a fresh second-factor code, sent in the
Torb-Codeheader, where a stolen token could dothe most harm, and gives the unbound first/operator tokens compensating limits.
Criteria
createTokenwithpublishorownersneeds a code (TOTP or recovery,acceptedCode, sothe #227 replay and 5-in-15-minutes limits apply) once the account has a factor; the operator is never asked.
createOrganisation,setMember,removeMemberandsetTrustedPublishingneed the same code.The proof is the last check of a call, so a request refused for scope, role or fields burns no code.
publish/ownersfor an account without a factor is a403(operatorexcepted); a token made with a factor stops managing owners if its account loses it.
(
unboundDays), cannot mintpublish/owners, ask for no code until the account has one, and thecreate-tokenevent ends in
unbound.403naming the passkey, no try counted (the proof through the API is #275).tests/step-up.test.trb(each rule working and refused, read-backs of unchanged state, 429, replay,passkey, legacy token);
factor-before-tokens,accountandservertests adjusted to the new rules.Deviations and known limits
"<id> unbound".daysasks for 90, so it is a400for an account without a factor.publish/ownersbut withtokensstill mints freely: a stolen unbound token can keep minting30-day tokens, and a stolen
tokenstoken escalates only by guessing codes (5 tries per 15 min, no event for a wrongone). Closing both (a code for
tokenstoo, or children bounded by their maker) is follow-up.removeMemberis not in the DELETE's transaction (pre-existing, slightly wider window).skills/is not regenerated (no docs that feed it changed;releasing.mdisskill: omit). No local build: CI only.Approved. Checked against #274 at
584d266.tests/step-up.test.trbcovers each rule working and refused (mint and the four owners calls: no/wrong/replayed code, recovery code single use, 429 after five wrong, no code burned on scope/role/field refusals, passkey-only 403 without a counted try, factor lost, legacy token, unbound first token, code kept nowhere); existing tests adjusted. CI green on this head (tier A/B, registry, gates, pdisc).isNewPackagesplit out ofensurePackageso the name refusal precedes the code;refuseLostFactoradded tomayManageandcreateOrganisation; unbound cap (30 days) andunboundevent detail as specified; operator exempt.tokensmint, code burn on a lost name race, wrong-code events) are stated in the PR and README.Non-blocking: the issue's acceptance list mentions regenerating
skills/; CI is green without it, so fine if truly nothing feeds it.