Skip to content

Commit 79f06e1

Browse files
tasherif-msftjhendrixMSFTealsurrichardpark-msftazure-sdk
authored
Feedback + Service Client (#21096)
* Enable gocritic during linting (#20715) Enabled gocritic's evalOrder to catch dependencies on undefined behavior on return statements. Updated to latest version of golangci-lint. Fixed issue in azblob flagged by latest linter. * Cosmos DB: Enable merge support (#20716) * Adding header and value * Wiring and tests * format * Fixing value * change log * [azservicebus, azeventhubs] Stress test and logging improvement (#20710) Logging improvements: * Updating the logging to print more tracing information (per-link) in prep for the bigger release coming up. * Trimming out some of the verbose logging, seeing if I can get it a bit more reasonable. Stress tests: * Add a timestamp to the log name we generate and also default to append, not overwrite. * Use 0.5 cores, 0.5GB as our baseline. Some pods use more and I'll tune them more later. * update proxy version (#20712) Co-authored-by: Scott Beddall <[email protected]> * Return an error when you try to send a message that's too large. (#20721) This now works just like the message batch - you'll get an ErrMessageTooLarge if you attempt to send a message that's too large for the link's configured size. NOTE: there's a patch to `internal/go-amqp/Sender.go` to match what's in go-amqp's main so it returns a programmatically useful error when the message is too large. Fixes #20647 * Changes in test that is failing in pipeline (#20693) * [azservicebus, azeventhubs] Treat 'entity full' as a fatal error (#20722) When the remote entity is full we get a resource-limit-exceeded condition. This isn't something we should keep retrying on and it's best to just abort and let the user know immediately, rather than hoping it might eventually clear out. This affected both Event Hubs and Service Bus. Fixes #20647 * [azservicebus/azeventhubs] Redirect stderr and stdout to tee (#20726) * Update changelog with latest features (#20730) * Update changelog with latest features Prepare for upcoming release. * bump minor version * pass along the artifact name so we can override it later (#20732) Co-authored-by: scbedd <[email protected]> * [azeventhubs] Fixing checkpoint store race condition (#20727) The checkpoint store wasn't guarding against multiple owners claiming for the first time - fixing this by using IfNoneMatch Fixes #20717 * Fix azidentity troubleshooting guide link (#20736) * [Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (#20437) * [Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 generation from spec commit: 85fb4ac6f8bfefd179e6c2632976a154b5c9ff04 * client factory * fix * fix * update * add sdk/resourcemanager/postgresql/armpostgresql live test (#20685) * add sdk/resourcemanager/postgresql/armpostgresql live test * update assets.json * set subscriptionId default value * format * add sdk/resourcemanager/eventhub/armeventhub live test (#20686) * add sdk/resourcemanager/eventhub/armeventhub live test * update assets * add sdk/resourcemanager/compute/armcompute live test (#20048) * add sdk/resourcemanager/compute/armcompute live test * skus filter * fix subscriptionId default value * fix * gofmt * update recording * sdk/resourcemanager/network/armnetwork live test (#20331) * sdk/resourcemanager/network/armnetwork live test * update subscriptionId default value * update recording * add sdk/resourcemanager/cosmos/armcosmos live test (#20705) * add sdk/resourcemanager/cosmos/armcosmos live test * update assets.json * update assets.json * update assets.json * update assets.json * Increment package version after release of azcore (#20740) * [azeventhubs] Improperly resetting etag in the checkpoint store (#20737) We shouldn't be resetting the etag to nil - it's what we use to enforce a "single winner" when doing ownership claims. The bug here was two-fold: I had bad logic in my previous claim ownership, which I fixed in a previous PR, but we need to reflect that same constraint properly in our in-memory checkpoint store for these tests. * Eng workflows sync and branch cleanup additions (#20743) Co-authored-by: James Suplizio <[email protected]> * [azeventhubs] Latest start position can also be inclusive (ie, get the latest message) (#20744) * Update GitHubEventProcessor version and remove pull_request_review procesing (#20751) Co-authored-by: James Suplizio <[email protected]> * Rename DisableAuthorityValidationAndInstanceDiscovery (#20746) * fix (#20707) * AzFile (#20739) * azfile: Fixing connection string parsing logic (#20798) * Fixing connection string parse logic * Update README * [azadmin] fix flaky test (#20758) * fix flaky test * charles suggestion * Prepare azidentity v1.3.0 for release (#20756) * Fix broken podman link (#20801) Co-authored-by: Wes Haggard <[email protected]> * [azquery] update doc comments (#20755) * update doc comments * update statistics and visualization generation * prep-for-release * Fixed contribution section (#20752) Co-authored-by: Bob Tabor <[email protected]> * [azeventhubs,azservicebus] Some API cleanup, renames (#20754) * Adding options to UpdateCheckpoint(), just for future potential expansion * Make Offset an int64, not a *int64 (it's not optional, it'll always come back with ReceivedEvents) * Adding more logging into the checkpoint store. * Point all imports at the production go-amqp * Add supporting features to enable distributed tracing (#20301) (#20708) * Add supporting features to enable distributed tracing This includes new internal pipeline policies and other supporting types. See the changelog for a full description. Added some missing doc comments. * fix linter issue * add net.peer.name trace attribute sequence custom HTTP header policy before logging policy. sequence logging policy after HTTP trace policy. keep body download policy at the end. * add span for iterating over pages * Restore ARM CAE support for azcore beta (#20657) This reverts commit 9020972. * Upgrade to stable azcore (#20808) * Increment package version after release of data/azcosmos (#20807) * Updating changelog (#20810) * Add fake package to azcore (#20711) * Add fake package to azcore This is the supporting infrastructure for the generated SDK fakes. * fix doc comment * Updating CHANGELOG.md (#20809) * changelog (#20811) * Increment package version after release of storage/azfile (#20813) * Update changelog (azblob) (#20815) * Updating CHANGELOG.md * Update the changelog with correct version * [azquery] migration guide (#20742) * migration guide * Charles feedback * Richard feedback --------- Co-authored-by: Charles Lowell <[email protected]> * Increment package version after release of monitor/azquery (#20820) * [keyvault] prep for release (#20819) * prep for release * perf tests * update date * added new client methods * moved access conditions and wrote first test * added more tests * added path listing * list deleted paths * fixed formatter and added more tests * added more tests * marker fix * log * fixed constructor validation * comment * assets update: * some cleanup * missing models and log * cleanup, resolved apiview feedback * test * cleanup * added service tests * implemented listing * cleanup * cleanup --------- Co-authored-by: Joel Hendrix <[email protected]> Co-authored-by: Matias Quaranta <[email protected]> Co-authored-by: Richard Park <[email protected]> Co-authored-by: Azure SDK Bot <[email protected]> Co-authored-by: Scott Beddall <[email protected]> Co-authored-by: siminsavani-msft <[email protected]> Co-authored-by: scbedd <[email protected]> Co-authored-by: Charles Lowell <[email protected]> Co-authored-by: Peng Jiahui <[email protected]> Co-authored-by: James Suplizio <[email protected]> Co-authored-by: Sourav Gupta <[email protected]> Co-authored-by: gracewilcox <[email protected]> Co-authored-by: Wes Haggard <[email protected]> Co-authored-by: Bob Tabor <[email protected]> Co-authored-by: Bob Tabor <[email protected]>
1 parent 6fe421e commit 79f06e1

File tree

20 files changed

+1234
-217
lines changed

20 files changed

+1234
-217
lines changed

sdk/storage/azdatalake/directory/client.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
1717
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
1818
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
19-
"strings"
2019
)
2120

2221
// ClientOptions contains the optional parameters when creating a Client.
@@ -30,10 +29,9 @@ type Client base.CompositeClient[generated.PathClient, generated.PathClient, blo
3029
// - cred - an Azure AD credential, typically obtained via the azidentity module
3130
// - options - client options; pass nil to accept the default values
3231
func NewClient(directoryURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
33-
blobURL := strings.Replace(directoryURL, ".dfs.", ".blob.", 1)
34-
directoryURL = strings.Replace(directoryURL, ".blob.", ".dfs.", 1)
32+
blobURL, directoryURL := shared.GetURLs(directoryURL)
3533

36-
authPolicy := shared.NewStorageChallengePolicy(cred)
34+
authPolicy := runtime.NewBearerTokenPolicy(cred, []string{shared.TokenScope}, nil)
3735
conOptions := shared.GetClientOptions(options)
3836
plOpts := runtime.PipelineOptions{
3937
PerRetry: []policy.Policy{authPolicy},
@@ -62,8 +60,7 @@ func NewClient(directoryURL string, cred azcore.TokenCredential, options *Client
6260
// - directoryURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/fs/dir?<sas token>
6361
// - options - client options; pass nil to accept the default values
6462
func NewClientWithNoCredential(directoryURL string, options *ClientOptions) (*Client, error) {
65-
blobURL := strings.Replace(directoryURL, ".dfs.", ".blob.", 1)
66-
directoryURL = strings.Replace(directoryURL, ".blob.", ".dfs.", 1)
63+
blobURL, directoryURL := shared.GetURLs(directoryURL)
6764

6865
conOptions := shared.GetClientOptions(options)
6966
plOpts := runtime.PipelineOptions{}
@@ -91,8 +88,7 @@ func NewClientWithNoCredential(directoryURL string, options *ClientOptions) (*Cl
9188
// - cred - a SharedKeyCredential created with the matching storage account and access key
9289
// - options - client options; pass nil to accept the default values
9390
func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error) {
94-
blobURL := strings.Replace(directoryURL, ".dfs.", ".blob.", 1)
95-
directoryURL = strings.Replace(directoryURL, ".blob.", ".dfs.", 1)
91+
blobURL, directoryURL := shared.GetURLs(directoryURL)
9692

9793
authPolicy := exported.NewSharedKeyCredPolicy(cred)
9894
conOptions := shared.GetClientOptions(options)
@@ -112,8 +108,11 @@ func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCreden
112108
blobClientOpts := blob.ClientOptions{
113109
ClientOptions: options.ClientOptions,
114110
}
115-
blobSharedKeyCredential, _ := blob.NewSharedKeyCredential(cred.AccountName(), cred.AccountKey())
116-
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKeyCredential, &blobClientOpts)
111+
blobSharedKey, err := cred.ConvertToBlobSharedKey()
112+
if err != nil {
113+
return nil, err
114+
}
115+
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
117116
dirClient := base.NewPathClient(directoryURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))
118117

119118
return (*Client)(dirClient), nil

sdk/storage/azdatalake/file/client.go

+9-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
1717
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
1818
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
19-
"strings"
2019
)
2120

2221
// ClientOptions contains the optional parameters when creating a Client.
@@ -30,10 +29,8 @@ type Client base.CompositeClient[generated.PathClient, generated.PathClient, blo
3029
// - cred - an Azure AD credential, typically obtained via the azidentity module
3130
// - options - client options; pass nil to accept the default values
3231
func NewClient(fileURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
33-
blobURL := strings.Replace(fileURL, ".dfs.", ".blob.", 1)
34-
fileURL = strings.Replace(fileURL, ".blob.", ".dfs.", 1)
35-
36-
authPolicy := shared.NewStorageChallengePolicy(cred)
32+
blobURL, fileURL := shared.GetURLs(fileURL)
33+
authPolicy := runtime.NewBearerTokenPolicy(cred, []string{shared.TokenScope}, nil)
3734
conOptions := shared.GetClientOptions(options)
3835
plOpts := runtime.PipelineOptions{
3936
PerRetry: []policy.Policy{authPolicy},
@@ -62,8 +59,7 @@ func NewClient(fileURL string, cred azcore.TokenCredential, options *ClientOptio
6259
// - fileURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/fs/file.txt?<sas token>
6360
// - options - client options; pass nil to accept the default values
6461
func NewClientWithNoCredential(fileURL string, options *ClientOptions) (*Client, error) {
65-
blobURL := strings.Replace(fileURL, ".dfs.", ".blob.", 1)
66-
fileURL = strings.Replace(fileURL, ".blob.", ".dfs.", 1)
62+
blobURL, fileURL := shared.GetURLs(fileURL)
6763

6864
conOptions := shared.GetClientOptions(options)
6965
plOpts := runtime.PipelineOptions{}
@@ -91,8 +87,7 @@ func NewClientWithNoCredential(fileURL string, options *ClientOptions) (*Client,
9187
// - cred - a SharedKeyCredential created with the matching storage account and access key
9288
// - options - client options; pass nil to accept the default values
9389
func NewClientWithSharedKeyCredential(fileURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error) {
94-
blobURL := strings.Replace(fileURL, ".dfs.", ".blob.", 1)
95-
fileURL = strings.Replace(fileURL, ".blob.", ".dfs.", 1)
90+
blobURL, fileURL := shared.GetURLs(fileURL)
9691

9792
authPolicy := exported.NewSharedKeyCredPolicy(cred)
9893
conOptions := shared.GetClientOptions(options)
@@ -112,8 +107,11 @@ func NewClientWithSharedKeyCredential(fileURL string, cred *SharedKeyCredential,
112107
blobClientOpts := blob.ClientOptions{
113108
ClientOptions: options.ClientOptions,
114109
}
115-
blobSharedKeyCredential, _ := blob.NewSharedKeyCredential(cred.AccountName(), cred.AccountKey())
116-
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKeyCredential, &blobClientOpts)
110+
blobSharedKey, err := cred.ConvertToBlobSharedKey()
111+
if err != nil {
112+
return nil, err
113+
}
114+
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
117115
fileClient := base.NewPathClient(fileURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))
118116

119117
return (*Client)(fileClient), nil

sdk/storage/azdatalake/filesystem/client.go

+9-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
1212
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
1313
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
14-
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
1514
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
1615
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake"
1716
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/datalakeerror"
@@ -21,7 +20,6 @@ import (
2120
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
2221
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/sas"
2322
"net/http"
24-
"strings"
2523
"time"
2624
)
2725

@@ -36,10 +34,8 @@ type Client base.CompositeClient[generated.FileSystemClient, generated.FileSyste
3634
// - cred - an Azure AD credential, typically obtained via the azidentity module
3735
// - options - client options; pass nil to accept the default values
3836
func NewClient(filesystemURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
39-
containerURL := strings.Replace(filesystemURL, ".dfs.", ".blob.", 1)
40-
filesystemURL = strings.Replace(filesystemURL, ".blob.", ".dfs.", 1)
41-
42-
authPolicy := shared.NewStorageChallengePolicy(cred)
37+
containerURL, filesystemURL := shared.GetURLs(filesystemURL)
38+
authPolicy := runtime.NewBearerTokenPolicy(cred, []string{shared.TokenScope}, nil)
4339
conOptions := shared.GetClientOptions(options)
4440
plOpts := runtime.PipelineOptions{
4541
PerRetry: []policy.Policy{authPolicy},
@@ -68,9 +64,7 @@ func NewClient(filesystemURL string, cred azcore.TokenCredential, options *Clien
6864
// - filesystemURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/fs?<sas token>
6965
// - options - client options; pass nil to accept the default values
7066
func NewClientWithNoCredential(filesystemURL string, options *ClientOptions) (*Client, error) {
71-
containerURL := strings.Replace(filesystemURL, ".dfs.", ".blob.", 1)
72-
filesystemURL = strings.Replace(filesystemURL, ".blob.", ".dfs.", 1)
73-
67+
containerURL, filesystemURL := shared.GetURLs(filesystemURL)
7468
conOptions := shared.GetClientOptions(options)
7569
plOpts := runtime.PipelineOptions{}
7670
base.SetPipelineOptions((*base.ClientOptions)(conOptions), &plOpts)
@@ -97,9 +91,7 @@ func NewClientWithNoCredential(filesystemURL string, options *ClientOptions) (*C
9791
// - cred - a SharedKeyCredential created with the matching storage account and access key
9892
// - options - client options; pass nil to accept the default values
9993
func NewClientWithSharedKeyCredential(filesystemURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error) {
100-
containerURL := strings.Replace(filesystemURL, ".dfs.", ".blob.", 1)
101-
filesystemURL = strings.Replace(filesystemURL, ".blob.", ".dfs.", 1)
102-
94+
containerURL, filesystemURL := shared.GetURLs(filesystemURL)
10395
authPolicy := exported.NewSharedKeyCredPolicy(cred)
10496
conOptions := shared.GetClientOptions(options)
10597
plOpts := runtime.PipelineOptions{
@@ -118,8 +110,11 @@ func NewClientWithSharedKeyCredential(filesystemURL string, cred *SharedKeyCrede
118110
containerClientOpts := container.ClientOptions{
119111
ClientOptions: options.ClientOptions,
120112
}
121-
blobSharedKeyCredential, _ := blob.NewSharedKeyCredential(cred.AccountName(), cred.AccountKey())
122-
blobContainerClient, _ := container.NewClientWithSharedKeyCredential(containerURL, blobSharedKeyCredential, &containerClientOpts)
113+
blobSharedKey, err := cred.ConvertToBlobSharedKey()
114+
if err != nil {
115+
return nil, err
116+
}
117+
blobContainerClient, _ := container.NewClientWithSharedKeyCredential(containerURL, blobSharedKey, &containerClientOpts)
123118
fsClient := base.NewFilesystemClient(filesystemURL, containerURL, blobContainerClient, azClient, cred, (*base.ClientOptions)(conOptions))
124119

125120
return (*Client)(fsClient), nil

sdk/storage/azdatalake/filesystem/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const (
1717
Filesystem PublicAccessType = azblob.PublicAccessTypeContainer
1818
)
1919

20+
// TODO: figure out a way to import this from datalake rather than blob again
21+
2022
// StatusType defines values for StatusType
2123
type StatusType = lease.StatusType
2224

sdk/storage/azdatalake/filesystem/models.go

+6
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,9 @@ type LeaseAccessConditions = exported.LeaseAccessConditions
210210

211211
// ModifiedAccessConditions contains a group of parameters for specifying access conditions.
212212
type ModifiedAccessConditions = exported.ModifiedAccessConditions
213+
214+
// PathList contains the path list
215+
type PathList = generated.PathList
216+
217+
// Path contains the path properties
218+
type Path = generated.Path

sdk/storage/azdatalake/filesystem/responses.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@ type SetAccessPolicyResponse = container.SetAccessPolicyResponse
2828
// GetAccessPolicyResponse contains the response from method FilesystemClient.GetAccessPolicy.
2929
type GetAccessPolicyResponse struct {
3030
// PublicAccess contains the information returned from the x-ms-blob-public-access header response.
31-
PublicAccess *PublicAccessType `xml:"BlobPublicAccess"`
31+
PublicAccess *PublicAccessType
3232

3333
// ClientRequestID contains the information returned from the x-ms-client-request-id header response.
34-
ClientRequestID *string `xml:"ClientRequestID"`
34+
ClientRequestID *string
3535

3636
// Date contains the information returned from the Date header response.
37-
Date *time.Time `xml:"Date"`
37+
Date *time.Time
3838

3939
// ETag contains the information returned from the ETag header response.
40-
ETag *azcore.ETag `xml:"ETag"`
40+
ETag *azcore.ETag
4141

4242
// LastModified contains the information returned from the Last-Modified header response.
43-
LastModified *time.Time `xml:"LastModified"`
43+
LastModified *time.Time
4444

4545
// RequestID contains the information returned from the x-ms-request-id header response.
46-
RequestID *string `xml:"RequestID"`
46+
RequestID *string
4747

4848
// a collection of signed identifiers
49-
SignedIdentifiers []*SignedIdentifier `xml:"SignedIdentifier"`
49+
SignedIdentifiers []*SignedIdentifier
5050

5151
// Version contains the information returned from the x-ms-version header response.
52-
Version *string `xml:"Version"`
52+
Version *string
5353
}
5454

5555
// since we want to remove the blob prefix in access type
@@ -140,3 +140,6 @@ type ListPathsSegmentResponse = generated.FileSystemClientListPathsResponse
140140

141141
// ListDeletedPathsSegmentResponse contains the response from method FilesystemClient.ListPathsSegment.
142142
type ListDeletedPathsSegmentResponse = generated.FileSystemClientListBlobHierarchySegmentResponse
143+
144+
// ListBlobsHierarchySegmentResponse contains the response from method FilesystemClient.ListBlobsHierarchySegment.
145+
type ListBlobsHierarchySegmentResponse = generated.ListBlobsHierarchySegmentResponse

sdk/storage/azdatalake/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake
33
go 1.18
44

55
require (
6-
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.5.0
6+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1
77
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0
88
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0
99
github.com/stretchr/testify v1.7.1

sdk/storage/azdatalake/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.5.0 h1:xGLAFFd9D3iLGxYiUGPdITSzsFmU1K8VtfuUHWAoN7M=
2-
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.5.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
1+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4=
2+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
33
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
44
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY=
55
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM=

sdk/storage/azdatalake/internal/base/clients.go

+4-18
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ type ClientOptions struct {
2222
pipelineOptions *runtime.PipelineOptions
2323
}
2424

25-
type Client[T any] struct {
26-
inner *T
27-
sharedKey *exported.SharedKeyCredential
28-
options *ClientOptions
29-
}
30-
31-
func InnerClient[T any](client *Client[T]) *T {
32-
return client.inner
33-
}
34-
35-
func SharedKey[T any](client *Client[T]) *exported.SharedKeyCredential {
36-
return client.sharedKey
37-
}
38-
39-
func GetClientOptions[T any](client *Client[T]) *ClientOptions {
40-
return client.options
41-
}
42-
4325
func GetPipelineOptions(clOpts *ClientOptions) *runtime.PipelineOptions {
4426
return clOpts.pipelineOptions
4527
}
@@ -96,3 +78,7 @@ func NewPathClient(dirURL string, dirURLWithBlobEndpoint string, client *blob.Cl
9678
options: options,
9779
}
9880
}
81+
82+
func GetCompositeClientOptions[T, K, U any](client *CompositeClient[T, K, U]) *ClientOptions {
83+
return client.options
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Licensed under the MIT License. See License.txt in the project root for license information.
6+
7+
package exported
8+
9+
import (
10+
"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
11+
)
12+
13+
// NOTE: these are publicly exported via type-aliasing in azdatalake/log.go
14+
const (
15+
// EventUpload is used when we compute number of chunks to upload and size of each chunk.
16+
EventUpload log.Event = "azdatalake.Upload"
17+
18+
// EventError is used for logging errors.
19+
EventError log.Event = "azdatalake.Error"
20+
)

sdk/storage/azdatalake/internal/exported/shared_key_credential.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"crypto/sha256"
1313
"encoding/base64"
1414
"fmt"
15+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
1516
"net/http"
1617
"net/url"
1718
"sort"
@@ -48,9 +49,12 @@ func (c *SharedKeyCredential) AccountName() string {
4849
return c.accountName
4950
}
5051

51-
// AccountKey returns the Storage account's name.
52-
func (c *SharedKeyCredential) AccountKey() string {
53-
return c.accountKeyString
52+
func (c *SharedKeyCredential) ConvertToBlobSharedKey() (*azblob.SharedKeyCredential, error) {
53+
cred, err := azblob.NewSharedKeyCredential(c.accountName, c.accountKeyString)
54+
if err != nil {
55+
return nil, err
56+
}
57+
return cred, nil
5458
}
5559

5660
// SetAccountKey replaces the existing account key with the specified account key.

0 commit comments

Comments
 (0)