Repository navigation
Conversation
AzureConfig.SASToken (yaml sas_token) is used when no account key or token credential is set: the client sends it as the query of every request. PresignedURL fails with only a SAS, which cannot sign another. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 1, 2026
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.
Azure Blob can be reached only with the storage account key or a token credential. The account key grants full access to every container in the account, so many teams cannot hand it out. A shared access signature (SAS) can be scoped to one container or prefix, to write and create only, with a short expiry.
What changed:
AzureConfig.SASToken(yamlsas_token). WhenAccountKeyis empty and noTokenCredentialis set,NewAzurebuilds the client withazblob.NewClientWithNoCredentialon the service URL with the token as its query (a leading?is stripped). The SDK copies that query onto every request.PresignedURLwith only a SAS token returns an error. A SAS cannot sign another SAS, and returning a URL with the configured token would hand out its write access for its whole lifetime. Callers that need presigned URLs keep using the account key or a token credential.How tested: new
TestAzureSASTokenincontract_test.gouploads to anhttptestserver and checks the SAS query parameters arrive on the request with noAuthorizationheader, that the location has no token, and thatPresignedURLfails.go test ./...in the root module passes. I did not run the e2e module (needs Docker).Related PRs:
sas_tokenonAzureBlobUpload(feat(egress): add sas_token to AzureBlobUpload protocol#2032)🤖 Generated with Claude Code