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

_auth key does not work for scope-specific configuration #2299

Closed
rtsao opened this issue Jan 28, 2020 · 4 comments · Fixed by #2314
Closed

_auth key does not work for scope-specific configuration #2299

rtsao opened this issue Jan 28, 2020 · 4 comments · Fixed by #2314
Assignees
Milestone

Comments

@rtsao
Copy link
Contributor

rtsao commented Jan 28, 2020

pnpm version:

4.8.0 and/or master

Code to reproduce the issue:

Failing test added here: https://github.com/rtsao/pnpm/tree/failing-test in rtsao@d03140e

Suppose the username is foo and password is bar.

registry = https://registry.npmjs.org/
@myscope:registry = https://my.registry.com/
//my.registry.com/:_auth = Zm9vOmJhcg==
//my.registry.com/:always-auth = true

Expected behavior:

Packages with @myscope/ should be fetched from my.registry.com using the legacy _auth key provided.

Actual behavior:

401 Unauthorized

Additional information:

Note that the following (equivalent config) does work:

registry = https://registry.npmjs.org/
@myscope:registry = https://my.registry.com/
//my.registry.com/:username = foo
//my.registry.com/:_password = YmFy
//my.registry.com/:always-auth = true
@zkochan
Copy link
Member

zkochan commented Jan 28, 2020

Does it work with npm? Maybe this legacy authentication was not added for scoped registries

@rtsao
Copy link
Contributor Author

rtsao commented Jan 28, 2020

Does it work with npm? Maybe this legacy authentication was not added for scoped registries

Yes, this configuration works using the npm client (as well as yarn).

@zkochan
Copy link
Member

zkochan commented Jan 28, 2020

We use this package to get the auth tokens. Maybe it needs an update

@zkochan zkochan self-assigned this Feb 1, 2020
@zkochan zkochan added this to the v4.9 milestone Feb 1, 2020
zkochan added a commit to pnpm/credentials-by-uri that referenced this issue Feb 2, 2020
zkochan added a commit to pnpm/credentials-by-uri that referenced this issue Feb 2, 2020
zkochan added a commit that referenced this issue Feb 2, 2020
zkochan added a commit that referenced this issue Feb 2, 2020
close #2299

BREAKING CHANGE:

- fetch-from-npm-registry API
zkochan added a commit that referenced this issue Feb 2, 2020
PR #2314
close #2299

BREAKING CHANGE:

- fetch-from-npm-registry API

Co-authored-by: Ryan Tsao <ryan.j.tsao@gmail.com>
@zkochan
Copy link
Member

zkochan commented Feb 2, 2020

🚢 4.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants