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

feat(manager/pip-compile): Use python keychain module for credentials #27342

Conversation

mbudnek
Copy link
Contributor

@mbudnek mbudnek commented Feb 15, 2024

Changes

This refactors the pip-compile manager to use the python keychain module along with the keychains.envvars module to pass credentials to pip. Doing it this way means there's a significantly lower likelyhood of accidentally leaking credentials into the output file, since credentials looked up via the keychain module won't ever be written to --index-url or --extra-index-url directives in the output file.

Because of this lower likelihood of leaking credentials, I relaxed the usage of --no-emit-index-url to only automatically apply when credentials are found in index URLs in environment variables.

Context

#26853 (comment)
containerbase/base#2145

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

This refactors the pip-compile manager to use the python keychain module
along with the keychains.envvars module to pass credentials to pip.
Doing it this way means there's a significantly lower likelyhood of
accidentally leaking credentials into the output file, since credentials
looked up via the keychain module won't ever be written to --index-url
or --extra-index-url directives in the output file.

Because of this lower likelyhood of leaking credentials, I relaxed the
usage of --no-emit-index-url to only automatically apply when
credentials are found in index URLs in environment variables.
@mbudnek mbudnek changed the title refactor(manager/pip-compile) Use python keychain module for credentials refactor(manager/pip-compile): Use python keychain module for credentials Feb 15, 2024
@mbudnek mbudnek marked this pull request as ready for review February 16, 2024 18:13
@mbudnek mbudnek requested a review from viceice February 21, 2024 17:48
@viceice viceice changed the title refactor(manager/pip-compile): Use python keychain module for credentials feat(manager/pip-compile): Use python keychain module for credentials Feb 21, 2024
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to feat, so we get a feature release because it chnages behavior a lot.

a refactor PR should never change behavior.

@viceice
Copy link
Member

viceice commented Feb 21, 2024

@not7cd Can you cross check?

Copy link
Contributor

@not7cd not7cd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will evaluate this feature after release.

I would like to see mention of --no-emit-index-url behaviour and link to private-packages.md in pip-compile readme.md. Manager specific documentation is often the first thing someone sees.

@viceice viceice added this pull request to the merge queue Feb 22, 2024
Merged via the queue into renovatebot:main with commit 66dc246 Feb 22, 2024
35 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.205.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2024
@mbudnek mbudnek deleted the refactor/pip-compile-keyring-envvars-credentials branch April 17, 2024 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants