-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: add --provenance-file flag for publish command #6490
Conversation
This and the |
f98e6f4
to
980cb0f
Compare
no statistically significant performance changes detected timing results
|
980cb0f
to
98e288f
Compare
98e288f
to
876ff32
Compare
879a8c8
to
7392c02
Compare
workspaces/libnpmpublish/README.md
Outdated
* `opts.provenanceFile` - specifies the path to an externally-generated | ||
provenance statement to be published alongside the package. Mutually | ||
exclusive with the `provenance` option. |
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.
Should there be a note about the format of the provenance statement? Maybe also note that it should already be signed so that it's clear that npm isn't going to do signing for you?
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.
Yeah, good call. I'll update
Signed-off-by: Brian DeHamer <bdehamer@github.com>
7392c02
to
6b9138d
Compare
Whoops, didn't realize it was private. The line I was linking to is just this:
|
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 looks ready to me. We can button up the reflective checks of exclusive
in another PR.
@lukekarrys will be landing this. @ianlewis do you see any show stoppers here?
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.
@wraithgar @bdehamer LGTM. I tested your branch out and it worked the way I expected.
You may want to update the PR title to reflect that the flag is --provenance-file
rather than --provenance-path
.
Updates the
publish
command to accept a new--provenance-file
option which points to an externally-generated provenance statement. If specified, the provenance statement will be read, verified and published as an attachment to the package.Before the provenance is passed to the registry, there are some basic sanity checks like ensuring that the subject name/digest present in the provenance statement match the package being published. The signature in the provenance bundle is also verified to ensure it matches the package. More thorough verification checks are performed by the registry before it accepts the package for publishing.
This PR also introduces a mechanism to configure sets of flags whose use is mutually exclusive. This is currently applied to the
--provenance
and--provenance-file
flags, but can be generally used for any flag sets with similar semantics.Mutually-exclusive flags will appear like this in the help output:
An attempt to use exclusive flags at the same time will result in an error which looks like this: