Skip to content

Scope in-memory API keys to registry URLs #5247

Description

@drernie

Problem

#5240 isolates authenticated HTTP sessions by registry URL, but API-key authentication remains process-global. After setting a key for registry A, switching to registry B through a registry override creates B's session with A's key. This can cause authentication failures or disclose A's credential to B.

Expected behavior

  • Associate each in-memory API key with the resolved registry URL it authenticates to.
  • Use a key only when creating a session for that same registry.
  • Preserve existing single-registry login_with_api_key() behavior.
  • Allow clearing one registry's key without affecting others; logout() may continue clearing all authentication state.
  • Cover switching, nesting, and concurrent contexts so API keys never cross registry boundaries.

Follow-up to #5240.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions