Remove Azure Bucket public access from the docs and the code - #2138
Pranav-error wants to merge 1 commit into
Conversation
3609c15 to
87e511e
Compare
|
Rebased onto current Also brought the commit in line with Verified against current One thing worth stating since it is easy to misread the diff: |
|
Hey @Pranav-error we agreed on changing only the docs |
|
You are right, sorry — @stefanprodan's words on #2137 were about the docs and I took my own reply there as licence to remove the dead path too. Dropped it; this is docs only now. Happy to send the code removal separately if you want it, or to leave it. |
87e511e to
e075e83
Compare
| **Note:** that for a publicly accessible object storage, you don't need to | ||
| provide a `secretRef` nor `serviceAccountName`. | ||
|
|
There was a problem hiding this comment.
Is this note not relative to using provider: generic? It doesn't seem related to provider: azure. I think we can, instead of removing this note, improve it to be specific about provider: generic. A generic s3-like object storage can support public access. Please check if we have tests for public buckets with provider: generic.
e075e83 to
145c526
Compare
|
You are right on both counts — that note sits in the
On tests: no, there are none for a public bucket with Happy to add one — the in-process S3 mock from #2153 looks like the right place — but I would rather do that as its own PR than widen this one again. |
None of the cloud Bucket providers work without authentication, and the Azure anonymous path is unreachable in any case: azureauth.NewTokenCredential never returns nil, so the credential chain is never empty and azblob.NewClientWithNoCredential is not reached. Drop the claim that a bucket with no credential chain is assumed to be publicly reachable, and the azure-public example that relied on it. Scope the note about public storage to provider: generic, which does support anonymous access, rather than removing it. Signed-off-by: sai pranav <rajasaipranav0@gmail.com> Assisted-by: Claude Code/claude-sonnet-5
145c526 to
f9874a1
Compare
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:azure-publicexample Bucket, which had nosecretRefand relied on that behaviour.secretRefnorserviceAccountName."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.NewClientuses a token source whenever no secret is present, andminio.NewClientalways setsminioOpts.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.NewTokenCredentialnever returns nil, socredswas never empty,chainCredentialWithSecretcould not return the documentednil, nil, andazblob.NewClientWithNoCredentialwas dead. Removed the fallback, the dead nil return and thelen(creds) > 0guard so the code states the same thing as the docs.Left alone, tell me if you want them
withoutCredentials()inblob.gois unexported and only called fromblob_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_chainCredentialWithSecretstill passes unchanged, since the chain is still always non-empty.Verification
go build ./...,go vet ./internal/bucket/azure/andgo test ./internal/bucket/azure/all clean.