Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Mar 12, 2025

Really (REALLY) work in progress; slowly untangling some of the auth-code which was wrapper-upon-wrapper-upon-wrapper; often because types like registry.IndexInfo or registry.RepositoryInfo were part of the signature.

Docker Content Trust added yet-another layer of abstraction on top of that, with trust.ImageRefAndAuth, which is a wrapper on its own to wrap all those bits.

In most cases, all we need is;

  • either the name of the registry, or an image-ref from which we can deduct the name
  • we DONT need to know about Mirrors, because the client doesn't configure those
  • for most situations we don't even need to know about "insecure registries", but we can deduct "defaults" there from the hostname (default is loopbacks are insecure, everything else isn't)

And of course, there's the "special cases" for docker hub;

  • docker.io or index.docker.io PREFIX means "docker hub registry" (actual registry is registry-1.docker.io (but there's other domains possible ⚠️ we still need to normalise those)
  • we currently use https://index.docker.io/v1/ as KEY to store credentials for those
  • ☝️ also something we should consider changing, because for other registries, we use hostname without scheme / path

But there's more to untangle, such as creds-helpers/stores converting "to hostname", but other paths don't, and likely corner-cases, where (e.g.) a trailing / is missing in https://index.docker.io/v1/, etc etc.

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Member Author

FWIW, more untangling also happening in #5876 and #5921

I should probably look at basing this one on that, but wanted to see things before that

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/registry.go 33.33% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah force-pushed the simplify_auth branch 3 times, most recently from df692c7 to 8a4f9b4 Compare March 19, 2025 14:37
@thaJeztah thaJeztah force-pushed the simplify_auth branch 4 times, most recently from 074b5a7 to c784802 Compare March 25, 2025 12:25
@thaJeztah thaJeztah force-pushed the simplify_auth branch 3 times, most recently from a3f954e to 26845e4 Compare April 4, 2025 19:52
@thaJeztah thaJeztah force-pushed the simplify_auth branch 3 times, most recently from 199969d to 76452e7 Compare April 17, 2025 14:21
@thaJeztah thaJeztah force-pushed the simplify_auth branch 6 times, most recently from c2f0f43 to 62c8255 Compare July 25, 2025 21:27
@thaJeztah thaJeztah force-pushed the simplify_auth branch 11 times, most recently from 5d6bc2b to b8dfa73 Compare August 25, 2025 14:25
@thaJeztah thaJeztah force-pushed the simplify_auth branch 7 times, most recently from 6d48c2e to 6e8a0d3 Compare September 1, 2025 08:38
@thaJeztah thaJeztah force-pushed the simplify_auth branch 2 times, most recently from b8ad44d to 356d269 Compare September 8, 2025 15:46
@thaJeztah thaJeztah force-pushed the simplify_auth branch 2 times, most recently from 7e6bd69 to 45e453c Compare September 26, 2025 08:10
@thaJeztah thaJeztah force-pushed the simplify_auth branch 3 times, most recently from 0657183 to 2fdb78a Compare September 26, 2025 17:28
Lots to do here; too many wrappers everywhere, which may become easier
when content trust is removed (which adds another level of abstraction)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants