Allow authentication header to be passed-thru to upstream when resolving packages. #118
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.
I love sinopia. It's shaping up to be like the swiss-army knife for bespoke npm registry setups.
Let me explain what this is for a little. We want to roll our own private NPM registry for our internal packages. However, we already have multiple sinopia proxies in place for different geographical locations. These proxies currently require no authentication, as they were just there to speed up resolving requests to the public NPM registry. Now that we want private NPM endpoints, we want developers to be able to continue using the "edge proxies" - but certain packages will split out to hit a different registry. When that happens, we want to be able to put sinopia into a sort of "dumb mode", in which its own ACL is ignored, but it forwards the request including any given authentication data to the upstream.
One of the primary reasons we want to do this is to avoid needing to roll authentication on every edge locations. Here's a naive example of how this PR would be useful:
Imagine this in your config.yaml:
In the example above, this PR will ensure that sinopia doesn't do any ACL checks, but passes the inbound authentication header along to the
private-registry
.An aside, part of this use-case is we're going to want to be able to completely disable resolved packages from upstream being persisted in local storage for certain package patterns. Is that currently possible? If not, I'll be submitting another PR for that :)