feat(passkey): bind passkey session to contract and network (#390) - #454
Merged
karagozemin merged 2 commits intoOct 1, 2026
Merged
Conversation
…-Issue#390) - Record contract ID, network passphrase, and account when passkey session starts - Refuse commits when contract ID, network passphrase, or account differ from target client - Surface typed SubRosaSessionMismatchError in passkey panel instead of submitting - Scrub raw secret seeds from all error text and demo traces - Add web fixture tests and SDK network mismatch validation tests
|
@nazteeemba Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
4 tasks
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.
Summary
closes #390.
Ensures a passkey session can only commit a bid to the specific contract ID, network passphrase, and account captured when the session was created. If any of these differ from the target SDK client at submit time, submission is rejected and a typed error is surfaced.
Changes
SDK Session Binding & Validation:
PasskeySessionBindingandSessionBindingTargetin@sub-rosa/sdk.validatePasskeySession()to verify contract ID, network passphrase, and account before simulation or submission.sessiontoSubRosaClientConfigandCommitParams.SubRosaClient.commit()andSubRosaClient.preflightCommit().SubRosaSessionMismatchError(subclassingSubRosaNetworkMismatchError)./\bS[A-Z2-7]{55}\b/g) to prevent private keys/seeds from leaking in mismatch errors.Web App Session Management & Verification:
passkey-config.tswithcreatePasskeySession()and safe dual-environment support (import.meta.env/process.env).VITE_PASSKEY_CONTRACT_ID/VITE_PASSKEY_NETWORK_PASSPHRASEand contract/network settings inapps/web/src/lib/config.ts.PasskeyPanel.tsxto record session binding upon credential creation / wallet deployment and reject swapped client targets with a typed alert (data-testid="passkey-error").trace-health-check.ts).Acceptance Criteria
Test Results
pnpm sdk:test)pnpm sdk:typecheck)pnpm web:test)pnpm web:typecheck)pnpm web:build)