Skip to content

Commit

Permalink
storage: rename authConfig to authConfigForAzureAD for better rea…
Browse files Browse the repository at this point in the history
…dability
  • Loading branch information
manicminer committed Apr 11, 2024
1 parent f8849bc commit db61b1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/services/storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Client struct {
BlobServicesClient *storage.BlobServicesClient
FileServicesClient *storage.FileServicesClient

authConfig *auth.Credentials
authConfigForAzureAD *auth.Credentials
}

func NewClient(o *common.ClientOptions) (*Client, error) {
Expand Down Expand Up @@ -95,7 +95,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
}

if o.StorageUseAzureAD {
client.authConfig = o.AuthConfig
client.authConfigForAzureAD = o.AuthConfig
}

return &client, nil
Expand Down
6 changes: 3 additions & 3 deletions internal/services/storage/client/data_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func (Client) DataPlaneOperationSupportingOnlySharedKeyAuth() DataPlaneOperation
}

func (c Client) configureDataPlane(ctx context.Context, clientName, resourceIdentifier string, baseClient client.BaseClient, account accountDetails, operation DataPlaneOperation) error {
if operation.SupportsAadAuthentication && c.authConfig != nil {
api := c.authConfig.Environment.Storage.WithResourceIdentifier(resourceIdentifier)
storageAuth, err := auth.NewAuthorizerFromCredentials(ctx, *c.authConfig, api)
if operation.SupportsAadAuthentication && c.authConfigForAzureAD != nil {
api := c.authConfigForAzureAD.Environment.Storage.WithResourceIdentifier(resourceIdentifier)
storageAuth, err := auth.NewAuthorizerFromCredentials(ctx, *c.authConfigForAzureAD, api)
if err != nil {
return fmt.Errorf("unable to build authorizer for Storage API: %+v", err)
}
Expand Down

0 comments on commit db61b1a

Please sign in to comment.