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

Credentials from helpers overrule process-local logins #3281

Open
akx opened this issue Sep 4, 2024 · 0 comments
Open

Credentials from helpers overrule process-local logins #3281

akx opened this issue Sep 4, 2024 · 0 comments

Comments

@akx
Copy link
Contributor

akx commented Sep 4, 2024

I didn't investigate thoroughly (yet), but see title. The gist of the problem is:

  • If you have "credsStore": "desktop" (or other) configured in ~/.docker/config.json, docker-py picks that up into AuthConfig
  • When requiring registry auth for a call, resolve_authconfig:
    • first queries the configured credential store or helpers
      • if it finds credentials for a given URL, it returns them.
    • falls back to a local in-memory dict of credentials
    • finally returns None if no creds are found.
  • If the credentials (say, from a store/helper) are expired, e.g. AWS says "repository does not exist or may require 'docker login': denied: Your authorization token has expired. Reauthenticate and try again.".
  • Now, if you have code that e.g. uses the Amazon ECR client to get credentials and call client.api.login() with them (I do, for one), it will happily say authentication is successful, and crucially, saves these only in the aforementioned in-memory dict
  • A subsequent call requiring auth to the same registry will still fail because the local credentials are not used.

This is related to #2960, kind of.

akx added a commit to akx/satamanosturi that referenced this issue Sep 4, 2024
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

1 participant