Skip to content

Support credentials in configuration for private PyPI #4315

@prokopst

Description

@prokopst

Right now credentials for index-url in the configuration are stored in the url itself. I propose to somehow support credentials directly (or explicitly) in the configuration for private PyPIs because of following reasons:

  1. Right now credentials are leaked on multiple places. With this configuration:
[global]
index-url = https://thisis:test@pypi.python.org/simple
[search]
index = https://thisis:test@pypi.python.org/pypi

pip install --help shows:

Package Index Options (including deprecated options):
-i, --index-url Base URL of Python Package Index (default https://thisis:test@pypi.python.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.

pip search --help shows:

Search Options:
-i, --index Base URL of Python Package Index (default https://thisis:test@pypi.python.org/pypi)

  1. With more exotic characters in the password it's not possible to use credentials in url at all:
[global]
index-url = https://username:pass/@word@pypi.python.org/simple
[search]
index = https://username:pass/@word@pypi.python.org/pypi
  1. AFAIK NuGet, mvn and npm support explicit auth since it's a good practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: configurationConfiguration management and loadingauto-lockedOutdated issues that have been locked by automationtype: enhancementImprovements to functionalitytype: securityHas potential security implications

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions