Skip to content

Implement --credential-helper for external authentication management#13774

Draft
Ashutosh0x wants to merge 11 commits intopypa:mainfrom
Ashutosh0x:feature/credential-helper
Draft

Implement --credential-helper for external authentication management#13774
Ashutosh0x wants to merge 11 commits intopypa:mainfrom
Ashutosh0x:feature/credential-helper

Conversation

@Ashutosh0x
Copy link

@Ashutosh0x Ashutosh0x commented Jan 28, 2026

This PR implements the generic credential helper API for pip, addressing #10389.

Key Changes:

  • Added --credential-helper <command> CLI option: Allows users to specify an external command for managing credentials.
  • Generic Provider Refactor: Refactored the internal authentication logic to use a common BaseCredentialProvider interface, moving away from keyring-specific implementations.
  • Implemented CredentialHelperProvider: A new provider that communicates with external tools via a simple JSON-based protocol over standard I/O (handling get, store, and erase actions).
  • Build Isolation Support: Correctly propagates the credential helper setting to isolated build environments, ensuring private dependencies can be fetched during the build process.
  • Documentation & Tests: Added comprehensive unit tests for the new provider and updated the authentication documentation with protocol details and usage examples.

Copy link
Member

Choose a reason for hiding this comment

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

This section of code seems unrelated to the purpose of the PR. What's going on here?

@Ashutosh0x
Copy link
Author

@pfmoore Fixed. I've removed the unrelated index strategy and mapping changes to keep this PR focused exclusively on the credential helper.

@notatallshaw
Copy link
Member

Hi @Ashutosh0x this PR doesn't appear to be ready for review.

Please be aware one of the big bottlenecks of this project is maintainer review time, so if you are not sure if a PR will be ready or not then open/mark it as draft until it is ready. While PRs to fix issues are appreciated, there is only so much capacity to review them, and opening too many PRs will reduce the chance they will be accepted and merged.

This PR in particular adds a new protocol that pip will needs to guarantee on an ongoing basis and therefore risks being a maintenance burden. Please give a clearer outline to your protocol, either in the top of the PR, or the original issue, does it exactly match prior art such as the Engflow spec (https://github.com/EngFlow/credential-helper-spec/blob/main/spec.md) or does it deviate from it? And if so why?

It's also not clear if this PR breaks existing functionality.

@notatallshaw notatallshaw marked this pull request as draft February 1, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments