This repository has been archived by the owner on Oct 23, 2022. It is now read-only.
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.
Add support for token helper, a command line tool to obtain a token.
A token helper is an executable, set in the user's
.npmrc
whichoutputs an auth token. This can be used in situations where the
authToken
is not a constant value, but is something that refreshesregularly, where a script or other tool can use an existing refresh
token to obtain a new access token.
The configuration for the path to the helper must be an absolute path,
with no arguments. In order to be secure, it is only permitted to set
this value in the user
.npmrc
, otherwise a project could place a valuein a project local
.npmrc
and run arbitrary executables. For thisreason, the userConfig is added as a third parameter to the
function, to enable only allowing this value from that
.npmrc
.A similar feature is available in many similar tools. The implementation
here is modelled after the
vault
(vaultproject.io) implementationI have a PR ready to go for pnpm itself to use this. I'll raise that shortly, even though that will rely on this, and require the new version of this package to be published.