Skip to content

Commit

Permalink
Default GetSASURL http+https for getsasurl (#22704)
Browse files Browse the repository at this point in the history
* default to http+https for getsasurl

* go mod tidy

* update sas query parameter to latest version
  • Loading branch information
tanyasethi-msft authored Apr 8, 2024
1 parent 8567665 commit df9e916
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions sdk/storage/azblob/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
* Fixed an issue where GetSASURL() was providing HTTPS SAS, instead of the default http+https SAS. Fixes [#22448](https://github.com/Azure/azure-sdk-for-go/issues/22448)

### Other Changes

Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azblob/container/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ func (c *Client) GetSASURL(permissions sas.ContainerPermissions, expiry time.Tim
// Containers do not have snapshots, nor versions.
qps, err := sas.BlobSignatureValues{
Version: sas.Version,
Protocol: sas.ProtocolHTTPS,
ContainerName: urlParts.ContainerName,
Permissions: permissions.String(),
StartTime: st,
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azblob/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
)

require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/testdata/perf v0.0.0-20240208231215-981108a6de20 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dnaeon/go-vcr v1.2.0 // indirect
Expand Down
4 changes: 0 additions & 4 deletions sdk/storage/azblob/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFG
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 h1:7CBQ+Ei8SP2c6ydQTGCCrS35bDxgTMfoP2miAwK++OU=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/testdata/perf v0.0.0-20240208172434-40a6c1541dd6 h1:W9pOYu3JGEQCHimw9kt39BBrs91mQblwCYPsVZc7W4I=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/testdata/perf v0.0.0-20240208172434-40a6c1541dd6/go.mod h1:KMKhmwqL1TqoNRkQG2KGmDaVwT5Dte9d3PoADB38/UY=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/testdata/perf v0.0.0-20240208231215-981108a6de20 h1:45Ajiuhu6AeJTFdwxn2OWXZTQOHdXT1U/aezrVu6HIM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/testdata/perf v0.0.0-20240208231215-981108a6de20/go.mod h1:KMKhmwqL1TqoNRkQG2KGmDaVwT5Dte9d3PoADB38/UY=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down
3 changes: 2 additions & 1 deletion sdk/storage/azblob/sas/query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package sas

import (
"errors"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated"
"net"
"net/url"
"strings"
Expand All @@ -23,7 +24,7 @@ const (

var (
// Version is the default version encoded in the SAS token.
Version = "2021-12-02"
Version = generated.ServiceVersion
)

// TimeFormats ISO 8601 format.
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azblob/service/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ func (s *Client) GetSASURL(resources sas.AccountResourceTypes, permissions sas.A
st := o.format()
qps, err := sas.AccountSignatureValues{
Version: sas.Version,
Protocol: sas.ProtocolHTTPS,
Permissions: permissions.String(),
ResourceTypes: resources.String(),
StartTime: st,
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/azdatalake/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
* Fixed an issue where GetSASURL() was providing HTTPS SAS, instead of the default http+https SAS. Fixes [#22448](https://github.com/Azure/azure-sdk-for-go/issues/22448)

### Other Changes

Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azdatalake/filesystem/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ func (fs *Client) GetSASURL(permissions sas.FileSystemPermissions, expiry time.T
}
qps, err := sas.DatalakeSignatureValues{
Version: sas.Version,
Protocol: sas.ProtocolHTTPS,
FileSystemName: urlParts.FileSystemName,
Permissions: permissions.String(),
StartTime: st,
Expand Down
9 changes: 9 additions & 0 deletions sdk/storage/azdatalake/internal/generated/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package generated

const ServiceVersion = "2023-11-03"
3 changes: 2 additions & 1 deletion sdk/storage/azdatalake/sas/query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package sas

import (
"errors"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
"net"
"net/url"
"strings"
Expand All @@ -21,7 +22,7 @@ const (

var (
// Version is the default version encoded in the SAS token.
Version = "2020-12-06"
Version = generated.ServiceVersion
)

// TimeFormats ISO 8601 format.
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/azfile/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
* Fixed an issue where GetSASURL() was providing HTTPS SAS, instead of the default http+https SAS. Fixes [#22448](https://github.com/Azure/azure-sdk-for-go/issues/22448)

### Other Changes

Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azfile/file/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ func (f *Client) GetSASURL(permissions sas.FilePermissions, expiry time.Time, o

qps, err := sas.SignatureValues{
Version: sas.Version,
Protocol: sas.ProtocolHTTPS,
ShareName: urlParts.ShareName,
FilePath: urlParts.DirectoryOrFilePath,
Permissions: permissions.String(),
Expand Down
3 changes: 2 additions & 1 deletion sdk/storage/azfile/sas/query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package sas

import (
"errors"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/generated"
"net"
"net/url"
"strings"
Expand All @@ -22,7 +23,7 @@ const (

var (
// Version is the default version encoded in the SAS token.
Version = "2022-11-02"
Version = generated.ServiceVersion
)

// TimeFormats ISO 8601 format.
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azfile/service/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ func (s *Client) GetSASURL(resources sas.AccountResourceTypes, permissions sas.A
st := o.format()
qps, err := sas.AccountSignatureValues{
Version: sas.Version,
Protocol: sas.ProtocolHTTPS,
Permissions: permissions.String(),
ResourceTypes: resources.String(),
StartTime: st,
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azfile/share/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ func (s *Client) GetSASURL(permissions sas.SharePermissions, expiry time.Time, o

qps, err := sas.SignatureValues{
Version: sas.Version,
Protocol: sas.ProtocolHTTPS,
ShareName: urlParts.ShareName,
SnapshotTime: t,
Permissions: permissions.String(),
Expand Down

0 comments on commit df9e916

Please sign in to comment.