chore: Migrate SIWE dependency to @signinwithethereum/siwe v4#8419
Closed
caveman-eth wants to merge 1 commit intoMetaMask:mainfrom
Closed
chore: Migrate SIWE dependency to @signinwithethereum/siwe v4#8419caveman-eth wants to merge 1 commit intoMetaMask:mainfrom
caveman-eth wants to merge 1 commit intoMetaMask:mainfrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
5cd254a to
23641d3
Compare
Swap out unmaintained SpruceID SIWE packages for the @signinwithethereum successors. Updated dependencies and imports: controller-utils now depends on @signinwithethereum/siwe-parser (^4.1.0) and imports ParsedMessage in siwe.ts and siwe.test.ts; profile-sync-controller now depends on @signinwithethereum/siwe (^4.1.0) and imports SiweMessage in flow-siwe.ts. CHANGELOGs updated to document the migration. The public APIs used (ParsedMessage / SiweMessage) remain unchanged.
23641d3 to
a30c143
Compare
Author
|
temp closing to wait 3 day window for package update - we have a new version that impliments the EIP55 patch that you guys have made, natively into the siwe package Extension: .yarn/patches/@spruceid-siwe-parser-npm-2.1.0-060b7ede7a.patch |
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.
#edit:
superseeded by #8497
.
Explanation
Current state
The monorepo depends on two SIWE (Sign-In With Ethereum / EIP-4361) packages originally maintained by Spruce:
@spruceid/siwe-parserv2.1.0 — used by@metamask/controller-utilsto detect and parse SIWE messages viadetectSIWE()siwev2.3.2 — used by@metamask/profile-sync-controllerto construct SIWE login messages vianew SiweMessage({...}).prepareMessage()The Spruce
siwepackage is no longer maintained.Stewardship of the SIWE standard has moved to the Ethereum Identity Foundation (GitHub).
@signinwithethereum/siweis the official successor TypeScript implementation.Similar migrations:
x402-foundation/x402 x402-foundation/x402#1917,
magiclabs/magic-js magiclabs/magic-js#1074
What this PR does
Swaps the abandoned packages for the actively maintained successors. The
ParsedMessageandSiweMessageclass APIs are identical - same constructors, same fields, same methods. This is purely a dependency swap with import path updates.Files changed:
controller-utilspackage.jsoncontroller-utilssrc/siwe.tscontroller-utilssrc/siwe.test.tsprofile-sync-controllerpackage.jsonprofile-sync-controllersrc/sdk/authentication-jwt-bearer/flow-siwe.tsEIP-55 patches in client repos become obsolete
The old version strictly rejected non checksummed Ethereum addresses in SIWE messages. Because many dApps produce lowercase addresses, both MetaMask client repos maintain patches to disable the check — otherwise
detectSIWEreturns{ isSIWEMessage: false }and users don't see the specialized SIWE approval screen.@signinwithethereum/siwe-parserv4.2.0 (release notes) relaxes this:warnings: string[]field ofParsedMessageSiweMessageinstances are normalized to EIP-55If the client repos upgrade to this version of
controller-utils, they can delete these patches and any relatedpackage.jsonresolutions:metamask-extension/.yarn/patches/@spruceid-siwe-parser-npm-2.1.0-060b7ede7a.patchmetamask-mobile/patches/@spruceid+siwe-parser+2.1.0.patchReferences
@signinwithethereum/siwe-parseron npm@signinwithethereum/siweon npmChecklist