diff --git a/azurebs/client/storage_client.go b/azurebs/client/storage_client.go index f6890d8..8272810 100644 --- a/azurebs/client/storage_client.go +++ b/azurebs/client/storage_client.go @@ -461,7 +461,7 @@ func (dsc DefaultStorageClient) SignedUrl( return "", err } - permissions := sas.BlobPermissions{Read: requestType == "GET", Create: requestType == "PUT", Write: requestType == "PUT"} + permissions := sas.BlobPermissions{Read: requestType == "GET", Create: requestType == "PUT"} url, err := client.GetSASURL(permissions, time.Now().Add(expiration), nil) if err != nil { return "", err diff --git a/azurebs/client/storage_client_test.go b/azurebs/client/storage_client_test.go index 571c73e..3f5fc1b 100644 --- a/azurebs/client/storage_client_test.go +++ b/azurebs/client/storage_client_test.go @@ -76,13 +76,13 @@ var _ = Describe("SignedUrl permissions", func() { Expect(url).To(MatchRegexp(`[?&]sp=r(&|$)`), "GET URL must grant read only, got: %s", url) }) - It("grants create+write permission for a PUT request (sp=cw)", func() { + It("grants create-only permission for a PUT request (sp=c)", func() { c, err := client.NewStorageClient(baseConfig()) Expect(err).ToNot(HaveOccurred()) url, err := c.SignedUrl("PUT", "some-blob", time.Minute) Expect(err).ToNot(HaveOccurred()) - Expect(url).To(MatchRegexp(`[?&]sp=cw(&|$)`), "PUT URL must grant create+write, got: %s", url) + Expect(url).To(MatchRegexp(`[?&]sp=c(&|$)`), "PUT URL must grant create only, got: %s", url) }) It("does not grant create or write permission for a GET request", func() { diff --git a/azurebs/integration/assertions.go b/azurebs/integration/assertions.go index ec726c7..e660a48 100644 --- a/azurebs/integration/assertions.go +++ b/azurebs/integration/assertions.go @@ -315,7 +315,7 @@ func AssertOnSignedURLs(cliPath string, cfg *config.AZStorageConfig) { putUrl := bytes.NewBuffer(cliSession.Out.Contents()).String() Expect(putUrl).To(MatchRegexp(regex)) - Expect(putUrl).To(MatchRegexp(`[?&]sp=cw(&|$)`), "PUT signed URL should grant create+write permission") + Expect(putUrl).To(MatchRegexp(`[?&]sp=c(&|$)`), "PUT signed URL should grant create-only permission") } func AssertOnListDeleteLifecyle(cliPath string, cfg *config.AZStorageConfig) {