Skip to content

Commit

Permalink
Storage STG 79 live tests (#24388)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcc-msft authored Oct 28, 2021
1 parent e266274 commit 73ade3d
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { } }
Expand Down Expand Up @@ -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
Expand Down
62 changes: 2 additions & 60 deletions sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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,
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> values) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down
22 changes: 1 addition & 21 deletions sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ internal static class Constants
/// Gets the default service version to use when building shared access
/// signatures.
/// </summary>
// 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";

/// <summary>
/// The default size of staged blocks when uploading small blobs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static class StorageVersionExtensions
/// </summary>
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
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
namespace Azure.Storage.Test
{
/// <summary>
/// Base class for Common tests
/// Base class for Common tests.
/// </summary>
[ClientTestFixture(
BlobClientOptions.ServiceVersion.V2020_06_12,
BlobClientOptions.ServiceVersion.V2020_08_04,
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<StorageTestEnvironment>
{
protected readonly BlobClientOptions.ServiceVersion _serviceVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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,
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { } }
Expand Down Expand Up @@ -378,7 +378,7 @@ public event System.EventHandler<Azure.Storage.Queues.Specialized.ClientSideDecr
}
public partial class SpecializedQueueClientOptions : Azure.Storage.Queues.QueueClientOptions
{
public SpecializedQueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2020_10_02) : base (default(Azure.Storage.Queues.QueueClientOptions.ServiceVersion)) { }
public SpecializedQueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2020_12_06) : base (default(Azure.Storage.Queues.QueueClientOptions.ServiceVersion)) { }
public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } }
}
public static partial class SpecializedQueueExtensions
Expand Down
3 changes: 2 additions & 1 deletion sdk/storage/platform-matrix-all-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"V2020_04_08",
"V2020_06_12",
"V2020_08_04",
"V2020_10_02"
"V2020_10_02",
"V2020_12_06"
]
}
}

0 comments on commit 73ade3d

Please sign in to comment.