Plaintext backend does not allow installing
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- authentication
Research direction
Reproduce the Debian container setup with keyring, keyrings.alt, the PlaintextKeyring backend, and pip's import provider. Trace how the stored credentials are retrieved during package installation; done means pip uses the credentials without prompting when the plaintext backend is configured.
Written by the indexing model from the issue text.
Description
Describe the bug
I have the following situation: In a GitLab CI job, running inside a debian:latest Docker container, I want to install a package from a GitLab package registry using the simplest possible keyring setup. This is to assert that the installation instructions I provide to users in the README actually do what they are supposed to do, I don't care if the backend used is actually secure.
Here is my job definition:
publish_package_test:
script:
- apt-get update
- apt-get install -y --no-install-recommends python3 python3-venv
- python3 -m venv python_venv --upgrade-deps
- source python_venv/bin/activate
- pip install keyring keyrings.alt
- echo ${CI_JOB_TOKEN} | keyring set gitlab.com gitlab-ci-token
- pip config set --user global.keyring-provider import
- pip config set --user global.extra-index-url https://gitlab.com/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/-/packages/pypi/
- pip install --no-cache-dir ${CI_PROJECT_NAME}
This fails silently because pip install will still prompt for username/password. This does not happen on my local Ubuntu machine which uses the proper SecretService backend. keyring's README contains instructions for using this backend in a privileged Ubuntu container. But my container runs Debian and is not privileged so I hoped I could just use a "dummy" backend. Why can't I?
To Reproduce
docker run -it debian:latest- Install
keyringandkeyring.altin a virtual env. - Store a username and password for some package registry in keyring and configure pip to use the
importprovider. - Attempt to install a package via
pip install.
Expected behavior
pip install will use the credentials provided to keyring, even when using the plaintext backend.
Environment
debian:latest container.
$ pip list | grep keyring
keyring 25.2.0
keyrings.alt 5.0.1
$ keyring --list-backends
keyring.backends.fail.Keyring (priority: 0)
keyrings.alt.file.PlaintextKeyring (priority: 0.5)
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jaraco/keyring
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
macOS: denied keychain prompt on delete raises PasswordDeleteError instead of KeyringLockedPossibly taken @r3wretrhy claimed this 46 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Remove B018 suppressions after adopting skeleton's B018 ignorePossibly taken @Madin-H23 claimed this 26 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.pyPossibly taken @prabhleen2317 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/iceberg-python#4387 ·
Maintainers usually reply within 1 day
-
[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yamlPossibly taken @Parth-Vasave claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3749 · 1 comment ·
Maintainers usually reply within 1 day
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/numba-cuda-mlir#467 · 1 comment ·
Maintainers usually reply within 3 days