-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix request authentication for scoped private registry tarballs (#1666)
* Fix request authentication for scoped private registry tarballs Yarn correctly sends authorization headers when resolving metadata, but when it's time to download the tarballs, it calls registry.request with a full tarball url. This causes the getRegistry() function to incorrectly return the DEFAULT_REGISTRY url which means the authorization headers are no longer sent. The response in this case is a JSON error object instead of a tarball file. Untaring fails with "invalid tar file" * Don't assume anything about the registry URL, read registries from config * Add a test for installing private packages requiring authentication * Change the authed package testing strategy to be more local * Include non scoped registries in available registries list * Unnest the authed pkg test, use FlowFixMe for afterEach
- Loading branch information
1 parent
bacf1fb
commit 99916d4
Showing
6 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
__tests__/fixtures/install/install-from-authed-private-registry/.npmrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//registry.yarnpkg.com/:_authToken=abc123 | ||
@types:registry=https://registry.yarnpkg.com/ |
5 changes: 5 additions & 0 deletions
5
__tests__/fixtures/install/install-from-authed-private-registry/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"@types/lodash": "4.14.37" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters