-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I have a project that uses a private JFrog Artifactory repository to host internal packages, and as a proxy for PyPi. I just noticed that calling uv add internal_package==specific_version when overriding with UV_DEFAULT_INDEX will leak credentials into the pyproject.toml file, even if the lockfile isn't modified.
Original index entry (company name redacted):
# Set JFrog Artifactory as the default index.
[[tool.uv.index]]
name = "internal"
url = "https://repos.internal.com/artifactory/api/pypi/internal-pypi/simple"
default = true
Command (a no-op, since the package version already exists as a dependency):
$uv add internal_package==version
Resolved M packages in 2ms
Audited N packages in 0.87ms
After running that command, the tool.uv.index section has removed the name = internal line, inserted the full repo URL, including authentication tokens, and removed the comments:
[[tool.uv.index]]
url = "https://USERNAME:[email protected]/artifactory/api/pypi/internal-pypi/simple"
default = true
Summary:
- I was not expecting credentials to get saved to
pyproject.toml - I was not expecting that setting
UV_DEFAULT_INDEXbefore runninguv addwould modifypyproject.tomlat all (including removing comments).
uv version 0.4.25
Avasam and gaspardc-met
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working