Repository navigation
SDK bindings for recovery credentials and V2 password reset - #1435
Draft
w3irdrobot wants to merge 3 commits into
Draft
w3irdrobot wants to merge 3 commits into
w3irdrobot wants to merge 3 commits into
Conversation
Add TypeScript and Rust bindings for the recovery-code endpoints and the seed-preserving password reset from #904: - recovery code status, enroll, rotate and disable, each with the current-password step-up; the React context guards them against an account switch mid-request - V2 reset options and completion, which preserve data with a recovery code or require an explicit data-loss acknowledgment, then install the returned token pair - Rust Debug output redacts recovery codes, passwords and reset secrets The legacy confirm endpoint is unchanged; its docs now note it is destructive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update the local-path consumer lockfiles to the new crate version. Published npm pins in the apps are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
Contributor
Author
|
Kept in draft until #904 merges |
complete_password_reset installed the returned tokens unconditionally after awaiting the response, so a sign-in or sign-out while the reset was in flight could be overwritten by the reset account. Capture the token generation before sending and install only if it is unchanged; otherwise zeroize the tokens and return an authentication error, matching the TypeScript SDK's snapshot guard. Add delayed-response regression tests for both cases. CompletePasswordResetResponse now redacts its tokens in Debug output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Exposes #904's recovery-code management and seed-preserving password reset in both SDKs. Both already send everything over Transport V2, so the new V2-only routes need no transport changes.
api.ts/ context)OpenSecretClient)GET /protected/recovery-codefetchRecoveryCodeStatus/getRecoveryCodeStatusget_recovery_code_statusPOST /protected/recovery-code/enrollenrollRecoveryCodeenroll_recovery_codePOST /protected/recovery-code/rotaterotateRecoveryCoderotate_recovery_codeDELETE /protected/recovery-codedisableRecoveryCodedisable_recovery_codePOST /password-reset/v2/optionsfetchPasswordResetOptions/getPasswordResetOptionsget_password_reset_optionsPOST /password-reset/v2/completecompletePasswordResetcomplete_password_reset{mode: "preserve", recoveryCode}or{mode: "destructive", acknowledgeDataLoss: true}); in Rust it'sPasswordResetCompletion. Both serialize to the server's externally taggedmode.Debugoutput redacts recovery codes, passwords and reset secrets.confirmPasswordReset/confirm_password_resetbehave the same as before; their docs now say they are destructive and point to the V2 flow.@mapleai/sdk4.3.0 andmaple-sdk4.2.0, with the local-path consumer lockfiles (Agent, Research, proxy) updated to match. Published npm pins in the apps are unchanged, and nothing is published.Verification
Run locally in the SDK Nix shell:
format:check,build, and the credential-free unit suite, including the newrecoveryCredentials.test.ts(wire shapes, token install on completion, DELETE with a body, error statuses, account-switch guard).cargo fmt --check,clippy --all-targets --all-features -D warnings,--libtests (126 passed, including the new wire-shape and redaction tests),cargo doc.scripts/ci/verify-local-rust-deps.sh: Maple resolvesmaple-sdk4.2.0 from localsdk/rust.api.test.ts: 16 passed.account_management: 7 passed, 3 ignored (the existing email-only tests).Not verified:
test-recovery-flow.shcovers that.os-sdk-e2elane locally.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.