What is a proxy (remote) repository and what is dependency confusion?
AdvancedConceptBuild Tools and Artifact Repositories
Answer
A proxy repo caches an upstream registry. Dependency confusion is an attack where someone publishes a public package with the same name as your private internal package and a higher version, tricking resolvers that check public sources into pulling it. Mitigations: use scoped names (@org/pkg), configure the resolver so internal namespaces resolve only from the private repo (Nexus/Artifactory routing rules, npm scope registry mapping, pip --index-url instead of --extra-index-url), and reserve your names on public registries.
# .npmrc
@acme:registry=https://nexus.example.com/repository/npm-private/
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerWhat is the difference between `mvn package`, `install` and `deploy`?BeginnerHow do Maven dependency scopes and transitive dependencies work?IntermediateWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?Intermediate