cli icon indicating copy to clipboard operation
cli copied to clipboard

[DOCS] unable to set scoped credentials via environment variable

Open everett1992 opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

This is a CLI Docs Problem, not another kind of Docs Problem.

  • [X] This is a CLI Docs Problem.

Description of Problem

npm prints a warning whenever _auth is used without scoping the credential and a custom registry is configured.

$ NPM_CONFIG_REGISTRY=http://localhost:8080 NPM_CONFIG__AUTH=TOKEN npm -v

npm WARN config `_auth`, `_authToken`, `username` and `_password` must be scoped to a registry. see `npm help npmrc` for more information.
8.19.1

I can't find any way to set the scoped _auth as an environment variable. NPM_CONFIG_//localhost:8080/:_AUTH=TOKEN does not work.

My use case involves short-lived project specific credentials. I don't want to add them to global or user config because the credentials are only valid for a specific project and projects could be built in parallel, I don't want to add them to the project .npmrc because that is checked in to source control.

Potential Solution

  • Define (or document if it exists) a pattern for scoped config environment variables
  • Define (or document if it exists) a pattern for scoped command line configuration
  • Add an option to suppress this warning
  • Add a project specific but not checked in config file location

Affected URL

No response

everett1992 avatar Sep 07 '22 02:09 everett1992