Skip to content

Remove Azure Bucket public access from the docs and the code - #2138

Open
Pranav-error wants to merge 1 commit into
fluxcd:mainfrom
Pranav-error:docs-remove-azure-public-access
Open

Remove Azure Bucket public access from the docs and the code#2138
Pranav-error wants to merge 1 commit into
fluxcd:mainfrom
Pranav-error:docs-remove-azure-public-access

Conversation

@Pranav-error

Copy link
Copy Markdown

Replaces #2137, which took the opposite approach. @stefanprodan and @matheuscscp both said on that PR that the docs should be corrected rather than the anonymous path restored, since no Bucket provider works without authentication — so this does that instead.

Refs #2136.

Docs

Three claims removed from docs/spec/v1/buckets.md:

  • "If no chain can be established, the bucket is assumed to be publicly reachable."
  • The azure-public example Bucket, which had no secretRef and relied on that behaviour.
  • "Note: that for a publicly accessible object storage, you don't need to provide a secretRef nor serviceAccountName."

That last one sat under the Service Account section and applied to all providers, not just Azure. I checked the others before removing it: gcp.NewClient uses a token source whenever no secret is present, and minio.NewClient always sets minioOpts.Creds. Neither has an anonymous path, which matches what you said. Say the word if you would rather I scope that removal to Azure only.

Code

The anonymous path was unreachable anyway. azureauth.NewTokenCredential never returns nil, so creds was never empty, chainCredentialWithSecret could not return the documented nil, nil, and azblob.NewClientWithNoCredential was dead. Removed the fallback, the dead nil return and the len(creds) > 0 guard so the code states the same thing as the docs.

Left alone, tell me if you want them

  • withoutCredentials() in blob.go is unexported and only called from blob_test.go, so it is an anonymous path reachable only by tests. It is unused in production either way; happy to remove it and adjust the tests in this PR or a follow-up.
  • Test_chainCredentialWithSecret still passes unchanged, since the chain is still always non-empty.

Verification

go build ./..., go vet ./internal/bucket/azure/ and go test ./internal/bucket/azure/ all clean.

None of the Bucket providers work without authentication, and the Azure
anonymous path was unreachable in any case: azureauth.NewTokenCredential never
returns nil, so the chain was never empty, chainCredentialWithSecret could not
return the documented nil, and azblob.NewClientWithNoCredential was dead code.

Drop the claim that a bucket with no credential chain is assumed to be publicly
reachable, the azure-public example that relied on it, and the note saying
publicly accessible storage needs neither secretRef nor serviceAccountName.
Remove the unreachable fallback and the dead nil return so the code says the
same thing as the docs.

Refs fluxcd#2136

Signed-off-by: sai pranav <rajasaipranav0@gmail.com>
Copilot AI lite review requested due to automatic review settings August 21, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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