Skip to content

Clarify docs example for keyring subprocess auth with Google Artifact Registry  #11971

Description

@MichelEdkrantz

Description

Hi,
thanks for the great additions with keyrings in pip 23.1 :) I discovered that the docs here https://pip.pypa.io/en/stable/topics/authentication/ on auth is missing some vital info for auth with Google Artifact Registry.

Trying to use the new keyring delegation calling with

Does not work
pip install --no-input --keyring-provider=subprocess --index-url=https://us-east4-python.pkg.dev/<project>/<repo>/simple <package_name>

Does work
pip install --no-input --keyring-provider=subprocess --index-url=https://oauth2accesstoken@us-east4-python.pkg.dev/<project>/<repo>/simple <package_name>

It seems the username needs to be oauth2accesstoken. It was only obvious after digging deep into the code for
keyrings.google-artifactregistry-auth that this is a hard coded username, and any username provided to the CLI is ignored.

The CLI interface in keyrings could be more obvious and also return the overridden username, but that's not for pip to solve i guess.

Expected behavior

Update docs to state that this username needs to be used for any usage with Google Artifact Registry

pip version

23.1

Python version

3.11

OS

Mac

How to Reproduce

You need a working Google Artifact Registry setup. See description

Output

No response

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: keyringRelated to pip's keyring integrationS: needs triageIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions