CICD-373 · Dependency confusion prevention
Encyclopedia · Advanced security and compliance · All snippets
Previous · CICD-372 · Next · CICD-374
1. Where it fits
- Placement pyproject.toml uv fragment.
- Prerequisites reviewed policies, a short-lived CI identity, and synthetic or approved test inputs.
- Platforms local-lab.
2. Copy the snippet
toml
[[tool.uv.index]]
name = "internal"
url = "https://packages.example.com/simple"
explicit = true
[tool.uv.sources]
internal-lib = { index = "internal" }3. How it works
The explicit index is used only for packages deliberately assigned to it. The per-package source mapping tells uv where the private dependency belongs.
4. Verify the result
Bind private names to a named index, keep secrets outside the file and verify the source in uv.lock.
Validation syntax-validated (TOML parse). Status definitions.