feat(kyc-controller): persist and reuse idOS sessionClientPrivateKey - #10081
Closed
jiexi wants to merge 2 commits into
Closed
feat(kyc-controller): persist and reuse idOS sessionClientPrivateKey#10081jiexi wants to merge 2 commits into
jiexi wants to merge 2 commits into
Conversation
Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
Member
Author
|
prefer this for now https://github.com/consensys-vertical-apps/va-mmcx-kyc-api/pull/47 |
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.
Explanation
idOS capability auth updating requires the sessionClientPrivateKey used at session creation to be known. This means it must be persisted for the lifetime of the session so that it can be reused later. This PR makes that change
References
Checklist
Note
Medium Risk
Persists a session-scoped cryptographic private key in controller state and changes UKYC session lifecycle teardown; mistakes could break authorization wrapping or leave stale keys attached to invalid sessions.
Overview
Adds
idosSessionClientPrivateKeyto KycController state so the per-session X25519 key used to wrap UKYC/idOS authorizations survives restarts and can be reused for later capability updates.UKYC session creation now goes through
#getOrCreateIdosSessionClientPrivateKey(reuse persisted key or generate once) instead of a fresh random key on every create;#clearUkycSessiondrops the key together with SumSub session state onreset(), consents-path failures, and related rewind paths. State metadata marks the field persisted and never logged; architecture docs are updated to match.Tests cover cold-start reuse, stable key across session-create retries, and clearing when flows are reset or consents fail.
Reviewed by Cursor Bugbot for commit ba1b354. Bugbot is set up for automated code reviews on this repo. Configure here.