diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs index 7b5552324dc2..9a8c2416e85e 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs @@ -15,6 +15,8 @@ namespace Azure.Storage.Blobs.ChangeFeed.Tests [ClientTestFixture( BlobClientOptions.ServiceVersion.V2020_06_12, BlobClientOptions.ServiceVersion.V2020_08_04, + BlobClientOptions.ServiceVersion.V2020_10_02, + BlobClientOptions.ServiceVersion.V2020_12_06, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion, RecordingServiceVersion = StorageVersionExtensions.MaxVersion, diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index ab427e1bdafc..81a5ddfdb147 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -49,7 +49,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2020_10_02) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2020_12_06) { } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } public string EncryptionScope { get { throw null; } set { } } @@ -1690,7 +1690,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2020_10_02) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2020_12_06) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs index c4549fa72add..bd8f4a004826 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs @@ -345,12 +345,7 @@ public BlobSasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential sh var expiryTime = SasExtensions.FormatTimesForSasSigning(ExpiresOn); // See http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx - string stringToSign; - - // TODO https://github.com/Azure/azure-sdk-for-net/issues/23369 - if (SasQueryParametersInternals.DefaultSasVersionInternal == "2020-12-06") - { - stringToSign = String.Join("\n", + string stringToSign = String.Join("\n", Permissions, startTime, expiryTime, @@ -367,26 +362,6 @@ public BlobSasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential sh ContentEncoding, ContentLanguage, ContentType); - } - else - { - stringToSign = string.Join("\n", - Permissions, - startTime, - expiryTime, - GetCanonicalName(sharedKeyCredential.AccountName, BlobContainerName ?? string.Empty, BlobName ?? string.Empty), - Identifier, - IPRange.ToString(), - SasExtensions.ToProtocolString(Protocol), - Version, - Resource, - Snapshot ?? BlobVersionId, - CacheControl, - ContentDisposition, - ContentEncoding, - ContentLanguage, - ContentType); - } string signature = StorageSharedKeyCredentialInternals.ComputeSasSignature(sharedKeyCredential,stringToSign); @@ -436,12 +411,7 @@ public BlobSasQueryParameters ToSasQueryParameters(UserDelegationKey userDelegat string signedExpiry = SasExtensions.FormatTimesForSasSigning(userDelegationKey.SignedExpiresOn); // See http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx - string stringToSign; - - // TODO https://github.com/Azure/azure-sdk-for-net/issues/23369 - if (SasQueryParametersInternals.DefaultSasVersionInternal == "2020-12-06") - { - stringToSign = string.Join("\n", + string stringToSign = string.Join("\n", Permissions, startTime, expiryTime, @@ -466,34 +436,6 @@ public BlobSasQueryParameters ToSasQueryParameters(UserDelegationKey userDelegat ContentEncoding, ContentLanguage, ContentType); - } - else - { - stringToSign = string.Join("\n", - Permissions, - startTime, - expiryTime, - GetCanonicalName(accountName, BlobContainerName ?? string.Empty, BlobName ?? string.Empty), - userDelegationKey.SignedObjectId, - userDelegationKey.SignedTenantId, - signedStart, - signedExpiry, - userDelegationKey.SignedService, - userDelegationKey.SignedVersion, - PreauthorizedAgentObjectId, - null, // AgentObjectId - enabled only in HNS accounts - CorrelationId, - IPRange.ToString(), - SasExtensions.ToProtocolString(Protocol), - Version, - Resource, - Snapshot ?? BlobVersionId, - CacheControl, - ContentDisposition, - ContentEncoding, - ContentLanguage, - ContentType); - } string signature = ComputeHMACSHA256(userDelegationKey.Value, stringToSign); diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs index b6575480e226..ead6a2011ceb 100644 --- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs @@ -160,7 +160,7 @@ public enum SasProtocol } public partial class SasQueryParameters { - public const string DefaultSasVersion = "2020-10-02"; + public const string DefaultSasVersion = "2020-12-06"; protected SasQueryParameters() { } protected SasQueryParameters(System.Collections.Generic.IDictionary values) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs index 7c2a1ace0d02..33577e188a82 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs @@ -204,12 +204,7 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared string expiryTime = SasExtensions.FormatTimesForSasSigning(ExpiresOn); // String to sign: http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx - string stringToSign; - - // TODO https://github.com/Azure/azure-sdk-for-net/issues/23369 - if (SasQueryParametersInternals.DefaultSasVersionInternal == "2020-12-06") - { - stringToSign = string.Join("\n", + string stringToSign = string.Join("\n", sharedKeyCredential.AccountName, Permissions, Services.ToPermissionsString(), @@ -221,21 +216,6 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared Version, EncryptionScope, string.Empty); // That's right, the account SAS requires a terminating extra newline - } - else - { - stringToSign = string.Join("\n", - sharedKeyCredential.AccountName, - Permissions, - Services.ToPermissionsString(), - ResourceTypes.ToPermissionsString(), - startTime, - expiryTime, - IPRange.ToString(), - Protocol.ToProtocolString(), - Version, - string.Empty); // That's right, the account SAS requires a terminating extra newline - } string signature = sharedKeyCredential.ComputeHMACSHA256(stringToSign); SasQueryParameters p = SasQueryParametersInternals.Create( diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs index d369e13d1537..e3cfe230443c 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs @@ -24,8 +24,7 @@ internal static class Constants /// Gets the default service version to use when building shared access /// signatures. /// - // TODO https://github.com/Azure/azure-sdk-for-net/issues/23369 - public const string DefaultSasVersion = "2020-10-02"; + public const string DefaultSasVersion = "2020-12-06"; /// /// The default size of staged blocks when uploading small blobs. diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs index ab38302c3c58..eac94130f606 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs @@ -36,7 +36,7 @@ internal static class StorageVersionExtensions /// public const ServiceVersion LatestVersion = #if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK - ServiceVersion.V2020_10_02; + ServiceVersion.V2020_12_06; #else ERROR_STORAGE_SERVICE_NOT_DEFINED; #endif diff --git a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs index be2d767ed9ba..70863a8a1509 100644 --- a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs +++ b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs @@ -12,7 +12,7 @@ namespace Azure.Storage.Test { /// - /// Base class for Common tests + /// Base class for Common tests. /// [ClientTestFixture( BlobClientOptions.ServiceVersion.V2020_06_12, @@ -20,7 +20,7 @@ namespace Azure.Storage.Test BlobClientOptions.ServiceVersion.V2020_10_02, BlobClientOptions.ServiceVersion.V2020_12_06, RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2020_12_06, - LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2020_10_02 })] + LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2020_12_06 })] public abstract class CommonTestBase : StorageTestBase { protected readonly BlobClientOptions.ServiceVersion _serviceVersion; diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs index 965baac24e87..ec97cd8706a2 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake { public partial class DataLakeClientOptions : Azure.Core.ClientOptions { - public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2020_10_02) { } + public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2020_12_06) { } public bool EnableTenantDiscovery { get { throw null; } set { } } public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } } public Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion Version { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Sas/DataLakeSasBuilder.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Sas/DataLakeSasBuilder.cs index 1e0c9c36139d..695545bfb0cc 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Sas/DataLakeSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Sas/DataLakeSasBuilder.cs @@ -357,12 +357,7 @@ public DataLakeSasQueryParameters ToSasQueryParameters(StorageSharedKeyCredentia string expiryTime = SasExtensions.FormatTimesForSasSigning(ExpiresOn); // See http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx - string stringToSign; - - // TODO https://github.com/Azure/azure-sdk-for-net/issues/23369 - if (SasQueryParametersInternals.DefaultSasVersionInternal == "2020-12-06") - { - stringToSign = string.Join("\n", + string stringToSign = string.Join("\n", Permissions, startTime, expiryTime, @@ -379,26 +374,6 @@ public DataLakeSasQueryParameters ToSasQueryParameters(StorageSharedKeyCredentia ContentEncoding, ContentLanguage, ContentType); - } - else - { - stringToSign = string.Join("\n", - Permissions, - startTime, - expiryTime, - GetCanonicalName(sharedKeyCredential.AccountName, FileSystemName ?? string.Empty, Path ?? string.Empty), - Identifier, - IPRange.ToString(), - SasExtensions.ToProtocolString(Protocol), - Version, - Resource, - null, // snapshot - CacheControl, - ContentDisposition, - ContentEncoding, - ContentLanguage, - ContentType); - } string signature = StorageSharedKeyCredentialInternals.ComputeSasSignature(sharedKeyCredential, stringToSign); @@ -448,12 +423,7 @@ public DataLakeSasQueryParameters ToSasQueryParameters(UserDelegationKey userDel string signedExpiry = SasExtensions.FormatTimesForSasSigning(userDelegationKey.SignedExpiresOn); // See http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx - string stringToSign; - - // TODO https://github.com/Azure/azure-sdk-for-net/issues/23369 - if (SasQueryParametersInternals.DefaultSasVersionInternal == "2020-12-06") - { - stringToSign = string.Join("\n", + string stringToSign = string.Join("\n", Permissions, startTime, expiryTime, @@ -478,34 +448,6 @@ public DataLakeSasQueryParameters ToSasQueryParameters(UserDelegationKey userDel ContentEncoding, ContentLanguage, ContentType); - } - else - { - stringToSign = string.Join("\n", - Permissions, - startTime, - expiryTime, - GetCanonicalName(accountName, FileSystemName ?? string.Empty, Path ?? string.Empty), - userDelegationKey.SignedObjectId, - userDelegationKey.SignedTenantId, - signedStart, - signedExpiry, - userDelegationKey.SignedService, - userDelegationKey.SignedVersion, - PreauthorizedAgentObjectId, - AgentObjectId, - CorrelationId, - IPRange.ToString(), - SasExtensions.ToProtocolString(Protocol), - Version, - Resource, - null, // snapshot - CacheControl, - ContentDisposition, - ContentEncoding, - ContentLanguage, - ContentType); - } string signature = ComputeHMACSHA256(userDelegationKey.Value, stringToSign); diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs index 8cb5c30eceef..e10a5409da20 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs @@ -95,7 +95,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential } public partial class ShareClientOptions : Azure.Core.ClientOptions { - public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2020_10_02) { } + public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2020_12_06) { } public Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion { diff --git a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs index d4276c77bec1..436a599200d8 100644 --- a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.netstandard2.0.cs @@ -70,7 +70,7 @@ public QueueClient(System.Uri queueUri, Azure.Storage.StorageSharedKeyCredential } public partial class QueueClientOptions : Azure.Core.ClientOptions { - public QueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2020_10_02) { } + public QueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2020_12_06) { } public bool EnableTenantDiscovery { get { throw null; } set { } } public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } } public Azure.Storage.Queues.QueueMessageEncoding MessageEncoding { get { throw null; } set { } } @@ -378,7 +378,7 @@ public event System.EventHandler