Skip to content
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

config: accept auth tokens from environment variables #8

Merged
merged 1 commit into from
Aug 3, 2018

Commits on Jul 23, 2018

  1. config: Search for authentication token defined by environment variable

    As discussed on npm.community[1], the fact that
    npm registry authentication tokens
    cannot be defined using environment variables
    does not seem justified anymore.
    
    The restriction is caused by the config loader translating
    * all `_` to `-`
    * the whole variable name to lowercase
    while the credential checker expects a key ending in `:_authToken`.
    
    This change fixes the problem
    by having the credential checker try
    a key ending in `:-authtoken` after it tried `:_authToken`.
    
    Closes npm/npm#15565
    
    [1]: https://npm.community/t/cannot-set-npm-config-keys-containing-underscores-registry-auth-tokens-for-example-via-npm-config-environment-variables/233
    mkhl committed Jul 23, 2018
    Configuration menu
    Copy the full SHA
    ff44be1 View commit details
    Browse the repository at this point in the history