diff --git a/sdk/storage/azfile/directory/models.go b/sdk/storage/azfile/directory/models.go index 8bbe023709b4..950cf1a91d63 100644 --- a/sdk/storage/azfile/directory/models.go +++ b/sdk/storage/azfile/directory/models.go @@ -18,6 +18,12 @@ import ( // SharedKeyCredential contains an account's name and its primary or secondary key. type SharedKeyCredential = exported.SharedKeyCredential +// NewSharedKeyCredential creates an immutable SharedKeyCredential containing the +// storage account's name and either its primary or secondary key. +func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error) { + return exported.NewSharedKeyCredential(accountName, accountKey) +} + // --------------------------------------------------------------------------------------------------------------------- // CreateOptions contains the optional parameters for the Client.Create method. diff --git a/sdk/storage/azfile/file/client_test.go b/sdk/storage/azfile/file/client_test.go index e498b9d66e65..f04191104e1a 100644 --- a/sdk/storage/azfile/file/client_test.go +++ b/sdk/storage/azfile/file/client_test.go @@ -23,7 +23,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/shared" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/testcommon" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/sas" - "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/service" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/share" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -1586,7 +1585,7 @@ func (f *FileRecordedTestsSuite) TestSASFileClientSignNegative() { _require.Greater(len(accountName), 0) _require.Greater(len(accountKey), 0) - cred, err := service.NewSharedKeyCredential(accountName, accountKey) + cred, err := file.NewSharedKeyCredential(accountName, accountKey) _require.NoError(err) testName := f.T().Name() diff --git a/sdk/storage/azfile/file/mmf_linux.go b/sdk/storage/azfile/file/mmf_unix.go similarity index 100% rename from sdk/storage/azfile/file/mmf_linux.go rename to sdk/storage/azfile/file/mmf_unix.go diff --git a/sdk/storage/azfile/file/models.go b/sdk/storage/azfile/file/models.go index 7796ea1e4dd4..f27195800f02 100644 --- a/sdk/storage/azfile/file/models.go +++ b/sdk/storage/azfile/file/models.go @@ -21,6 +21,12 @@ import ( // SharedKeyCredential contains an account's name and its primary or secondary key. type SharedKeyCredential = exported.SharedKeyCredential +// NewSharedKeyCredential creates an immutable SharedKeyCredential containing the +// storage account's name and either its primary or secondary key. +func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error) { + return exported.NewSharedKeyCredential(accountName, accountKey) +} + // SMBProperties contains the optional parameters regarding the SMB/NTFS properties for a file. type SMBProperties = exported.SMBProperties diff --git a/sdk/storage/azfile/share/client_test.go b/sdk/storage/azfile/share/client_test.go index 30bc1db399de..44940a537d27 100644 --- a/sdk/storage/azfile/share/client_test.go +++ b/sdk/storage/azfile/share/client_test.go @@ -1429,7 +1429,7 @@ func (s *ShareRecordedTestsSuite) TestSASShareClientSignNegative() { _require.Greater(len(accountName), 0) _require.Greater(len(accountKey), 0) - cred, err := service.NewSharedKeyCredential(accountName, accountKey) + cred, err := share.NewSharedKeyCredential(accountName, accountKey) _require.NoError(err) testName := s.T().Name() diff --git a/sdk/storage/azfile/share/models.go b/sdk/storage/azfile/share/models.go index f222d14d0867..5b200ce9429b 100644 --- a/sdk/storage/azfile/share/models.go +++ b/sdk/storage/azfile/share/models.go @@ -15,6 +15,12 @@ import ( // SharedKeyCredential contains an account's name and its primary or secondary key. type SharedKeyCredential = exported.SharedKeyCredential +// NewSharedKeyCredential creates an immutable SharedKeyCredential containing the +// storage account's name and either its primary or secondary key. +func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error) { + return exported.NewSharedKeyCredential(accountName, accountKey) +} + // --------------------------------------------------------------------------------------------------------------------- // CreateOptions contains the optional parameters for the Client.Create method.