-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add script for signing, verifying, and deploying registry #18
Conversation
2ceea77
to
5673658
Compare
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.
Code here looks good to me. A few questions about whether this is the direction we should go or not. Will leave them to @ritave
scripts/verify-registry.ts
Outdated
* The `PUBLIC_KEY` environment variable must be set to the public key of the | ||
* private key that was used to sign the registry. | ||
*/ | ||
async function main() { |
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 should probably go into snaps-utils
so we can use it in the SnapController to verify.
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.
Unless we manually sign, then this is a good check for CI to do.
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.
I like it
This adds two new scripts:
yarn sign
: Signs the registry with the givenPRIVATE_KEY
environment variable, and writes the signature tosrc/signature.json
.yarn verify
: Verifies the signature with the givenPUBLIC_KEY
environment variable.It also adds a workflow which will run on commits to main (not on PRs), which checks if the
registry.json
was updated, and will deploy it togh-pages
if so.fixes: https://github.com/MetaMask/MetaMask-planning/issues/377