Repository navigation
feat(vault): migrate the remaining wallet callers to useSessionSigning (A6-T3b) - #396
Merged
Merged
Conversation
…g (A6-T3b) Migrates the four remaining wallet-domain callers onto the unified useSessionSigning entry, closing the vault-session signing gaps for claim rewards, community creation, change password and the recovery-account warning. - claim-rewards-banner: claim_reward_balance signs at the posting floor (privateKey: the #378 session-key chain posting -> active -> owner via the hook; vault: the per-key password dialog, so the "skip restore -> re-auth dialog -> vaultUnsupported notice" chain is gone and the keyless hint hides). The device-remembered posting-key restore (#375/#378) stays a privateKey-session affordance that signs directly with the restored key: it sits between posting and active in the resolution order and exists in no session the unified entry could read; vault sessions never read it (invariant 21, pinned with the storage-prototype spy). - communities-section: account_create at the active floor and the community subscribe custom_json at the posting floor (payload-based classifier: required_posting_auths). The hivemind setup ops (setRole / updateProps) keep signing directly with the NEW community owner's freshly derived active key (a key that exists in no session). The activeKeyRequired gate widens for a page-matching vault session. - change-password-section: account_update (owner-class by payload inspection) at the owner floor. The ACCOUNT password in the form still derives and verifies the new keys (unchanged); the VAULT password the signing dialog asks for is a separate secret, kept apart by a vault-session-only note (four locales) and pinned by tests. A keyless privateKey session now gets explicit owner-key guidance (ownerKeySessionRequired) instead of silently signing with the form-derived owner key. - recovery-warning-banner: change_recovery_account at the owner floor; the owner-key gate widens for a page-matching vault session, keyless privateKey sessions keep the disabled submit + notice. Classifier pins added for the T3b operation shapes (claim tuple, account_create, community custom_json, authority-rotating account_update, change_recovery_account); the hook's posting-floor chain (posting -> active -> owner) pinned in its suite; docs refreshed with the remaining direct-SteemSigner inventory (T4 market/proposals/witness, permanent login-challenge/recovery paths, the two no-session-key remnants). Part of #381
- docs(09-vault/02-auth): record the change-password privateKey key-source change (a keyless-owner session now re-authenticates with the master password / owner WIF — deriving the same owner key — instead of silently signing with the form-derived owner key); correct the "keyless privateKey sessions keep the pre-existing gates" clause per-caller (change-password's ownerKeySessionRequired gate is NEW — there was no gate before); add the change-password entry to 02-auth's signing inventory. - change-password: buildAccountUpdateForPasswordChange is now OPERATION-ONLY — it no longer materializes an owner WIF every T3b caller discarded; the current-password check lives in verifyCurrentPasswordMatchesAccount alone, and a lib test pins the non-derivation (mutation-guarded: restoring the eager resolveOwnerSigningKey inside the builder fails two tests). - tests: cancel-path coverage for claim-rewards-banner and recovery-warning-banner (cancelled -> silent return, no broadcast, surface stays usable), matching the communities/change-password suites; restore the thrown-error display pins for the claim banner's two residual catch blocks (remembered-key direct-path sign rejection and the hook-signed broadcast transport throw). - e2e spec header: stop overclaiming the remembered-key non-read (that invariant is pinned by the unit suite's Storage-prototype spy, not the spec). Part of #381
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #381
Summary
A6-T3b: migrates the four remaining wallet-domain callers onto the unified
useSessionSigning()entry, closing every wallet-domain vault-session signing gap. Vault identity sessions now sign claim rewards, community creation (creator-paid steps), password change and recovery-account counter-requests through the per-key password dialog; privateKey behavior is preserved exactly (no pre-check, no extra network calls, same key resolution order). Operation tuples are byte-identical to the retiredSteemSigner.*builders; broadcast routes and payloads unchanged.Per-caller role floors and classifier state:
claim_reward_balanceat the posting floor (table entryclaim_reward_balance: 'posting'). privateKey sessions resolve posting → active → owner through the hook — exactly the fix(wallet): sign claim rewards with any session key per chain semantics #378 session-key remainder; the device-remembered posting-key restore (fix(wallet): make Redeem Rewards actionable without a session posting key #375/fix(wallet): sign claim rewards with any session key per chain semantics #378) keeps its slot between posting and active and still signs directly with the restored key (device-storage material that exists in no session the unified entry can read; privateKey sessions only — a vault session never reads it, invariant 21, pinned with the storage-prototype spy). Vault sessions get the password dialog directly: the "skip restore → re-auth dialog →vaultUnsupportednotice" chain is retired and the keyless hint hides. The keyless privateKey path still opens the classic re-auth dialog.account_createat the active floor (table entry; same resolution as the previoususeActiveSigningKey); the community subscribecustom_json(payload-based:required_posting_authsnon-empty,required_authsempty) at the posting floor. The hivemind setup ops (setRole/updateProps) keep signing directly with the NEW community owner's freshly derived active key — an account created seconds earlier whose key exists in no session. TheactiveKeyRequiredgate widens for a page-matching vault session.account_updatecarrying rotated owner/active/posting authorities is owner-class by payload inspection →role: 'owner'. The form's ACCOUNT password still derives and verifies the new keys (lib/wallet/change-password.tsunchanged); the VAULT password the signing dialog asks for is a separate secret — kept apart by a vault-session-only note (vaultPasswordNote, four locales) and pinned by tests (exact request shape{operations, accountName, role}— no password material rides along; a pending/wrong-password dialog never touches derivation state).change_recovery_accountat the owner floor (table entry). The owner-key gate widens for a page-matching vault session; keyless privateKey sessions keep the disabled submit + notice;needsClassicReauthsurfaces the existing owner-key copy.Round-1 review fixes (second commit)
09-vault.md's A6 progress block (a keyless-owner session re-authenticates with the master password / owner WIF — which derives the same owner key — instead of silently signing with the form-derived owner key), the "keyless privateKey sessions keep the pre-existing gates" clause is corrected per-caller (change-password'sownerKeySessionRequiredgate is NEW — there was no gate before), and02-auth.mdcarries the change-password inventory entry.lib/wallet/change-password.ts:buildAccountUpdateForPasswordChangeis now OPERATION-ONLY — it no longer materializes an owner WIF viaresolveOwnerSigningKeythat every caller discarded; the current-password check lives inverifyCurrentPasswordMatchesAccountalone, and a lib test pins the non-derivation (mutation-guarded).cancelled→ silent return, no broadcast, surface stays usable.recover-account-step-1-page.tsx's verify helpers (isValidPrivateKey/privateKeyToPublicKey/derivePrivateKeyFromPassword) added to the non-signing direct-SteemSignerhelpers below; the e2e spec header no longer overclaims the remembered-key non-read (that invariant is pinned by the unit suite's Storage spy, not the spec).Implementation notes
SteemSignerconsumers ("who still signs directly") after this PR:market-page-client.tsx(signLimitOrderCreate/signLimitOrderCancel),proposals-page-client.tsx(signUpdateProposalVotes),proposals/proposal-creator-dialog.tsx(signCreateProposal),proposals/proposal-remove-dialog.tsx(signRemoveProposal),witness-vote-form.tsx(signWitnessVote/signWitnessProxy).login-form.tsx(signChallenge+ key derivation helpers),recover-account-confirmation-page.tsx(signRecoverAccountdual old+new owner signatures — invariant 20; the recovery pages were NOT touched and verified to still use the dedicated dual-sign path), plus NON-SIGNING helpers that derive/validate only and never broadcast:recover-account-step-1-page.tsxverify helpers (isValidPrivateKey/privateKeyToPublicKey/derivePrivateKeyFromPassword),account-keys.ts,change-password.ts.claim-rewards-banner.tsxremembered-posting-key branch andcommunities-section.tsxhivemind setup ops (keys that exist in no session).claim_reward_balance/account_create/change_recovery_accountwere already inOPERATION_AUTHORITY_CLASSESandaccount_update/custom_jsonare payload-based. New pin tests guard the exact T3b caller shapes (including the previously unpinnedaccount_create).resolveSessionSigningRolealready resolves any floor; a new pin covers the posting-floor chain (posting → active → owner).ownerKeySessionRequiredguidance instead of a silent success. Whenever both keys exist (master-password or owner-WIF login) the same key signs as before. Communities subscribe now signs with the least-privileged session key at-or-above posting (previously always the active key — chain-equivalent per posting/active/owner downward coverage).wallet.changePasswordPage.*keys (ownerKeySessionRequired,signingFailed,vaultPasswordNote) ×4 locales.09-vault.md(module map + invariant 21 consequences + known-gaps list + A6 progress with the direct-signer inventory),02-auth.md(signing-entry inventory, change-password key-source note, claim convention),06-frontend.md(key-selection rule status).Test plan
pnpm verifygreen (type-check + lint + unit tests + coverage ≥ thresholds + build). Lint's 3 warnings are pre-existing in untouched files.tests/unit/wallet-t3b-session-signing.test.tsx: communities / change-password / recovery-warning × session shapes (privateKey-with-key signs the byte-identical tuple; vault session gets the action and completes; keyless privateKey keeps the old gate) + tuple pins (account_create payload, subscribe custom_json, authority-rotating account_update with derived new keys, change_recovery_account tuple) + the separation trap + the recovery cancel path.tests/unit/claim-rewards-banner.test.tsx: exact posting-floor tuple pin, typed-error/cancel paths, remembered-key direct signing pinned (incl. remembered-beats-active ordering and the thrown-sign-error display), broadcast transport-throw display, and the extended invariant-21 vault test (never reads the remembered key, no direct sign/broadcast, no re-auth dialog/notice).claim-rewards-reauth-flow.test.tsxupdated for the hook path.tests/unit/change-password.test.ts: operation-only builder pinned, including the mutation guard that fails if eager owner-key derivation is restored inside the builder.vault-signer.test.ts: classifier pin for all T3b shapes;use-session-signing.test.tsx: posting-floor chain pin.pnpm e2egreen — including the new vault-session claim flow invault-session-signing.spec.ts(posting floor offers BOTH stored keys as radios, posting key picked, byte-identical full-pending claim tuple broadcast, zero/api/auth/*traffic).Not verified or known limits
SteemSignercall by design (see Implementation notes) — a future task could dispatch the restored key into the session instead, at the cost of a new sanitized Redux action.