Skip to content

Commit d3e096e

Browse files
feat: persist access token and metadata access token in seedless controller (#6060)
## Explanation - This update introduces two new tokens, accessToken and metadataAccessToken, to the SeedlessOnboardingController. - These tokens are essential for pairing with the profile sync auth service and accessing the metadata service before the vault is created or unlocked. - The changes include updates to the controller state, methods for handling these tokens, and corresponding tests to ensure proper functionality and error handling when tokens are missing. - Additionally, the vault data structure has been modified to include the new accessToken. Tests have been added to verify the correct behavior of the controller with respect to these tokens. - Removed unused nodeAuthTokens from vault. - Toprf sdk updated to use metadataAccessToken <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Changelog <!-- THIS SECTION IS NO LONGER NEEDED. The process for updating changelogs has changed. Please consult the "Updating changelogs" section of the Contributing doc for more. --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --------- Co-authored-by: lwin <[email protected]>
1 parent 525d662 commit d3e096e

File tree

9 files changed

+815
-107
lines changed

9 files changed

+815
-107
lines changed

packages/seedless-onboarding-controller/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Added `access_token` and `metadata_access_token` in seedless controller state. ([#6060](https://github.com/MetaMask/core/pull/6060))
13+
- `access_token` can be used by profile sync pairing and for other apis access after wallet is unlocked.
14+
- `metadata_access_token` is used to give access for web3auth metadata apis.
15+
1016
## [2.0.1]
1117

1218
### Fixed

packages/seedless-onboarding-controller/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"dependencies": {
5050
"@metamask/auth-network-utils": "^0.3.0",
5151
"@metamask/base-controller": "^8.0.1",
52-
"@metamask/toprf-secure-backup": "^0.4.0",
52+
"@metamask/toprf-secure-backup": "^0.6.0",
5353
"@metamask/utils": "^11.4.2",
5454
"async-mutex": "^0.5.0"
5555
},
@@ -64,6 +64,7 @@
6464
"@noble/hashes": "^1.4.0",
6565
"@types/elliptic": "^6",
6666
"@types/jest": "^27.4.1",
67+
"@types/json-stable-stringify-without-jsonify": "^1.0.2",
6768
"deepmerge": "^4.2.2",
6869
"jest": "^27.5.1",
6970
"jest-environment-node": "^27.5.1",

0 commit comments

Comments
 (0)