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

Extra Index Url Authentication is Interactive Even When Specified #1163

Closed
Californian opened this issue Dec 4, 2017 · 3 comments
Closed

Comments

@Californian
Copy link

Californian commented Dec 4, 2017

Authentication for extra index URLs requests user-interactive authentication even when authentication is specified in the extra index URL itself.

Describe your environment
  1. Arch Linux
  2. Python version: Python 3.6.3
  3. Pipenv version: pipenv, version 8.3.2
Expected result

When I add a [[source]] with a URL that has authentication information (e.g. https://user:password@host/pypi/simple), authentication information should not be requested.

Actual result
$ pipenv lock --verbose
Locking [dev-packages] dependencies…
Using pip: -i https://pypi.python.org/simple --extra-index-url https://xxxUSERxxx:xxxPASSWORDxxx@xxxHOSTxxx/xxxPATHxxx/pypi/simple

                          ROUND 1
Current constraints:
  xxx
  xxx
  xxx

Finding the best candidates:
User for xxxxxxxx:

This then waits for user input.

Steps to replicate
  1. Add a [[source]] to the Pipfile with a URL that requires basic http auth.
  2. Add a package to the Pipfile that uses the specified index (e.g. package_name: {version="*", index="index_name"}.
  3. Run pipenv lock.
@Californian
Copy link
Author

Sorry, this is not a pipenv issue; it happens even with normal pip outside of the virtualenv.

FYI, for anyone wondering how to use private pip repos with CI and docker, you'll have to use the PIP_EXTRA_INDEX_URL environment variable with authentication. This can be done for local testing with a .env file that isn't checked into a VCS, and remotely with whatever your CI tool uses for environment variable definition (usually in GUI or CLI settings for the repo). If you are using docker, you can then inject this with a --build-arg YOUR_ARG_KEY=$YOUR_ENV_VAR. I would add this to the relevant issue (#1020), but it was closed for some reason.

@techalchemy
Copy link
Member

@Californian thanks for the relevant update, I'll add a link

@rca
Copy link

rca commented Dec 15, 2017

@Californian OT here, but using --build-arg for secrets is not good. You can actually get the secret from the build history; try docker history <image> and you'll see it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants