Skip to content

docs: document OCI/docker registry credential discovery#1001

Merged
sofusalbertsen merged 5 commits into
mainfrom
docs/oci-registry-credentials
Jul 10, 2026
Merged

docs: document OCI/docker registry credential discovery#1001
sofusalbertsen merged 5 commits into
mainfrom
docs/oci-registry-credentials

Conversation

@sofusalbertsen

Copy link
Copy Markdown
Contributor

Explain how registry credentials are resolved for --artifact-type=oci (and docker with --registry-username set): explicit flags first, then Docker/Podman auth files and credential helpers, then anonymous access. Also note --registry-provider is deprecated and no longer used.

Explain how registry credentials are resolved for --artifact-type=oci
(and docker with --registry-username set): explicit flags first, then
Docker/Podman auth files and credential helpers, then anonymous access.
Also note --registry-provider is deprecated and no longer used.
@claude

claude Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Claude finished @sofusalbertsen's task in 1m 47s —— View job


Review: PR #1001 — document OCI/docker registry credential discovery

  • Read the PR diff and relevant code
  • Verify accuracy of credential-resolution docs against implementation
  • Check docs fixtures are consistent with the generated-docs test
  • Post review feedback

Verdict: LGTM ✅ — accurate, and the earlier blockers are resolved

Accuracy vs. implementation — the doc text now matches the code exactly:

  • cmd/kosli/cli_utils.go:385-390oci always uses digest.OciSha256 (credential discovery), while docker only takes that path when o.registryUsername != ""; otherwise it uses DockerImageSha256 (local daemon, no auth files). The doc's qualifier "and for --artifact-type=docker when --registry-username is set" is correct.
  • internal/digest/digest.go:90-100 — when no explicit creds are passed, DockerAuthConfig is left nil and containers/image falls back to auth files + credential helpers, then anonymous access. The step 1→2 resolution order in the doc mirrors this precisely.

Fixtures fixed — the concern from the earlier review runs (mine + @mbevc1's "we'll need to update fixtures") is now addressed by commit 3a122df8:

  • artifact.md has both the new credential-resolution paragraph and the updated flag text.
  • snyk.md has the updated flag text (correctly without the paragraph, since snyk doesn't embed fingerprintDesc).
  • TestDocsCommandTestSuite only generates/compares artifact and snyk docs, and the fixture text matches root.go verbatim, so the exact-file comparison should pass. go build ./... is clean. (I couldn't run the test suite here — it needs the local Kosli server — but the fixture/source text is byte-consistent.)

Minor nit (non-blocking)

Step 1 reads "If --registry-username (and optionally --registry-password) is set". For --artifact-type=oci, the explicit-credentials branch at internal/digest/digest.go:95 actually fires when either username or password is non-empty (registryUsername != "" || registryPassword != "") — so setting only --registry-password also skips discovery. The username-centric phrasing is fine for the common case and reads clearly; only worth tightening if you want to be exhaustive.

Nice touches

  • Documenting the deprecation of --registry-provider inline where users will actually look.
  • Concrete credential-helper examples (ECR / GCR / ACR) make the "discovered automatically" step actionable rather than hand-wavy.

Comment thread cmd/kosli/root.go Outdated

@mbevc1 mbevc1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit and we'll need to update fixtures for testing. But looks good otherwise

Comment thread cmd/kosli/root.go Outdated
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Comment thread cmd/kosli/root.go
@mbevc1 mbevc1 added the documentation Improvements or additions to documentation label Jul 10, 2026
@sofusalbertsen sofusalbertsen merged commit 0be151b into main Jul 10, 2026
20 checks passed
@sofusalbertsen sofusalbertsen deleted the docs/oci-registry-credentials branch July 10, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants