Remove Azure Bucket public access from the docs and the code - #2138
Open
Pranav-error wants to merge 1 commit into
Open
Remove Azure Bucket public access from the docs and the code#2138Pranav-error wants to merge 1 commit into
Pranav-error wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.