Repository navigation
feat(kyc-controller): Add ukycCapabilityToken refresh - #10692
Merged
Merged
Conversation
startSession()
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@metamaskbot update-changelogs INFRA-4093 test. This checks token exchange for the changelog update on a PR that already changes a changelog. It is not a review request. This PR will be left open. |
Contributor
|
✅ No changelog changes needed. |
startSession()startSession() and refreshSessionStatus()
startSession() and refreshSessionStatus()Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a92889a. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
The changelog check only reads a pull request link from the first line, so the wrapped #10692 links were ignored. Co-authored-by: Cursor <cursoragent@cursor.com>
…ability-token-refresh
Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
…en-refresh' into jl/kyc-controller-capability-token-refresh # Conflicts: # packages/kyc-controller/CHANGELOG.md # packages/kyc-controller/src/KycController.ts
Akaryatrh
previously approved these changes
Oct 9, 2026
The continuation lines were under-indented, which failed lint:misc. Co-authored-by: Cursor <cursoragent@cursor.com>
jiexi
enabled auto-merge
October 9, 2026 22:06
Akaryatrh
approved these changes
Oct 9, 2026
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.

refreshSessionStatus()asyncukycCapabilityTokenexpiry check viaSessionStatus.capabilityAuthorizationStatusstartSession()orrefreshSessionStatus()is calledrefreshSessionStatus()Note this is purposely not included during polling for simplicity's sake.Note this is not included during polling due to race conditions introduced withclearState()/reset()which can be resolved with a separate explicit call to resume/init. The ukycCapabilityToken lives for 72h which will far exceed the time the wallet is kept alive in the onboarding screensSee: https://consensyssoftware.atlassian.net/browse/KYC-29?atlOrigin=eyJpIjoiODU1NTA2ODg5YjBmNGNkZWE4M2ZmZDVkMWRkZmQzZWEiLCJwIjoiaiJ9
Screen.Recording.2026-10-07.at.11.42.48.AM.mov
Note
High Risk
Changes KYC session resume, cryptographic wrapping-key rotation, and when authorizations are submitted—security-sensitive identity flows with altered
startSessionand provider-launch assumptions.Overview
Adds UKYC capability authorization refresh when resuming a session:
startSessionnow loads the latest session status and, whencapabilityAuthorizationStatusisneworexpired(and KYC is not alreadyapproved/rejected), mints a new X25519 keypair, callsKycService.resetWrappingKeys(POST /sessions/{id}/wrapping-keys), and resubmits wrapped secrets viasetAuthorizations.refreshSessionStatusis narrowed to return the persisted session and only start polling for non-terminal statuses—it no longer fetches status or refreshes capability auth. Polling likewise updates status only and does not trigger authorization refresh (tests lock this in). The SumSub provider launch path is simplified to assume authorizations are already valid on state.The package exports capability/KYC status helpers (
needsCapabilityAuthorizationRefresh, related constants), parses optionalcapabilityAuthorizationStatuson session status responses, and documents the changes in the changelog.Reviewed by Cursor Bugbot for commit fe7a3cd. Bugbot is set up for automated code reviews on this repo. Configure here.