Add npm virtual repositories #152
Reference in New Issue
Block a user
Delete Branch "benvin/virtual-npm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
npm clients need one registry for internal and public packages, but npm virtuals have no merger, so a local npm repo and npmjs cannot be served together.
install-v1) packuments, scoped names included, via the shared virtual merge cache<virtual>/<member>/<path>and 302 them to the owning memberno-storewithVary: Host, X-Forwarded-Proto, Acceptdocs/npm/virtual.mdand a stocknode:22e2e-docker caseproxyBaseURLis built from rawr.Hostand anyX-Forwarded-Protovalue with no validation, then written into every rewritten tarball URL (npm_merger.go:203) and used in the cache key; a crafted Host (e.g.x@evil.com) or proto yields tarball URLs npm will fetch from an attacker host → validate host (validHost) and scheme (https/http only, sharedScheme()) before FetchNPM/MemberRedirect and return 400; both helpers live only in benvin/nuget-followups, so land/rebase on that rather than adding a second copy.Vary/Cache-Control→ a shared cache can serve one host's rewritten URLs, or the abbreviated doc, to other clients; setVary: Accept, Host, X-Forwarded-ProtoandCache-Control: no-store.evictOldestruns on every request including cache hits, scanning alle.genskeys under the global mutex → only call it whenmergedinserted a new key.No findings.