Allow any registry to be used for auditing #6484
Open
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.
Summary
Allow auditing against any registry. This is useful for auditing against a private or whitelisted registry.
For example, in our organisation npmjs is allowed while yarnpkg is blocked :(
Test plan
Command:
yarn audit
Output:
An unexpected error occurred: "https://registry.yarnpkg.com/-/npm/v1/security/audits: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
Command:
yarn audit --registry https://registry.npmjs.org
Output:
0 vulnerabilities found - Packages audited: 46500
Command:
yarn audit --registry https://artifactory.dev.company/artifactory/api/npm/npm-dev
Output:
error Your configured registry "https://artifactory.dev.company/artifactory/api/npm/npm-dev" does not support audit requests.