@@ -12,16 +12,13 @@ import (
12
12
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
13
13
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
14
14
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/file"
15
- "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/fileerror"
16
15
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/base"
17
16
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/exported"
18
17
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/generated"
19
18
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/shared"
20
- "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/sas"
21
19
"net/http"
22
20
"net/url"
23
21
"strings"
24
- "time"
25
22
)
26
23
27
24
// ClientOptions contains the optional parameters when creating a Client.
@@ -209,34 +206,3 @@ func (d *Client) NewListFilesAndDirectoriesPager(options *ListFilesAndDirectorie
209
206
},
210
207
})
211
208
}
212
-
213
- // GetSASURL is a convenience method for generating a SAS token for the currently pointed at directory.
214
- // It can only be used if the credential supplied during creation was a SharedKeyCredential.
215
- func (d * Client ) GetSASURL (permissions sas.FilePermissions , expiry time.Time , o * GetSASURLOptions ) (string , error ) {
216
- if d .sharedKey () == nil {
217
- return "" , fileerror .MissingSharedKeyCredential
218
- }
219
- st := o .format ()
220
-
221
- urlParts , err := sas .ParseURL (d .URL ())
222
- if err != nil {
223
- return "" , err
224
- }
225
-
226
- qps , err := sas.SignatureValues {
227
- Version : sas .Version ,
228
- Protocol : sas .ProtocolHTTPS ,
229
- ShareName : urlParts .ShareName ,
230
- DirectoryOrFilePath : urlParts .DirectoryOrFilePath ,
231
- Permissions : permissions .String (),
232
- StartTime : st ,
233
- ExpiryTime : expiry .UTC (),
234
- }.SignWithSharedKey (d .sharedKey ())
235
- if err != nil {
236
- return "" , err
237
- }
238
-
239
- endpoint := d .URL () + "?" + qps .Encode ()
240
-
241
- return endpoint , nil
242
- }
0 commit comments