Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a PEEP for dedicated credential fields #3111

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions peeps/PEEP-003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# PEEP-003: Dedicated fields for source credentials

This PEEP proposes to add dedicated fields to contain credentials that will be
url-encoded for a private index.


For now, the easiest way to install packages from a private index is to use
environment variables in the Pipfile:

```
[[source]]
url = "https://$USERNAME:${PASSWORD}@mypypi.example.com/simple"
verify_ssl = true
name = "pypi"
```

But these variables may contain special characters that need to be encoded. For
instance:

```bash
USERNAME="my#username"
```

This can be done manually with [`urllib.parse.quote()`](https://docs.python.org/3.7/library/urllib.parse.html#urllib.parse.quote)
for instance, but it makes the process less smooth for the user.

This PEEP proposes to add fields to store credentials that will be encoded by
pipenv:

```
[[source]]
url = "https://mypypi.example.com/simple"
verify_ssl = true
name = "pypi"
username = "$USERNAME"
password = "$PASSWORD"
```

```bash
USERNAME="my#username"; PASSWORD="xxx/yyy"; pipenv install
```

We cannot automatically encode credentials passed in the `url` fields as they
may have already been encoded. By using dedicated fields, we make it clear that
the credentials will be encoded by pipenv.