diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/InternalBlobLegalHoldResult.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/InternalBlobLegalHoldResult.java new file mode 100644 index 0000000000000..a2b07af0a1612 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/InternalBlobLegalHoldResult.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.implementation.models; + +import com.azure.storage.blob.models.BlobLegalHoldResult; + +/** + * The blob legal hold result. + */ +public class InternalBlobLegalHoldResult implements BlobLegalHoldResult { + + private final boolean hasLegalHold; + + /** + * Creates a new BlobLegalHoldResult + * @param hasLegalHold whether or not a legal hold is enabled on the blob. + */ + public InternalBlobLegalHoldResult(boolean hasLegalHold) { + this.hasLegalHold = hasLegalHold; + } + + /** + * @return whether or not a legal hold is enabled on the blob. + */ + public boolean hasLegalHold() { + return hasLegalHold; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java new file mode 100644 index 0000000000000..8040c6126095e --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.implementation.util; + +public enum BlobRequestConditionProperty { + LEASE_ID, + TAGS_CONDITIONS, + IF_MODIFIED_SINCE, + IF_UNMODIFIED_SINCE, + IF_MATCH, + IF_NONE_MATCH; +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java index 1516679aeba46..1afb9de4ac41b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java @@ -24,6 +24,7 @@ import com.azure.storage.blob.models.BlobItemProperties; import com.azure.storage.blob.models.BlobLeaseRequestConditions; import com.azure.storage.blob.models.BlobQueryHeaders; +import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.ObjectReplicationPolicy; import com.azure.storage.blob.models.ObjectReplicationRule; import com.azure.storage.blob.models.ObjectReplicationStatus; @@ -37,6 +38,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Collections; +import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -500,4 +502,39 @@ public static BlobQueryHeaders transformQueryHeaders(HttpHeaders headers) { throw LOGGER.logExceptionAsError(new RuntimeException(e)); } } + + public static void validateConditionsNotPresent(BlobRequestConditions requestConditions, + EnumSet invalidConditions) { + if (requestConditions == null) { + return; + } + if (invalidConditions.contains(BlobRequestConditionProperty.LEASE_ID) + && requestConditions.getLeaseId() != null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'leaseId' is not applicable to this API.")); + } + if (invalidConditions.contains(BlobRequestConditionProperty.TAGS_CONDITIONS) + && requestConditions.getTagsConditions() != null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'tagsConditions' is not applicable to " + + "this API.")); + } + if (invalidConditions.contains(BlobRequestConditionProperty.IF_MODIFIED_SINCE) + && requestConditions.getIfModifiedSince() != null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifModifiedSince' is not applicable to " + + "this API.")); + } + if (invalidConditions.contains(BlobRequestConditionProperty.IF_UNMODIFIED_SINCE) + && requestConditions.getIfUnmodifiedSince() != null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifUnmodifiedSince' is not applicable to " + + "this API.")); + } + if (invalidConditions.contains(BlobRequestConditionProperty.IF_MATCH) + && requestConditions.getIfMatch() != null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifMatch' is not applicable to this API.")); + } + if (invalidConditions.contains(BlobRequestConditionProperty.IF_NONE_MATCH) + && requestConditions.getIfNoneMatch() != null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifNoneMatch' is not applicable to this " + + "API.")); + } + } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java index a251795284912..a174a24933c2a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java @@ -6,22 +6,10 @@ /** * The blob legal hold result. */ -public class BlobLegalHoldResult { - - private final boolean hasLegalHold; - - /** - * Creates a new BlobLegalHoldResult - * @param hasLegalHold whether or not a legal hold is enabled on the blob. - */ - public BlobLegalHoldResult(boolean hasLegalHold) { - this.hasLegalHold = hasLegalHold; - } +public interface BlobLegalHoldResult { /** * @return whether or not a legal hold is enabled on the blob. */ - public boolean hasLegalHold() { - return hasLegalHold; - } + boolean hasLegalHold(); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index 4e66bcaa6aa80..e5d0d664ab80d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -34,19 +34,21 @@ import com.azure.storage.blob.implementation.models.BlobsSetImmutabilityPolicyHeaders; import com.azure.storage.blob.implementation.models.BlobsStartCopyFromURLHeaders; import com.azure.storage.blob.implementation.models.EncryptionScope; +import com.azure.storage.blob.implementation.models.InternalBlobLegalHoldResult; import com.azure.storage.blob.implementation.models.QueryRequest; import com.azure.storage.blob.implementation.models.QuerySerialization; import com.azure.storage.blob.implementation.util.BlobQueryReader; +import com.azure.storage.blob.implementation.util.BlobRequestConditionProperty; import com.azure.storage.blob.implementation.util.BlobSasImplUtil; import com.azure.storage.blob.implementation.util.ChunkedDownloadUtils; import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.ArchiveStatus; -import com.azure.storage.blob.models.BlobDownloadContentAsyncResponse; -import com.azure.storage.blob.models.BlobDownloadHeaders; import com.azure.storage.blob.models.BlobBeginCopySourceRequestConditions; import com.azure.storage.blob.models.BlobCopyInfo; import com.azure.storage.blob.models.BlobDownloadAsyncResponse; +import com.azure.storage.blob.models.BlobDownloadContentAsyncResponse; +import com.azure.storage.blob.models.BlobDownloadHeaders; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobImmutabilityPolicy; import com.azure.storage.blob.models.BlobImmutabilityPolicyMode; @@ -99,6 +101,7 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -2240,7 +2243,12 @@ Mono> setImmutabilityPolicyWithResponse( BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - // TODO (gapra) : Discuss, should we just expose ifUnmodifiedSince here? + + ModelHelper.validateConditionsNotPresent(finalRequestConditions, + EnumSet.of(BlobRequestConditionProperty.LEASE_ID, BlobRequestConditionProperty.TAGS_CONDITIONS, + BlobRequestConditionProperty.IF_MATCH, BlobRequestConditionProperty.IF_NONE_MATCH, + BlobRequestConditionProperty.IF_MODIFIED_SINCE)); + return this.azureBlobStorage.getBlobs().setImmutabilityPolicyWithResponseAsync(containerName, blobName, null, null, finalRequestConditions.getIfUnmodifiedSince(), finalImmutabilityPolicy.getExpiryTime(), finalImmutabilityPolicy.getPolicyMode(), @@ -2349,6 +2357,6 @@ Mono> setLegalHoldWithResponse(boolean legalHold, legalHold, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response, - new BlobLegalHoldResult(response.getDeserializedHeaders().isXMsLegalHold()))); + new InternalBlobLegalHoldResult(response.getDeserializedHeaders().isXMsLegalHold()))); } } diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy index aaf441258acd9..7cbed8318295d 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy @@ -48,9 +48,11 @@ import spock.lang.Unroll import java.nio.ByteBuffer import java.nio.charset.StandardCharsets import java.time.Duration -import java.time.temporal.ChronoUnit + import java.time.OffsetDateTime + import java.time.temporal.ChronoUnit @ResourceLock("ManagementPlaneThrottling") +@RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") class ImmutableStorageWithVersioningTest extends APISpec { private BlobContainerClient vlwContainer; @@ -65,7 +67,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { def setup() { containerName = generateContainerName() - if (env.testMode != TestMode.PLAYBACK) { String url = String.format("https://management.azure.com/subscriptions/%s/resourceGroups/%s/providers/" + "Microsoft.Storage/storageAccounts/%s/blobServices/default/containers/%s?api-version=%s", subscriptionId, @@ -138,7 +139,7 @@ class ImmutableStorageWithVersioningTest extends APISpec { if (blob.getProperties().hasLegalHold()) { blobClient.setLegalHold(false) } - if (blob.getProperties().getImmutabilityPolicyMode() != null) { + if (blob.getProperties().getImmutabilityPolicy().getPolicyMode() != null) { sleepIfRecord(5 * 1000) blobClient.deleteImmutabilityPolicy() } @@ -156,7 +157,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "set immutability policy min"() { setup: def expiryTime = getNamer().getUtcNow().plusSeconds(2) @@ -175,7 +175,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { BlobImmutabilityPolicyMode.UNLOCKED == response.getPolicyMode() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") @Unroll def "set immutability policy"() { setup: @@ -218,7 +217,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { BlobImmutabilityPolicyMode.UNLOCKED || _ } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") @Unroll def "set immutability policy AC"() { setup: @@ -241,7 +239,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { newDate || _ } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "set immutability policy AC fail"() { setup: def bac = new BlobRequestConditions() @@ -259,7 +256,36 @@ class ImmutableStorageWithVersioningTest extends APISpec { e.getErrorCode() == BlobErrorCode.CONDITION_NOT_MET } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") + @Unroll + def "set immutability policy AC IA"() { + setup: + def bac = new BlobRequestConditions() + .setLeaseId(leaseId) + .setTagsConditions(tags) + .setIfMatch(ifMatch) + .setIfNoneMatch(ifNoneMatch) + .setIfModifiedSince(ifModifiedSince) + def expiryTime = getNamer().getUtcNow().plusSeconds(2) + def immutabilityPolicy = new BlobImmutabilityPolicy() + .setExpiryTime(expiryTime) + .setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED) + + when: + vlwBlob.setImmutabilityPolicyWithResponse(immutabilityPolicy, bac, null, null) + + then: + def e = thrown(IllegalArgumentException) + e.getMessage() == wrongCondition + " is not applicable to this API." + + where: + leaseId | tags | ifMatch | ifNoneMatch | ifModifiedSince || wrongCondition + "leaseId" | null | null | null | null || "'leaseId'" + null | "tagsConditions" | null | null | null || "'tagsConditions'" + null | null | "ifMatch" | null | null || "'ifMatch'" + null | null | null | "ifNoneMatch" | null || "'ifNoneMatch'" + null | null | null | null | oldDate || "'ifModifiedSince'" + } + def "set immutability policy error"() { setup: def blob = vlwContainer.getBlobClient(generateBlobName()) @@ -276,7 +302,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "set immutability policy IA"() { setup: def expiryTime = getNamer().getUtcNow().plusSeconds(2) @@ -292,7 +317,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { e.getMessage() == "immutabilityPolicy.policyMode must be Locked or Unlocked" } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "delete immutability policy min"() { setup: def expiryTime = getNamer().getUtcNow().plusSeconds(2) @@ -310,7 +334,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { properties.getImmutabilityPolicy().getExpiryTime() == null } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "delete immutability policy"() { setup: def expiryTime = getNamer().getUtcNow().plusSeconds(2) @@ -328,7 +351,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { properties.getImmutabilityPolicy().getExpiryTime() == null } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "delete immutability policy error"() { setup: def blob = vlwContainer.getBlobClient(generateBlobName()) @@ -341,7 +363,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") @Unroll def "set legal hold min"() { when: @@ -356,7 +377,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { false || _ } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") @Unroll def "set legal hold"() { when: "set legal hold" @@ -387,7 +407,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { false || _ } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "set legal hold error"() { setup: def blob = vlwContainer.getBlobClient(generateBlobName()) @@ -400,7 +419,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "container properties"() { when: def response = vlwContainer.getProperties() @@ -417,7 +435,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { container.getProperties().isImmutableStorageWithVersioningEnabled() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "append blob create"() { setup: def appendBlob = vlwContainer.getBlobClient(generateBlobName()).getAppendBlobClient() @@ -440,7 +457,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { response.hasLegalHold() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "page blob create"() { setup: def pageBlob = vlwContainer.getBlobClient(generateBlobName()).getPageBlobClient() @@ -463,7 +479,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { response.hasLegalHold() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "block blob commit block list"() { setup: def blockBlob = vlwBlob.getBlockBlobClient() @@ -486,7 +501,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { response.hasLegalHold() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "block blob upload"() { setup: def blockBlob = vlwBlob.getBlockBlobClient() @@ -509,7 +523,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { response.hasLegalHold() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") @Unroll @LiveOnly def "blob upload"() { @@ -539,7 +552,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { null || _ // Tests single shot upload } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "sync copy"() { setup: vlwContainer.setAccessPolicy(PublicAccessType.CONTAINER, null) @@ -566,7 +578,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { vlwContainer.setAccessPolicy(null, null) } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "copy"() { setup: def destination = vlwContainer.getBlobClient(generateBlobName()).getBlockBlobClient() @@ -591,7 +602,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { } /* SAS tests */ - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "account sas"() { setup: def expiryTime = namer.getUtcNow().plusDays(1) @@ -622,7 +632,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { !response.hasLegalHold() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "container sas"() { setup: def expiryTime = namer.getUtcNow().plusDays(1) @@ -651,7 +660,6 @@ class ImmutableStorageWithVersioningTest extends APISpec { !response.hasLegalHold() } - @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") def "blob sas"() { setup: def expiryTime = namer.getUtcNow().plusDays(1) diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json new file mode 100644 index 0000000000000..4f3f34498bc4b --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/1e8e8c1301e8e8c13d1e4448478653498e9004a219f2?restype=container", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "da7835f2-2cb0-40eb-9f13-0e808de4b12f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D93288C91D6509", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:12 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fc34c3f0-f01e-0001-1571-649c3e000000", + "x-ms-client-request-id" : "da7835f2-2cb0-40eb-9f13-0e808de4b12f", + "Date" : "Fri, 18 Jun 2021 18:42:11 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/1e8e8c1311e8e8c13d1e86956ffcc18240e2b4ad1b61/1e8e8c1321e8e8c13d1e55651a3205039d57541cc88c", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "b96decb4-acca-4a6c-ada0-f82fe8090be7", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:15 GMT", + "x-ms-version-id" : "2021-06-18T18:42:15.2590905Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Fri, 18 Jun 2021 18:42:15 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "eTag" : "0x8D93288CB03A639", + "x-ms-request-id" : "fc34c401-f01e-0001-2271-649c3e000000", + "x-ms-client-request-id" : "b96decb4-acca-4a6c-ada0-f82fe8090be7" + }, + "Exception" : null + } ], + "variables" : [ "1e8e8c1301e8e8c13d1e4448478653498e9004a219f2", "1e8e8c1311e8e8c13d1e86956ffcc18240e2b4ad1b61", "1e8e8c1321e8e8c13d1e55651a3205039d57541cc88c", "2021-06-18T18:42:16.251301Z" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json new file mode 100644 index 0000000000000..08ba8e7080c01 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/0795bd5200795bd5264a871964e42487c620d4113860?restype=container", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "57037666-1f95-4d07-9930-802b4c50fce4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D93288CC0E4AE6", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:17 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fc34c419-f01e-0001-3671-649c3e000000", + "x-ms-client-request-id" : "57037666-1f95-4d07-9930-802b4c50fce4", + "Date" : "Fri, 18 Jun 2021 18:42:16 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/0795bd5210795bd5264a783820c02b3169fc34074a83/0795bd5220795bd5264a93710522f48ec6a7f418d8e3", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "f6693c7e-5d3d-4091-9256-e17a00c03888", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:19 GMT", + "x-ms-version-id" : "2021-06-18T18:42:19.0179529Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Fri, 18 Jun 2021 18:42:18 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "eTag" : "0x8D93288CD4134C9", + "x-ms-request-id" : "fc34c428-f01e-0001-4271-649c3e000000", + "x-ms-client-request-id" : "f6693c7e-5d3d-4091-9256-e17a00c03888" + }, + "Exception" : null + } ], + "variables" : [ "0795bd5200795bd5264a871964e42487c620d4113860", "0795bd5210795bd5264a783820c02b3169fc34074a83", "0795bd5220795bd5264a93710522f48ec6a7f418d8e3", "2021-06-18T18:42:19.976318300Z" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json new file mode 100644 index 0000000000000..155f445699949 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/2cb8ee9102cb8ee9164102835a79ea298db1a4894aae?restype=container", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "fd680b20-cd02-4150-b4c3-ce35d27c7128" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D93288CE06EB2B", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:20 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fc34c440-f01e-0001-5171-649c3e000000", + "x-ms-client-request-id" : "fd680b20-cd02-4150-b4c3-ce35d27c7128", + "Date" : "Fri, 18 Jun 2021 18:42:20 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/2cb8ee9112cb8ee9164137518b52f87282b0941deb76/2cb8ee9122cb8ee9164196392ec1ff16ca250421c830", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "8a2d1417-399a-449b-91d6-9b63894ecbbc", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:21 GMT", + "x-ms-version-id" : "2021-06-18T18:42:21.4295815Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Fri, 18 Jun 2021 18:42:21 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "eTag" : "0x8D93288CEB13107", + "x-ms-request-id" : "fc34c44e-f01e-0001-5a71-649c3e000000", + "x-ms-client-request-id" : "8a2d1417-399a-449b-91d6-9b63894ecbbc" + }, + "Exception" : null + } ], + "variables" : [ "2cb8ee9102cb8ee9164102835a79ea298db1a4894aae", "2cb8ee9112cb8ee9164137518b52f87282b0941deb76", "2cb8ee9122cb8ee9164196392ec1ff16ca250421c830", "2021-06-18T18:42:22.389302800Z" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json new file mode 100644 index 0000000000000..43467d72fb00c --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/35a3dfd0035a3dfd06a9905570e076781bcfc459ab19?restype=container", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "5e16c32a-29b4-47b4-908f-218e8bca0407" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D93288CF773572", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:22 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fc34c459-f01e-0001-6471-649c3e000000", + "x-ms-client-request-id" : "5e16c32a-29b4-47b4-908f-218e8bca0407", + "Date" : "Fri, 18 Jun 2021 18:42:22 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/35a3dfd0135a3dfd06a986521d0138992e11d49bda42/35a3dfd0235a3dfd06a92931554d601c5752c41d4a1d", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d21b6c89-5215-416f-8aeb-1c91a5e2e8ec", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:23 GMT", + "x-ms-version-id" : "2021-06-18T18:42:23.7032885Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Fri, 18 Jun 2021 18:42:23 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "eTag" : "0x8D93288D00C21B5", + "x-ms-request-id" : "fc34c460-f01e-0001-6971-649c3e000000", + "x-ms-client-request-id" : "d21b6c89-5215-416f-8aeb-1c91a5e2e8ec" + }, + "Exception" : null + } ], + "variables" : [ "35a3dfd0035a3dfd06a9905570e076781bcfc459ab19", "35a3dfd0135a3dfd06a986521d0138992e11d49bda42", "35a3dfd0235a3dfd06a92931554d601c5752c41d4a1d", "2021-06-18T18:42:24.657302800Z" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json new file mode 100644 index 0000000000000..8ec72aeea119e --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/7ae2491707ae24917e0e112126fda4915ca294f5e942?restype=container", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "dd31cb6e-af83-4c93-9e7d-decd45935e0a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D93288D0CC3382", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:24 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fc34c46e-f01e-0001-7571-649c3e000000", + "x-ms-client-request-id" : "dd31cb6e-af83-4c93-9e7d-decd45935e0a", + "Date" : "Fri, 18 Jun 2021 18:42:24 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/7ae2491717ae24917e0e668618a86a9b9006a4da9913/7ae2491727ae24917e0e80803ccac87d6b83647ba9ba", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0b92404f-d4d0-44db-8aed-950801357fcb", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Fri, 18 Jun 2021 18:42:25 GMT", + "x-ms-version-id" : "2021-06-18T18:42:25.9120332Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Fri, 18 Jun 2021 18:42:25 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "eTag" : "0x8D93288D15D28CC", + "x-ms-request-id" : "fc34c47b-f01e-0001-7e71-649c3e000000", + "x-ms-client-request-id" : "0b92404f-d4d0-44db-8aed-950801357fcb" + }, + "Exception" : null + } ], + "variables" : [ "7ae2491707ae24917e0e112126fda4915ca294f5e942", "7ae2491717ae24917e0e668618a86a9b9006a4da9913", "7ae2491727ae24917e0e80803ccac87d6b83647ba9ba", "2021-06-18T18:42:26.864331800Z" ] +} \ No newline at end of file