-
Notifications
You must be signed in to change notification settings - Fork 637
feat!: Support specified clientVersions in the registry
#3737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
clientVersions in the registryclientVersions in the registry
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3737 +/- ##
=======================================
Coverage 98.28% 98.28%
=======================================
Files 418 418
Lines 12163 12175 +12
Branches 1881 1886 +5
=======================================
+ Hits 11954 11966 +12
Misses 209 209 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| expect(result).toBe('1.0.0'); | ||
| }); | ||
|
|
||
| it('resolves to a compatible allowlisted version', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test to make sure we resolve to 1.1.0 if the client version allows for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds a new required constructor argument to
JsonSnapsRegistrycalledclientConfig. By using this constructor argument we can determine if a Snap version is compatible with the client version that the user is running. This can be done by comparing the constructor argument to the optional client metadata in the registry when resolving the allowlist version.Note
Adds a required
clientConfigtoJsonSnapsRegistryand uses registryclientVersionsto verify and resolve only client-compatible Snap versions.clientConfigtoJsonSnapsRegistryand store as private field.SnapsRegistry:get), require checksum match and client compatibility usingclientVersions[clientConfig.type]viasatisfiesVersionRange.SnapsRegistry:resolveVersion), filter allowlisted versions to those compatible with the provided client before selecting withgetTargetVersion.@metamask/snaps-registryto^3.3.0insnaps-controllersandsnaps-utils(lockfile updated).Written by Cursor Bugbot for commit 9176886. This will update automatically on new commits. Configure here.