diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index b2e855c8a33b..cf1be11a813c 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -98,6 +98,12 @@ 1.0.8 test + + com.azure + azure-security-keyvault-keys + 4.2.0-beta.5 + test + diff --git a/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java b/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java index f611c6c64caf..e19ac54fc828 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java @@ -252,7 +252,7 @@ public Mono> uploadWithResponse(Flux data, AccessTier tier, BlobRequestConditions requestConditions) { return this.uploadWithResponse(new BlobParallelUploadOptions(data) .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata) - .setTier(AccessTier.HOT).setRequestConditions(requestConditions)); + .setTier(tier).setRequestConditions(requestConditions)); } /** @@ -443,24 +443,24 @@ Mono encryptBlob(Flux plainTextFlux) throws InvalidKe keyWrappingMetadata.put(CryptographyConstants.AGENT_METADATA_KEY, CryptographyConstants.AGENT_METADATA_VALUE); - return this.keyWrapper.wrapKey(keyWrapAlgorithm, aesKey.getEncoded()) - .map(encryptedKey -> { - WrappedKey wrappedKey = new WrappedKey( - this.keyWrapper.getKeyId().block(), encryptedKey, keyWrapAlgorithm); - - // Build EncryptionData - EncryptionData encryptionData = new EncryptionData() - .setEncryptionMode(CryptographyConstants.ENCRYPTION_MODE) - .setEncryptionAgent( - new EncryptionAgent(CryptographyConstants.ENCRYPTION_PROTOCOL_V1, - EncryptionAlgorithm.AES_CBC_256)) - .setKeyWrappingMetadata(keyWrappingMetadata) - .setContentEncryptionIV(cipher.getIV()) - .setWrappedContentKey(wrappedKey); - - // Encrypt plain text with content encryption key - Flux encryptedTextFlux = plainTextFlux.map(plainTextBuffer -> { - int outputSize = cipher.getOutputSize(plainTextBuffer.remaining()); + return this.keyWrapper.getKeyId().flatMap(keyId -> + this.keyWrapper.wrapKey(keyWrapAlgorithm, aesKey.getEncoded()) + .map(encryptedKey -> { + WrappedKey wrappedKey = new WrappedKey(keyId, encryptedKey, keyWrapAlgorithm); + + // Build EncryptionData + EncryptionData encryptionData = new EncryptionData() + .setEncryptionMode(CryptographyConstants.ENCRYPTION_MODE) + .setEncryptionAgent( + new EncryptionAgent(CryptographyConstants.ENCRYPTION_PROTOCOL_V1, + EncryptionAlgorithm.AES_CBC_256)) + .setKeyWrappingMetadata(keyWrappingMetadata) + .setContentEncryptionIV(cipher.getIV()) + .setWrappedContentKey(wrappedKey); + + // Encrypt plain text with content encryption key + Flux encryptedTextFlux = plainTextFlux.map(plainTextBuffer -> { + int outputSize = cipher.getOutputSize(plainTextBuffer.remaining()); /* This should be the only place we allocate memory in encryptBlob(). Although there is an @@ -468,33 +468,33 @@ This should be the only place we allocate memory in encryptBlob(). Although ther customer's memory, so we must allocate our own memory. If memory usage becomes unreasonable, we should implement pooling. */ - ByteBuffer encryptedTextBuffer = ByteBuffer.allocate(outputSize); - - int encryptedBytes; - try { - encryptedBytes = cipher.update(plainTextBuffer, encryptedTextBuffer); - } catch (ShortBufferException e) { - throw logger.logExceptionAsError(Exceptions.propagate(e)); - } - encryptedTextBuffer.position(0); - encryptedTextBuffer.limit(encryptedBytes); - return encryptedTextBuffer; - }); + ByteBuffer encryptedTextBuffer = ByteBuffer.allocate(outputSize); + + int encryptedBytes; + try { + encryptedBytes = cipher.update(plainTextBuffer, encryptedTextBuffer); + } catch (ShortBufferException e) { + throw logger.logExceptionAsError(Exceptions.propagate(e)); + } + encryptedTextBuffer.position(0); + encryptedTextBuffer.limit(encryptedBytes); + return encryptedTextBuffer; + }); /* Defer() ensures the contained code is not executed until the Flux is subscribed to, in other words, cipher.doFinal() will not be called until the plainTextFlux has completed and therefore all other data has been encrypted. */ - encryptedTextFlux = Flux.concat(encryptedTextFlux, Flux.defer(() -> { - try { - return Flux.just(ByteBuffer.wrap(cipher.doFinal())); - } catch (GeneralSecurityException e) { - throw logger.logExceptionAsError(Exceptions.propagate(e)); - } + encryptedTextFlux = Flux.concat(encryptedTextFlux, Flux.defer(() -> { + try { + return Flux.just(ByteBuffer.wrap(cipher.doFinal())); + } catch (GeneralSecurityException e) { + throw logger.logExceptionAsError(Exceptions.propagate(e)); + } + })); + return new EncryptedBlob(encryptionData, encryptedTextFlux); })); - return new EncryptedBlob(encryptionData, encryptedTextFlux); - }); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { // These are hardcoded and guaranteed to work. There is no reason to propogate a checked exception. throw logger.logExceptionAsError(new RuntimeException(e)); diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy index de3aeaa59052..02055a459996 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy @@ -19,6 +19,7 @@ import com.azure.core.test.utils.TestResourceNamer import com.azure.core.util.Configuration import com.azure.core.util.FluxUtil import com.azure.core.util.logging.ClientLogger +import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm import com.azure.storage.blob.BlobAsyncClient import com.azure.storage.blob.BlobClient import com.azure.storage.blob.BlobServiceClientBuilder @@ -88,7 +89,7 @@ class APISpec extends Specification { static def PREMIUM_STORAGE = "PREMIUM_STORAGE_" TestResourceNamer resourceNamer - private InterceptorManager interceptorManager + def InterceptorManager interceptorManager protected String testName // Fields used for conveniently creating blobs with data. @@ -229,8 +230,10 @@ class APISpec extends Specification { AsyncKeyEncryptionKeyResolver keyResolver, StorageSharedKeyCredential credential, String endpoint, HttpPipelinePolicy... policies) { + + KeyWrapAlgorithm algorithm = key != null && key.getKeyId().block() == "local" ? KeyWrapAlgorithm.A256KW : KeyWrapAlgorithm.RSA_OAEP_256 EncryptedBlobClientBuilder builder = new EncryptedBlobClientBuilder() - .key(key, "keyWrapAlgorithm") + .key(key, algorithm.toString()) .keyResolver(keyResolver) .endpoint(endpoint) .httpClient(getHttpClient()) @@ -277,7 +280,7 @@ class APISpec extends Specification { generateResourceName(containerPrefix, entityNo++) } - private String generateResourceName(String prefix, int entityNo) { + def String generateResourceName(String prefix, int entityNo) { return resourceNamer.randomName(prefix + testName + entityNo, 63) } diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy index fbf00e854406..27505b53e4de 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy @@ -1201,10 +1201,8 @@ class EncyptedBlockBlobAPITest extends APISpec { Files.deleteIfExists(file.toPath()) expect: - def bac = new EncryptedBlobClientBuilder() - .key(fakeKey, "keyWrapAlgorithm") - .pipeline(ebc.getHttpPipeline()) - .endpoint(ebc.getBlobUrl()) + def bac = getEncryptedClientBuilder(fakeKey, null, primaryCredential, + ebc.getBlobUrl().toString()) .buildEncryptedBlobAsyncClient() /* diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy new file mode 100644 index 000000000000..76ed12e999dc --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy @@ -0,0 +1,144 @@ +package com.azure.storage.blob.specialized.cryptography + + +import com.azure.core.credential.TokenCredential +import com.azure.core.cryptography.AsyncKeyEncryptionKey +import com.azure.core.http.HttpClient +import com.azure.core.http.HttpPipeline +import com.azure.core.http.HttpPipelineBuilder +import com.azure.core.http.policy.* +import com.azure.core.test.TestMode +import com.azure.core.util.Configuration +import com.azure.identity.ClientSecretCredentialBuilder +import com.azure.security.keyvault.keys.KeyClient +import com.azure.security.keyvault.keys.KeyClientBuilder +import com.azure.security.keyvault.keys.KeyServiceVersion +import com.azure.security.keyvault.keys.cryptography.KeyEncryptionKeyClientBuilder +import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions +import com.azure.security.keyvault.keys.models.KeyVaultKey +import com.azure.storage.blob.BlobContainerClient +import com.azure.storage.common.implementation.Constants + +import java.time.Duration +import java.time.OffsetDateTime + +class KeyvaultKeyTest extends APISpec { + + BlobContainerClient cc + EncryptedBlobClient bec // encrypted client for download + KeyClient keyClient + String keyId + + def setup() { + def keyVaultUrl = "https://azstoragesdkvault.vault.azure.net/" + if (testMode != TestMode.PLAYBACK) { + keyVaultUrl = Configuration.getGlobalConfiguration().get("KEYVAULT_URL") + } + + keyClient = new KeyClientBuilder() + .pipeline(getHttpPipeline(getHttpClient(), KeyServiceVersion.V7_0)) + .httpClient(getHttpClient()) + .vaultUrl(keyVaultUrl) + .buildClient() + + keyId = generateResourceName("keyId", entityNo++) + + KeyVaultKey keyVaultKey = keyClient.createRsaKey(new CreateRsaKeyOptions(keyId) + .setExpiresOn(OffsetDateTime.now().plusYears(1)) + .setKeySize(2048)) + + AsyncKeyEncryptionKey akek = new KeyEncryptionKeyClientBuilder() + .pipeline(getHttpPipeline(getHttpClient(), KeyServiceVersion.V7_0)) + .httpClient(getHttpClient()) + .buildAsyncKeyEncryptionKey(keyVaultKey.getId()) + .block() + + cc = getServiceClientBuilder(primaryCredential, + String.format(defaultEndpointTemplate, primaryCredential.getAccountName())) + .buildClient() + .getBlobContainerClient(generateContainerName()) + cc.create() + + bec = getEncryptedClientBuilder(akek, null, primaryCredential, + cc.getBlobContainerUrl().toString()) + .blobName(generateBlobName()) + .buildEncryptedBlobClient() + } + + def cleanup() { + keyClient.beginDeleteKey(keyId) + } + + def "upload download"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + bec.download(os) + + then: + inputArray == os.toByteArray() + } + + + def "encryption not a noop"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + cc.getBlobClient(bec.getBlobName()).download(os) + + then: + inputArray != os.toByteArray() + } + + HttpPipeline getHttpPipeline(HttpClient httpClient, KeyServiceVersion serviceVersion) { + TokenCredential credential = null; + + if (!interceptorManager.isPlaybackMode()) { + String clientId = System.getenv("AZURE_CLIENT_ID"); + String clientKey = System.getenv("AZURE_CLIENT_SECRET"); + String tenantId = System.getenv("AZURE_TENANT_ID"); + Objects.requireNonNull(clientId, "The client id cannot be null"); + Objects.requireNonNull(clientKey, "The client key cannot be null"); + Objects.requireNonNull(tenantId, "The tenant id cannot be null"); + credential = new ClientSecretCredentialBuilder() + .clientSecret(clientKey) + .clientId(clientId) + .tenantId(tenantId) + .build(); + } + + // Closest to API goes first, closest to wire goes last. + final List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy("client_name", "client_version", Configuration.getGlobalConfiguration().clone(), serviceVersion)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + RetryStrategy strategy = new ExponentialBackoff(5, Duration.ofSeconds(2), Duration.ofSeconds(16)); + policies.add(new RetryPolicy(strategy)); + if (credential != null) { + policies.add(new BearerTokenAuthenticationPolicy(credential, "https://vault.azure.net/.default")); + } + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); + + if (!interceptorManager.isPlaybackMode()) { + if (testMode == TestMode.RECORD) { + policies.add(interceptorManager.getRecordPolicy()); + } + } + + HttpPipeline pipeline = new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient) + .build() + + return pipeline; + } + +} diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy new file mode 100644 index 000000000000..51ceff2b7732 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy @@ -0,0 +1,70 @@ +package com.azure.storage.blob.specialized.cryptography + +import com.azure.core.cryptography.AsyncKeyEncryptionKey +import com.azure.security.keyvault.keys.cryptography.LocalKeyEncryptionKeyClientBuilder +import com.azure.security.keyvault.keys.models.JsonWebKey +import com.azure.security.keyvault.keys.models.KeyOperation +import com.azure.storage.blob.BlobContainerClient +import com.azure.storage.common.implementation.Constants + +import javax.crypto.spec.SecretKeySpec + +class LocalKeyTest extends APISpec { + + BlobContainerClient cc + EncryptedBlobClient bec // encrypted client for download + + def setup() { + + /* Insecurely generate a local key*/ + def byteKey = getRandomByteArray(256) + + JsonWebKey localKey = JsonWebKey.fromAes(new SecretKeySpec(byteKey, "AES"), + Arrays.asList(KeyOperation.WRAP_KEY, KeyOperation.UNWRAP_KEY)) + .setId("local") + AsyncKeyEncryptionKey akek = new LocalKeyEncryptionKeyClientBuilder() + .buildAsyncKeyEncryptionKey(localKey) + .block(); + + cc = getServiceClientBuilder(primaryCredential, + String.format(defaultEndpointTemplate, primaryCredential.getAccountName())) + .buildClient() + .getBlobContainerClient(generateContainerName()) + cc.create() + + bec = getEncryptedClientBuilder(akek, null, primaryCredential, + cc.getBlobContainerUrl().toString()) + .blobName(generateBlobName()) + .buildEncryptedBlobClient() + } + + def "upload download"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + bec.download(os) + + then: + inputArray == os.toByteArray() + } + + + def "encryption not a noop"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + cc.getBlobClient(bec.getBlobName()).download(os) + + then: + inputArray != os.toByteArray() + } + +} diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json new file mode 100644 index 000000000000..04c35a9bcbda --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json @@ -0,0 +1,192 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/create?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:18 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "720", + "x-ms-request-id" : "7d6548b5-0e3a-4c13-80e0-352c9cbf2a0b", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"uBnP5BN7G2udE55UQBHutohk7mT_ew5uvvN7tmpyrJzPulJp4zyF6ir9VRekLLPGIIslU_t85CQ4Ci3M_ED001yW7F_VMIOf9y3S6GmRwFZdq7mEN1LemQGcnIfRCt2_WwbyEYkBGbWCJ-jHYka3e-Vi_eDh6o8Df0PgS_xpMBq-0XHwJkH6mqNQ33fq1qL25WkU8SrXLMI43v4brvi-hIjkc2WbQ-_6NKvo2QCahz334Z0g2us2RYuU7X5hya17_z352qAc2yhFE5dM3h5-oDFo6nrzA0kmeI7IZDl2Lhsxfn-XMSr9Yj_tLoinEYNmcOD94RUq7Z9tvsjdemkTAQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199217,\"created\":1594663219,\"updated\":1594663219,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop171244ed5268a26698440d99?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "653dc3b9-d785-4b51-bb69-252618de76b3" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D827569B29F86C", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:19 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "27296606-e01e-0036-023f-591cf2000000", + "Date" : "Mon, 13 Jul 2020 18:00:19 GMT", + "x-ms-client-request-id" : "653dc3b9-d785-4b51-bb69-252618de76b3" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:20 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "720", + "x-ms-request-id" : "67c51823-d43d-461e-93f6-e4501887dceb", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"uBnP5BN7G2udE55UQBHutohk7mT_ew5uvvN7tmpyrJzPulJp4zyF6ir9VRekLLPGIIslU_t85CQ4Ci3M_ED001yW7F_VMIOf9y3S6GmRwFZdq7mEN1LemQGcnIfRCt2_WwbyEYkBGbWCJ-jHYka3e-Vi_eDh6o8Df0PgS_xpMBq-0XHwJkH6mqNQ33fq1qL25WkU8SrXLMI43v4brvi-hIjkc2WbQ-_6NKvo2QCahz334Z0g2us2RYuU7X5hya17_z352qAc2yhFE5dM3h5-oDFo6nrzA0kmeI7IZDl2Lhsxfn-XMSr9Yj_tLoinEYNmcOD94RUq7Z9tvsjdemkTAQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199217,\"created\":1594663219,\"updated\":1594663219,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52/wrapkey?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:20 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "483", + "x-ms-request-id" : "1b5f886f-761b-47ef-b1e0-0ad07f40147c", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"value\":\"TnHszga0jtMgVrILwAfD7RHkCSVob7dBbjzbIYBzBZENjRZpK8pg6RdTMOQjjGjeJ7vQa4a6sMzi6QZAXEqCaZBxAmCI9Gki9kzyhDB7iQsezgxVXFXwgbP5l0losyloC-LZ8oj2R4q3_piwn2TzOp5_aSFZEXJg2RKk1uChTs5Z1wJKzvFzU9kFm6TamkZV8nugUdXyKCWnEdr9SC-8K4Enzd12-x-y6dDhvIAfBtxMhHogRzjs_nFkVOH-51d0XoWOzT5RECuAC31qM2_r7jO3fEc5nkuj2d1CccLidRw_t9xE8C_Q3hH4A3Dr9Jgj_ssm-F6-OL6z_H2aP3DeMQ\"}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop171244ed5268a26698440d99/javablobencryptionnotanoop27156640b9d246514c436", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "62c86199-fe16-4e78-bbca-9393439c2424", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "3Ov9JQRxFMU=", + "x-ms-version-id" : "2020-07-13T18:00:21.3119819Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:21 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 13 Jul 2020 18:00:21 GMT", + "Content-MD5" : "Vd6Vxx1qJiYdOrMi/Gd+Yw==", + "ETag" : "0x8D827569C22C34B", + "Content-Length" : "0", + "x-ms-request-id" : "47f93a42-601e-0017-403f-593889000000", + "x-ms-client-request-id" : "62c86199-fe16-4e78-bbca-9393439c2424" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop171244ed5268a26698440d99/javablobencryptionnotanoop27156640b9d246514c436", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "a74bd53c-9dc2-4a62-85fc-c645266cd672" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-13T18:00:21.3119819Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:21 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:21 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "Vd6Vxx1qJiYdOrMi/Gd+Yw==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"EncryptedKey\":\"TnHszga0jtMgVrILwAfD7RHkCSVob7dBbjzbIYBzBZENjRZpK8pg6RdTMOQjjGjeJ7vQa4a6sMzi6QZAXEqCaZBxAmCI9Gki9kzyhDB7iQsezgxVXFXwgbP5l0losyloC+LZ8oj2R4q3/piwn2TzOp5/aSFZEXJg2RKk1uChTs5Z1wJKzvFzU9kFm6TamkZV8nugUdXyKCWnEdr9SC+8K4Enzd12+x+y6dDhvIAfBtxMhHogRzjs/nFkVOH+51d0XoWOzT5RECuAC31qM2/r7jO3fEc5nkuj2d1CccLidRw/t9xE8C/Q3hH4A3Dr9Jgj/ssm+F6+OL6z/H2aP3DeMQ==\",\"Algorithm\":\"RSA-OAEP-256\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"8/VZpyje4/1Dk3wyopvv/w==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D827569C22C34B", + "x-ms-creation-time" : "Mon, 13 Jul 2020 18:00:21 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "fb82267b-501e-001c-403f-59c3e2000000", + "Body" : "[-65, 116, 7, -122, -101, -92, -29, 17, 86, 26, 118, -91, 108, 57, -6, 77, 93, -70, -17, 1, -75, -103, -123, -105, 51, 59, 44, 51, 43, 10, -3, 52, 124, 63, -26, -3, 35, -54, 127, 33, -115, 94, -101, -92, 10, -113, -38, -121, -117, -6, -67, 69, -41, 19, 28, 92, -14, -125, 114, 13, -73, -106, -121, 110, 118, 32, -61, -65, -89, 18, -98, 102, -128, -41, -34, 127, -16, -14, -97, 75, -79, 18, -1, 119, 3, 124, 29, -10, -36, 36, 97, -61, -106, -54, 39, -123, -127, -56, 30, 61, 88, 108, -36, 57, -14, 76, 110, 99, -14, -18, 109, -76, -28, -42, -18, -54, -94, 29, 28, 93, 6, 46, -86, -76, 104, -58, -12, 63, -121, -26, -2, -82, -68, 117, 125, 126, 87, -26, -70, 83, -116, -105, -32, 39, -52, -50, 29, 44, 41, 68, -107, 105, 36, 98, -115, -46, 13, 19, -60, 104, 108, 57, 120, -117, -38, 54, 24, 120, -52, -7, 23, 78, -1, 126, 122, -32, -90, 23, -67, -17, 124, -64, 35, 122, 105, 102, -47, -127, 79, -54, 103, 109, 45, -21, 124, 73, -1, 53, 94, -71, -31, 58, -13, 110, 91, 53, 112, -112, 89, -65, -63, -95, -13, -35, -114, -52, -27, -87, 56, -3, -76, 104, -81, -74, 35, -19, 6, 108, 107, -83, -28, 76, -79, 32, 57, 12, 37, -25, -64, -122, -96, 60, -4, 0, -65, -117, 114, -106, 91, 57, 37, 73, -14, -37, 55, -43, 87, 103, -59, -126, -26, -17, 107, 102, 96, -94, -60, -124, -103, -96, 91, -104, 74, 10, 43, 92, -107, -113, -57, 41, 120, -28, 118, 9, 123, -3, 44, 26, -65, -40, -114, 81, -98, -89, -117, 102, -104, -31, 51, 13, -13, -35, 48, -88, -37, -122, -63, 47, 102, 118, -79, 103, 127, 42, 117, 125, -91, -32, 33, -96, -5, 57, -103, -4, -87, -51, 115, -75, -114, 60, -116, -21, -116, -62, -98, 127, 115, 10, -40, -119, 20, -47, -35, 44, -63, 4, 15, 83, -78, 56, -76, -8, 2, -92, -77, -56, 117, 46, -29, -103, 19, -122, 123, 105, 104, 107, -95, -61, 100, 29, -75, 125, 36, -103, -14, -36, 34, 113, -9, -76, -14, -41, -52, 126, 99, 74, -31, 7, 100, -63, 35, -57, -59, -121, -70, -72, -97, -61, 58, 99, 44, 58, 24, 42, -47, -58, 56, 88, 94, 58, 34, -26, -32, -20, -43, -13, -76, 26, 79, -106, -1, 72, 42, 55, 97, -104, 112, -113, 70, -112, 90, -53, 57, -111, -120, -117, -103, 13, 49, 63, -116, -80, -61, -82, 124, 103, -16, 104, -68, 45, -50, -75, 16, 113, 10, 80, 79, -44, -40, -92, 28, 5, 53, -128, 114, -69, 7, 15, -6, 111, 5, 62, 123, 52, 124, 68, -54, 65, 76, 13, -76, -21, -96, 68, 73, -14, -107, 79, -3, 112, 67, -63, -27, 74, 49, -107, -63, -18, 81, 30, 109, -70, -125, 26, 107, -117, -46, 57, -44, -52, 123, -34, 121, 34, -117, -61, -8, -69, 26, -112, -14, -107, -37, -108, -16, -118, 17, -109, -78, -123, -63, -58, 31, 22, 12, 103, 105, 114, -30, 34, -100, -110, -49, -69, -57, -120, -63, -119, 117, -45, -88, 122, 3, -6, 66, 1, -110, -99, 115, 87, 58, -47, -19, 39, -119, -32, -38, 36, 64, 41, -87, 59, -62, 37, -93, 125, -19, 89, -66, -37, -70, -21, -18, -4, 79, -56, 21, 63, 124, 24, 71, -68, 98, 2, -41, -3, 30, 109, 64, 83, -4, 51, -2, 16, 30, -1, -57, -107, 21, 30, 12, -10, 60, 76, -69, 116, -82, -46, 2, 115, 69, -10, 110, 104, 9, 57, -75, -78, 114, 93, 4, 104, -4, 109, -104, -126, -123, 124, 67, 97, -28, -61, 39, -117, -18, 26, 112, -6, -74, -86, -18, -94, 57, 105, 56, -68, -118, -110, 123, -72, -23, -27, -63, 112, -46, -23, 124, 2, 62, 79, -50, -79, -26, 116, -111, 94, 98, 69, -88, 78, 87, 104, -24, -76, -109, -101, -116, -128, 75, -25, -115, 2, -45, 100, 48, -118, 113, 6, 3, -52, 124, 68, -26, 96, 13, 29, -48, 59, 7, -37, -51, 90, -66, 3, -117, -2, 126, -50, -83, -58, 1, 122, 40, -79, 16, 1, -42, -8, -29, 51, -37, 89, -92, 24, 91, 91, 76, -10, 10, -81, -63, -122, 124, -104, 76, -128, 19, -68, 124, -113, -83, -100, 98, 123, -14, 120, 10, -95, -2, 86, 36, 33, -124, -39, 26, -19, 123, -65, -46, -101, -27, -113, -42, -46, 73, 34, -28, 4, 23, -12, -49, 110, 103, 77, 6, 19, -11, -26, 94, 93, 101, 109, 66, -6, 93, 23, 6, -50, 24, -69, 38, 79, -78, -47, 68, 64, -117, -107, -23, -33, -52, 100, -104, -55, -45, -93, -87, 2, -103, -12, 49, -77, 69, 29, -18, 89, -100, 62, -92, -44, -113, 53, -91, -108, 68, -109, -34, -64, 102, 125, -4, -11, 6, -126, 42, -82, 31, 77, -69, 10, -72, 117, 53, 3, -54, -4, -9, 41, 48, -23, -19, -14, -32, 8, 92, -120, -81, -88, 79, 47, 5, 110, -48, 109, 84, -51, -11, 102, 15, 76, 38, 121, 31, 45, -118, -38, 58, -99, 123, -69, 56, -116, 4, 126, -67, 8, 120, -124, 68, 8, -120, -18, 92, 124, 44, 15, 73, -87, -76, -72, 17, 29, 104, 87, 38, -26, -71, 94, -88, -68, 20, -127, 26, 64, -51, 98, 97, 37, 121, 83, -36, -107, 122, -106, -15, 35, -88, 107, -93, -3, -100, -43, -83, -20, -63, 121, 24, -75, 58, -12, 91, 91, -120, -116, 19, -107, -41, -71, 75, -18, -28, -110, -80, -95, -32, 122, 127, -83, 43, 5, 115, 104, 101, 45, -99, 7, -63, 85, -124, -99, 45, -124, -90, 97, 120, 11, 12, 92, -6, 75, 125, -33, 119, 100, -96, 112, -103, -29, -51, 78, -40, 58, -3, 104, 10, -38, 1, 120, 46, 48, -28, 77, -117, 90, -29, 81, -58, -28, -38, -18, -26, -3, -48, -55, -105, 37, -105, -80, 94, 51, 75, -85, 79, -82, -101, 52, -63, -18, 13, -99]", + "x-ms-client-request-id" : "a74bd53c-9dc2-4a62-85fc-c645266cd672", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:21 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "887", + "x-ms-request-id" : "ee80c090-3316-4f40-ab28-8cc687adcdcf", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"recoveryId\":\"https://ceciliakeys.vault.azure.net/deletedkeys/keyidencryptionnotanoop047803044603746e214892b\",\"deletedDate\":1594663222,\"scheduledPurgeDate\":1602439222,\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"uBnP5BN7G2udE55UQBHutohk7mT_ew5uvvN7tmpyrJzPulJp4zyF6ir9VRekLLPGIIslU_t85CQ4Ci3M_ED001yW7F_VMIOf9y3S6GmRwFZdq7mEN1LemQGcnIfRCt2_WwbyEYkBGbWCJ-jHYka3e-Vi_eDh6o8Df0PgS_xpMBq-0XHwJkH6mqNQ33fq1qL25WkU8SrXLMI43v4brvi-hIjkc2WbQ-_6NKvo2QCahz334Z0g2us2RYuU7X5hya17_z352qAc2yhFE5dM3h5-oDFo6nrzA0kmeI7IZDl2Lhsxfn-XMSr9Yj_tLoinEYNmcOD94RUq7Z9tvsjdemkTAQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199217,\"created\":1594663219,\"updated\":1594663219,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "keyidencryptionnotanoop047803044603746e214892b", "jtcencryptionnotanoop171244ed5268a26698440d99", "javablobencryptionnotanoop27156640b9d246514c436", "a656206c-3f99-48c1-a2b5-b6e3f25e8d8a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json new file mode 100644 index 000000000000..9714d7e10d45 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json @@ -0,0 +1,219 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/create?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:13 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "734", + "x-ms-request-id" : "9d8404d7-bd9e-47e6-bd01-d198122d503d", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tyu4Kv7CHRuYk_6IaEj-q-8wI4ck3b57WnvJlYYSiPoTUPFkW4Z7hdKNocG0qCN5s9_ULpcx6biyc25hIR5tq1fBhJdSptGZ1xqiBBxvleXg4F4a4pm56FP5XqJThfJtdHbyf7nkDDUat65xouV6BQrWSFWg53wBh1hWemUXzBvMEdAcV-Py0aqp_SrQTf1ie6cAV_0w27uU5Mmryq6aluvOSaDY9WBdwVFDlihugkGODNm7Kcfhb88LWVptvFduQvHYxnzOryGQ99ek63Uy1h3Bikaa40vO2xsRb8NcowLW8X8am38h_0pfhubcvldl00ueBmjvGJ_Rac7_nfNalw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199210,\"created\":1594663214,\"updated\":1594663214,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload1keyvaultkeytestuploaddownload459787768474?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "93f048e3-2827-4399-a1c5-55be8fd8cc1b" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D82756986EBB46", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "40f612d2-e01e-0026-6f3f-59d99a000000", + "Date" : "Mon, 13 Jul 2020 18:00:14 GMT", + "x-ms-client-request-id" : "93f048e3-2827-4399-a1c5-55be8fd8cc1b" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:15 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "734", + "x-ms-request-id" : "4fb6e3b4-28c1-4563-9a07-ebafbe1372d9", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tyu4Kv7CHRuYk_6IaEj-q-8wI4ck3b57WnvJlYYSiPoTUPFkW4Z7hdKNocG0qCN5s9_ULpcx6biyc25hIR5tq1fBhJdSptGZ1xqiBBxvleXg4F4a4pm56FP5XqJThfJtdHbyf7nkDDUat65xouV6BQrWSFWg53wBh1hWemUXzBvMEdAcV-Py0aqp_SrQTf1ie6cAV_0w27uU5Mmryq6aluvOSaDY9WBdwVFDlihugkGODNm7Kcfhb88LWVptvFduQvHYxnzOryGQ99ek63Uy1h3Bikaa40vO2xsRb8NcowLW8X8am38h_0pfhubcvldl00ueBmjvGJ_Rac7_nfNalw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199210,\"created\":1594663214,\"updated\":1594663214,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06/wrapkey?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:16 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "497", + "x-ms-request-id" : "478204ba-9d5a-4485-8b6c-e25cb068c72c", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"value\":\"M8kBNLKvlbvPVWFw0T7kktnOmpLFUUWsHRi9TpfZpSfWj9-ZR2-rCF68nXTjuFOC_CuaCdvpD-3TlG6Ho5-fePtXVOx2DF764uCGNwbmBgVSpalVeLDmetKiaYv2KsFksoUNjaHzuEM4xIzQ0DOFUe6NlZOj-8mKOLRTWofsQoQ1GZB-sz7Gs7Ha8YaSZSOXX-hMVklNo9uIausCMhvvmXcaC4vKon3OaGYGXNuo1qayO9a9dfpTFe4GficRw_73YsPTqU-7q1mN_tG1aNTOnoYkw8OErx395_hPNc-3g49xumJFjp2m2i8UTbkuYb5a9BHIRkB9IaTB3ByHnjG3Fw\"}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload1keyvaultkeytestuploaddownload459787768474/javablobuploaddownload2keyvaultkeytestuploaddownload459877433", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e0dd75f7-c1ed-44f5-9491-b995a61ac34c", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "wHFJUjOnMMI=", + "x-ms-version-id" : "2020-07-13T18:00:16.7847574Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:16 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 13 Jul 2020 18:00:15 GMT", + "Content-MD5" : "VbM8HcNSn56AgffJ1qC07w==", + "ETag" : "0x8D82756996FF696", + "Content-Length" : "0", + "x-ms-request-id" : "ebe90ccc-f01e-0048-3f3f-598cb5000000", + "x-ms-client-request-id" : "e0dd75f7-c1ed-44f5-9491-b995a61ac34c" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload1keyvaultkeytestuploaddownload459787768474/javablobuploaddownload2keyvaultkeytestuploaddownload459877433", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7c129d65-939f-452d-8829-e5a49395d536" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-13T18:00:16.7847574Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:16 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:16 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "VbM8HcNSn56AgffJ1qC07w==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"EncryptedKey\":\"M8kBNLKvlbvPVWFw0T7kktnOmpLFUUWsHRi9TpfZpSfWj9+ZR2+rCF68nXTjuFOC/CuaCdvpD+3TlG6Ho5+fePtXVOx2DF764uCGNwbmBgVSpalVeLDmetKiaYv2KsFksoUNjaHzuEM4xIzQ0DOFUe6NlZOj+8mKOLRTWofsQoQ1GZB+sz7Gs7Ha8YaSZSOXX+hMVklNo9uIausCMhvvmXcaC4vKon3OaGYGXNuo1qayO9a9dfpTFe4GficRw/73YsPTqU+7q1mN/tG1aNTOnoYkw8OErx395/hPNc+3g49xumJFjp2m2i8UTbkuYb5a9BHIRkB9IaTB3ByHnjG3Fw==\",\"Algorithm\":\"RSA-OAEP-256\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"DINtkrRXlqGDXfjaOYhgnw==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D82756996FF696", + "x-ms-creation-time" : "Mon, 13 Jul 2020 18:00:16 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "5e0c33a7-501e-00a5-403f-59c7f8000000", + "Body" : "[-50, 33, -103, 106, -116, 67, 43, -23, 10, 97, 111, 20, 37, -67, 109, 99, -38, 92, -45, 48, 21, -118, 118, -81, -118, 36, -82, -101, 97, 69, -38, -110, 110, -123, 51, -24, 104, -46, -121, -110, 58, 105, 26, -78, -17, -95, -39, 18, 90, -32, -80, -20, -60, -7, -47, -65, 93, 18, 60, 19, 44, -62, 16, -33, 97, -48, -100, 47, -81, 86, 92, 101, -124, -34, 20, -86, -109, 45, -57, -126, -46, -126, -64, 46, -37, 73, -83, 71, -116, -125, 13, 12, 54, -87, -33, -86, 9, -47, -55, -87, -61, -5, -9, -34, -119, -67, -54, 56, 2, 82, 108, -110, -126, -18, -58, -37, -76, -81, 66, 93, -51, -28, -71, 81, -68, -108, -28, 117, -120, 92, -100, 105, 1, 21, 5, -70, -117, -15, 111, 56, 10, 46, -97, -108, -65, 11, 58, -69, 25, -86, 2, 69, 49, -102, 117, -56, -57, -12, -96, -83, -55, -28, 43, -124, 3, 92, -22, -71, -76, -107, 66, 27, -47, -7, -60, 87, 52, -53, -70, -126, -47, -9, -87, -113, 109, -81, 51, -8, -23, -100, -43, 103, -89, 77, 13, 109, 48, 119, 27, -112, -32, 45, -108, 23, -38, 118, -42, 14, -4, -28, 103, -22, 96, -25, 127, 38, -89, -111, -3, -120, 94, -3, 46, -113, -39, 77, -63, 25, -82, -46, -35, -64, -125, 121, 52, -51, -19, 97, 83, -56, -95, -44, -101, -53, -115, 29, -41, -118, -6, 37, 52, 10, -32, -99, 112, -38, -53, -85, -33, -51, 57, -73, -119, -93, -18, -99, 118, 114, -97, 114, -85, -126, 119, -63, -2, 19, 11, -75, -28, 85, -26, 73, -79, 37, -127, 40, 23, -23, -114, -111, 64, -109, -124, -71, -62, -44, 109, -71, 46, 83, -101, -106, 54, -9, -78, -91, 96, -46, 125, -51, 69, 29, -79, -37, 29, 98, 75, 44, -113, -120, 40, -37, -97, 105, 120, 7, -29, -55, 112, -49, 48, -103, -70, -92, 3, 85, -43, -44, -119, -77, -24, 57, 5, 75, 126, 7, -47, 101, 67, -48, -120, 1, 5, -60, -14, -71, 113, 82, -69, -79, 42, -101, 76, -111, -104, 88, -123, -66, 119, -32, 57, -14, 102, 2, -69, 122, 126, 27, 42, 106, -4, -89, 69, 68, 110, -27, -43, -102, 37, 105, -46, -101, 38, 70, -103, -3, 68, -66, -23, 48, 98, -24, -26, 118, 82, -110, 36, -7, -34, 1, -55, 60, 116, -39, 34, 111, -121, -23, 18, -87, -123, -33, -26, -10, -1, 31, -122, 60, 118, 127, -124, -20, 41, 66, -74, -91, -27, 44, 47, 7, 45, -25, -55, -11, 33, 62, 106, -15, -10, 43, -51, 111, -76, -46, -72, -53, 13, 100, 35, 42, 120, -22, -100, 123, -32, 31, 27, -56, -91, -6, -128, 29, -59, -127, -86, -126, 32, -37, -97, 127, 34, -117, 47, 15, -128, 8, -24, -64, 114, -109, 49, 23, 41, -11, -76, 84, 32, -43, 45, 111, -58, -75, 118, -41, 5, 61, -53, -46, -60, -120, 107, -122, 55, 126, 94, 95, -110, -101, -67, 100, -20, 93, 87, 125, -88, -127, 31, -83, 84, -121, -85, 6, 7, -11, 13, -117, -8, 91, 100, 91, 105, 102, 52, 6, -115, -24, -31, -3, -57, -28, 40, -87, -40, 102, 96, 55, 57, -61, 71, 73, 67, -55, 18, -49, 59, -112, 2, 7, -124, -126, -43, -108, -28, 74, -6, -125, 21, 1, -23, -44, -54, -89, 90, 30, 114, 126, -102, -101, -38, 54, -61, 0, -109, 100, 101, -53, -13, -24, -20, 3, 48, 26, 43, -51, -29, -71, -2, 52, -121, -6, -99, 125, -84, 56, -117, -5, -47, 125, -101, -115, 15, -66, -34, 48, 113, 16, -94, -49, -60, 29, 64, 92, -89, -111, 58, -30, -78, 58, 79, -69, 6, -128, -59, -127, -38, 11, -10, 0, 80, 67, -85, 86, 105, 5, -4, 25, -7, -11, 113, -22, 123, 95, 113, -71, 54, -3, -62, -119, 14, 6, 122, -35, 98, 42, 93, 80, -5, 98, 119, 9, 125, -80, -13, -25, 89, -61, -65, -79, -119, -78, -31, -13, 84, -56, 24, 42, -119, -41, 75, -94, -69, 47, 23, 5, 25, -60, -70, -44, 26, -54, -87, 11, 40, -114, 100, -55, -128, 47, -10, -75, 24, -22, 86, 6, 29, 118, 79, -67, 10, 9, -128, -54, -77, -69, -126, -5, 23, -40, -1, 100, 43, 74, -74, -77, 89, -71, -75, -75, -94, 109, -72, -61, -90, 83, -96, 97, -68, 17, 20, 44, 9, 74, -120, -2, 125, -29, 77, -96, 45, 18, 80, 85, 2, -65, -81, -28, -4, -105, -103, 39, -4, 109, 43, -64, 89, 55, -13, -45, -64, 127, 49, -15, -93, -45, -21, -66, 125, -112, 76, 1, 105, -69, -112, 11, 75, -122, 57, -54, -30, -41, -62, -99, 58, -36, 43, -56, 43, -68, 27, 54, -121, -106, 88, -93, 63, 100, -62, 20, -4, -23, 69, -97, 40, 40, -124, 97, -71, 42, -96, -97, 30, 53, 48, -73, 60, -94, 75, -91, 53, -110, 81, -81, -42, -45, 49, 122, 14, 87, -23, -7, -38, -92, 8, 126, 115, 101, -85, -27, 14, -7, 107, -23, -99, 6, 35, -21, -46, 17, -121, 105, -15, 69, 89, -93, 49, -117, 67, 74, -68, 57, -91, -107, -9, 0, -68, -79, 59, -39, -46, 90, -45, -87, 55, 25, -61, -17, 103, 31, -109, 79, -29, 72, -107, -59, 87, 97, -77, 83, 111, -78, -56, -5, -25, -19, -72, 59, 11, -31, 121, 88, 75, 88, 53, 93, 97, 75, -4, 82, -102, -23, -54, -13, -120, 113, -25, 98, -4, -120, 6, -105, -21, 15, 12, -52, -17, 54, 108, -103, 122, -37, 69, -48, -29, 102, 3, 99, -106, -29, -57, -32, -47, 127, -73, 70, -49, -43, 107, -24, -5, -111, -84, -18, 56, 121, -45, 38, -34, 104, -77, -55, -71, 115, -20, 19, 75, -113, 73, -55, -9, -110, 77, -97, 34, -3, 12, 68, -100, 97, 82, 65, 53, -107, -99, -127, -39, 33, -107, -74, -24, -89, 91, 102, -115, 114, 41, -117, -36, -83, -28, -117, -81, -23, -67, -73, 81, -119, -108, 24, 91, 99]", + "x-ms-client-request-id" : "7c129d65-939f-452d-8829-e5a49395d536", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06/unwrapkey?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:17 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "198", + "x-ms-request-id" : "bf6b6756-5d81-474d-a109-6426224a60e4", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"value\":\"T6mK_G9zSuAGykH-usvr3X5ZdNnEriBiT0VLZkEV_xs\"}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:18 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "915", + "x-ms-request-id" : "b7761dd4-f5ee-4297-97a7-cd6e4df47fd3", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"recoveryId\":\"https://ceciliakeys.vault.azure.net/deletedkeys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192\",\"deletedDate\":1594663218,\"scheduledPurgeDate\":1602439218,\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tyu4Kv7CHRuYk_6IaEj-q-8wI4ck3b57WnvJlYYSiPoTUPFkW4Z7hdKNocG0qCN5s9_ULpcx6biyc25hIR5tq1fBhJdSptGZ1xqiBBxvleXg4F4a4pm56FP5XqJThfJtdHbyf7nkDDUat65xouV6BQrWSFWg53wBh1hWemUXzBvMEdAcV-Py0aqp_SrQTf1ie6cAV_0w27uU5Mmryq6aluvOSaDY9WBdwVFDlihugkGODNm7Kcfhb88LWVptvFduQvHYxnzOryGQ99ek63Uy1h3Bikaa40vO2xsRb8NcowLW8X8am38h_0pfhubcvldl00ueBmjvGJ_Rac7_nfNalw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199210,\"created\":1594663214,\"updated\":1594663214,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "keyiduploaddownload0keyvaultkeytestuploaddownload45979073192", "jtcuploaddownload1keyvaultkeytestuploaddownload459787768474", "javablobuploaddownload2keyvaultkeytestuploaddownload459877433", "24fe4abf-51c0-4a60-8c5c-a517487e0cac" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json new file mode 100644 index 000000000000..592c97926f96 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json @@ -0,0 +1,84 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0f8796a7-952e-476e-9cb9-9fe2819f5660" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8244D522D523D", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:18 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "614d3769-a01e-009e-7836-56825c000000", + "Date" : "Thu, 09 Jul 2020 21:16:17 GMT", + "x-ms-client-request-id" : "0f8796a7-952e-476e-9cb9-9fe2819f5660" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f/javablobencryptionnotanoop10042171a4ef7978584e0", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2d1665da-30dd-4205-94cb-db14143c845f", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "cTNLCcS4yTQ=", + "x-ms-version-id" : "2020-07-09T21:16:18.7228980Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:18 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Thu, 09 Jul 2020 21:16:18 GMT", + "Content-MD5" : "9Dw+NKoPq8zZu90oy6UXbg==", + "ETag" : "0x8D8244D5272241F", + "Content-Length" : "0", + "x-ms-request-id" : "7e2af355-201e-0074-6f36-56a572000000", + "x-ms-client-request-id" : "2d1665da-30dd-4205-94cb-db14143c845f" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f/javablobencryptionnotanoop10042171a4ef7978584e0", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "c7927604-38e6-40ca-b3b2-87cd85f5c021" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-09T21:16:18.7228980Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:18 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 09 Jul 2020 21:16:19 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "9Dw+NKoPq8zZu90oy6UXbg==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"local\",\"EncryptedKey\":\"z4Aw5jYIa7HF5P3Cunl7FCT+DltAzIKR93Ss6PxbBYps/KKNYuvdNQ==\",\"Algorithm\":\"A256KW\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"f9e2HPtNEE5V9Uno5oGLVw==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D8244D5272241F", + "x-ms-creation-time" : "Thu, 09 Jul 2020 21:16:18 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "c68e75e4-101e-009b-1836-565087000000", + "Body" : "[101, 113, -9, -114, -103, -101, -51, 94, -25, 65, -39, -1, -20, -29, 41, 46, 35, 9, 91, -71, -96, 36, 91, 78, -69, -93, -13, 126, 89, -14, -63, -27, -67, -22, 102, 125, 35, -16, 27, 34, -26, -81, 95, 91, -40, -100, 84, -83, -55, 84, 36, 49, -128, 61, 47, -113, -67, -47, 0, 68, 0, 79, -49, -36, -10, -107, 1, -80, -65, -95, -4, -91, 74, 90, 5, 98, 21, 7, 31, -41, -53, 112, -62, 62, -58, 114, 117, 44, -103, -38, -118, 39, -97, -58, 80, 115, -80, 84, 109, 105, -41, 37, 10, 33, 107, -73, 110, -14, -26, -50, -4, -79, 65, -24, -61, 59, -73, -90, -100, -42, 127, 75, 87, 106, -106, 73, -94, -85, 68, 0, -14, 27, -73, 123, 42, 81, 63, 25, -124, 100, 121, -8, 29, -16, 77, 29, -59, -52, -47, -104, -48, 121, -81, 70, 14, -103, 32, 91, 15, -60, 110, -52, 125, -12, 76, -10, -88, 69, -88, 60, 103, 65, 15, -51, -17, 11, -87, 63, 12, 121, -9, -65, -72, -110, 17, 36, -36, -17, 122, 75, 8, -91, 29, -121, -38, 7, 51, -79, -107, -61, -110, 49, -114, 88, 126, 29, -36, 70, 64, -121, -90, -48, -106, -125, 40, -108, 122, -84, 7, -31, -46, 85, -61, 1, 76, 90, 106, -21, 65, -128, 9, -13, 6, -43, -49, 4, -79, 104, 75, -9, 33, 5, 13, 109, 124, 76, 63, 104, -31, 54, 90, 46, -18, 1, 38, 81, -3, -111, -3, -30, 2, 8, 53, -83, -33, -14, -53, -78, -111, -69, -31, -53, -18, -25, -99, 88, -45, 32, -42, -118, 43, -66, 111, 126, 89, 107, -83, 66, 36, -50, 36, 113, -76, -14, -119, 81, -26, -67, 88, -7, -44, 37, -88, 66, 59, -118, -92, 63, -98, -81, 95, -55, -51, -33, -64, -3, -6, 117, 109, -120, 62, -86, 9, 30, -26, -31, 11, -46, 66, -86, -15, -116, -74, -107, 120, -20, -80, -93, 83, -59, -126, 92, -128, -101, -68, 124, -60, -118, -112, -120, -15, 92, -4, -72, -86, -37, -110, -108, -14, -76, -30, -12, -95, 53, 119, 39, 7, -24, 25, -22, 101, 88, -50, -95, 19, 91, -4, 95, 61, 98, -41, 123, 49, -39, 120, 112, -51, 39, 123, -61, 7, -103, 118, 85, -73, -102, 84, -75, 16, -25, 32, 3, -119, -19, 0, 114, -31, -6, -104, 39, 33, -83, 106, 97, -70, -124, -73, -88, 35, 98, 51, 35, -120, 120, 123, -84, -128, -31, -12, -107, 66, 52, -70, -17, 11, -94, 6, 26, 94, -1, 48, -44, -64, -51, -91, -104, -58, -9, -92, -31, -83, -1, 4, 101, -77, -90, 52, -85, -59, 78, -77, 53, -63, -26, -36, 55, 30, -4, 124, 127, -25, -98, 17, 58, 56, 58, -23, 38, -112, 109, 113, 81, 85, -31, 31, 33, 100, 5, 80, 49, 18, -116, 60, 54, 79, 121, -125, 35, 116, 113, 68, -62, -1, 14, -27, 51, -79, 89, -8, 3, 1, -69, -47, -87, 64, 114, -63, -120, -34, -116, 109, 38, 108, 5, 119, 28, -1, -106, 91, 85, 18, -120, -102, -20, -91, 36, 126, 38, 26, -128, 116, 108, 72, -87, -127, -96, -72, -63, 20, 18, 45, -54, 10, 122, -65, -15, 75, 103, 46, -55, 102, -42, 4, -48, 55, -94, -34, 43, -7, 91, 30, -26, 76, -5, -127, -60, -8, 88, 4, -110, -67, -56, -63, 126, -98, -88, 114, 112, 22, 92, -95, 112, -32, -98, 66, -98, 19, -69, -82, 108, -62, 46, -59, 108, 121, 110, -21, -42, -31, 48, -118, -51, -60, -18, -101, -53, -81, -81, -111, -120, -109, -115, -113, -81, 127, 34, -6, -30, 42, -45, -17, -121, -67, 118, 31, -91, 39, -7, -55, 111, 58, 90, 23, -71, 116, -95, -28, 100, -36, 30, 56, 77, -71, -35, -91, 76, -58, 59, -35, 46, -106, 57, 112, 19, 77, -33, 116, 90, 102, -94, 96, -16, -53, -110, 105, -122, 42, 37, 21, -5, 62, 91, 79, -22, 24, -117, 66, 55, 53, -49, -114, 86, -16, 52, -103, 104, 101, -7, 17, 3, 32, 95, 79, -44, 79, -17, 65, -46, -108, 3, 48, -16, 64, -10, -85, -101, -45, 75, -15, 97, 116, -96, -18, -94, 96, -97, 104, -21, -97, -53, 78, -73, 55, 105, -75, -87, -72, 51, 57, 109, 123, -19, 122, -87, 11, -100, 69, 19, 122, 31, 24, -40, 83, -21, 71, -89, 108, 103, 88, -56, -75, 125, -70, 93, -16, -45, 26, -96, 24, -10, -119, 107, -72, 114, 77, -53, 56, -115, -57, -64, 27, 4, 86, 126, -98, 1, -47, 108, -116, 66, -11, 10, 54, -35, -23, 126, 36, -53, 60, -41, -76, 28, -91, -62, -102, -67, -11, -120, -119, 111, -93, -42, 90, 116, -23, -69, 54, 91, 86, 63, -40, 73, 125, -40, 58, 62, 109, 86, -2, -5, -67, -2, 36, -74, 69, 106, 53, -12, -17, 96, 31, -72, -67, -7, 112, -122, -4, -43, 51, 9, 55, 112, 28, -94, 64, -72, 69, 12, 48, -31, -10, 122, -73, 31, -13, 4, -44, 30, 67, -85, -84, 126, 45, 3, -14, 101, 63, 63, -14, 69, 49, -103, -57, -101, -31, 28, 40, -18, -89, -94, -29, 71, 77, 22, -46, -127, 67, 26, -13, -46, 88, -54, -82, 32, 115, 54, -50, 104, -86, -8, -50, 91, 58, -32, -103, -98, -17, 95, -69, 112, 114, 84, -16, -103, 64, -45, -106, 120, -29, -11, 43, -94, -127, 57, 56, -17, -121, 22, -77, 61, 8, -83, -51, -5, 102, 71, 101, -108, -116, -97, 121, -119, 6, -74, -47, 109, 4, 22, 28, -3, 38, 29, -60, -37, -27, 66, 85, -125, 12, -84, -83, -63, 53, -128, 27, -32, 53, 52, -102, 91, -26, 37, -60, 79, 124, 23, -128, -106, -8, -92, -114, 123, -30, 119, -86, -94, -29, -57, 63, -107, 45, -78, -38, -31, -116, -109, -112, 36, 85, 87, -93, 67, 17, 74, 76, 89, -43, -82, 54, 90, 119, -103, 51, 73, -80, -87, 59, 55, 53, 20, 78, 3, -28, -110, -99, 58, -118, 85, -105, 7]", + "x-ms-client-request-id" : "c7927604-38e6-40ca-b3b2-87cd85f5c021", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + } ], + "variables" : [ "81bc8ced-c924-47ab-80ca-89f64da1cd82", "jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f", "javablobencryptionnotanoop10042171a4ef7978584e0", "a6d7f882-6d70-498f-a8ae-725082f6d033" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json new file mode 100644 index 000000000000..8e9f98127547 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json @@ -0,0 +1,84 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload0localkeytestuploaddownloada06506847931b?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0f204b9a-1a10-42ce-a3ec-da9c6a99d7d0" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8244D5111E535", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f350c15b-201e-0039-3536-566a9e000000", + "Date" : "Thu, 09 Jul 2020 21:16:16 GMT", + "x-ms-client-request-id" : "0f204b9a-1a10-42ce-a3ec-da9c6a99d7d0" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload0localkeytestuploaddownloada06506847931b/javablobuploaddownload1localkeytestuploaddownloada0619788733", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d152e5fd-97f3-4d2f-abed-d530922aa965", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "vyhIPpTd9Cg=", + "x-ms-version-id" : "2020-07-09T21:16:17.2828707Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:17 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Thu, 09 Jul 2020 21:16:16 GMT", + "Content-MD5" : "u7nVX1ppqTXUHg5LT0EjQg==", + "ETag" : "0x8D8244D51969023", + "Content-Length" : "0", + "x-ms-request-id" : "30425ed1-f01e-002a-1736-564e92000000", + "x-ms-client-request-id" : "d152e5fd-97f3-4d2f-abed-d530922aa965" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload0localkeytestuploaddownloada06506847931b/javablobuploaddownload1localkeytestuploaddownloada0619788733", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e3852821-f908-4508-9104-66993c5dced3" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-09T21:16:17.2828707Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:17 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 09 Jul 2020 21:16:16 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "u7nVX1ppqTXUHg5LT0EjQg==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"local\",\"EncryptedKey\":\"NpbUzDfNi9AYnWd/pgNTtGCBV6lovvJAleXpd/pc0wBer7RtGQeNRA==\",\"Algorithm\":\"A256KW\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"UzOe1NjUynTxeHzIYgxG5w==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D8244D51969023", + "x-ms-creation-time" : "Thu, 09 Jul 2020 21:16:17 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "b68f125b-b01e-0014-3a36-56d9ed000000", + "Body" : "[98, 41, 27, 84, -33, 22, 8, -100, -106, -119, -52, 110, 4, 29, 27, 15, 65, -28, -65, -112, -111, -46, -22, 105, -73, -6, 15, -52, -49, 121, -23, -43, -36, -94, -65, -1, -101, 83, 37, -109, 50, 119, -28, 84, -64, -30, 122, 9, -30, -8, 22, -30, 125, 0, 113, 73, -107, 77, -117, 77, -124, -67, -41, 71, 68, 74, 23, 49, -73, -57, -71, -118, -21, -60, -37, -95, 74, -14, 84, 24, 21, 24, -74, 1, -113, -22, 73, 8, 107, 92, 125, 15, -1, -47, -75, 36, -18, 94, 95, -19, -47, -2, 42, -32, -52, 108, 52, -68, 48, -25, 17, -71, -35, 7, 91, -32, 45, 73, 20, -71, -52, -24, -77, 47, -110, 54, 21, -22, 30, -11, -48, -65, -37, -58, 18, -103, -65, 95, 37, -85, 86, -117, -33, 109, -28, -6, 111, -65, -31, -107, -64, 85, -27, 36, -109, -20, -60, 39, 124, 49, 83, 84, 60, 114, 33, -64, -83, 126, 26, -75, -76, -82, 97, -15, 97, -32, -73, -2, -26, -83, -90, 79, -38, 62, 7, 70, -80, -63, 10, -52, 13, 63, 44, -76, 27, 12, 69, 96, -40, -57, 94, -87, -107, 125, -23, -73, -109, 102, -58, -17, -110, -12, 34, 43, -12, -76, -70, 30, -1, -107, 39, -106, -81, -31, 9, 12, -9, -87, -111, -103, 120, 61, -70, 54, -91, -7, 81, -101, -114, 42, -117, 110, -44, 27, -44, -89, 21, -49, -35, 10, 55, 28, -39, 83, 29, -15, 63, 51, 10, -84, 55, 24, 104, -41, -36, 46, -13, -83, -38, 35, -60, -81, 51, -8, -20, 48, -108, 45, -9, -4, -110, -1, 16, 11, -34, -89, -115, 68, -109, -23, 69, 94, 104, 8, 95, -23, -66, 123, 115, 47, 86, -26, 80, -3, 119, -63, -94, 115, -25, 26, 23, 98, 125, -14, -110, -4, -100, 69, 111, 8, -59, -8, -114, -128, 79, -65, -35, -7, 115, -81, -3, -55, 81, 108, -64, -107, -107, 122, -110, -112, -48, 75, 39, 11, 124, 29, -15, 85, 76, -82, -115, -66, -71, -51, 35, 58, 13, 72, 90, -70, -4, 53, 15, -43, 66, -30, -16, 61, -23, 74, -21, -102, 95, -76, 123, 98, 56, -7, 89, -30, -14, -4, -114, -120, -128, 74, 108, 3, 35, -7, -56, 82, -122, -93, 22, 23, -43, -122, -84, 8, -44, 122, 15, 39, -70, 14, -42, 102, 100, 127, 122, -13, -97, -18, 125, 28, 74, -54, 30, 40, -21, -38, 108, 26, -110, -120, -32, -94, 23, 5, -76, 122, 38, -123, -25, -63, 117, 63, -73, -120, -84, 89, -88, -7, -69, -16, -43, -40, -19, -28, 51, 101, 122, -40, -7, 64, 47, 98, -77, -87, 123, 103, 78, 105, -14, -96, -46, -68, -9, -41, -30, 100, 64, 10, 44, -50, -114, 107, -57, 94, 24, 117, -4, 65, 122, 74, -34, -87, -19, 65, -55, 68, -89, 111, -107, -83, -41, 75, 103, 38, 14, 89, 89, 69, -46, -95, 81, -128, 72, 82, 30, -110, -125, -36, 80, 21, 70, 38, 60, 46, 88, -40, 9, -9, 9, -94, 42, 14, 95, 90, -126, -68, -82, -122, -98, 83, 37, -16, -36, -128, -40, -113, 87, -94, -12, 58, 44, -29, 4, -80, -30, 109, -73, 126, 3, -43, -41, -20, 19, -52, -5, -123, 94, -90, -1, 24, -117, 40, 42, -101, -107, 35, 5, -27, -84, 29, -124, -9, 45, -14, -100, -66, -23, -93, -108, 41, 30, 44, 112, 115, -54, -117, -121, 18, -51, -121, -70, -57, 67, 52, 43, -121, -115, 12, -35, 10, -15, 69, 70, 37, -39, -36, 73, 61, -5, 61, 92, -84, -96, 19, 21, 28, 93, 35, -71, -27, 27, -84, 124, -121, 86, -100, 45, -58, -111, -18, -1, -70, -125, -112, -53, 30, 91, -109, 64, 69, -26, 41, -30, 66, -72, -43, 99, 69, -103, 49, -27, 107, 37, -17, 98, -75, 8, -73, 127, 55, -1, -115, 71, -89, 66, 90, 112, 22, 74, 63, -107, 65, 87, -10, 58, -82, -86, 124, 0, -48, 4, 3, -113, 7, -26, 49, 32, -112, 122, -92, -78, -29, -94, -123, 1, 85, 54, 29, -119, -34, 53, 79, -93, -107, -121, -123, 72, 72, -61, -92, -95, 100, 113, -27, -90, 35, 14, 16, -9, -111, -44, -112, -12, -97, -15, -64, 58, 80, -109, 27, -128, -24, -22, 28, -20, 7, -70, 3, 30, -77, -61, 67, -126, -71, -61, 9, 115, -31, 11, 4, -14, -120, -112, 87, -13, -85, -52, 33, -75, 91, -75, 64, -71, 57, 61, -53, 88, 87, -35, -22, -117, -71, -9, 66, 64, 102, 68, -26, 51, -120, 104, 94, 106, 29, 127, -37, 25, 14, -64, -99, 26, -118, 6, -56, -79, -16, 98, -93, -106, 93, -39, 26, 29, -80, 67, -60, 76, 41, -63, 69, -2, 125, 117, 35, -106, 84, 39, -55, 108, 103, -38, 66, -121, -18, 58, 106, 42, -23, -12, 37, -68, 8, 20, 100, -113, 21, 12, 35, -41, -80, 8, 67, -101, -31, 125, -125, -17, 122, -6, 57, -68, 40, 13, 88, 47, -82, -44, -119, -98, 20, 17, 15, -82, 60, 32, 40, -91, -75, -50, -35, -35, -127, -74, 119, -36, 59, 62, 62, -42, 22, -14, -7, 8, 106, -15, 42, 118, 116, 125, 109, -58, 99, 96, 111, -94, -99, 0, -58, 13, 114, -7, 49, -126, 93, -108, 116, 30, -42, 37, 78, 126, 98, 120, -28, -53, 73, -21, -29, -97, 62, 39, 62, -57, 43, -71, 28, 27, 99, 10, 64, 121, 122, -9, 3, 119, 97, -75, 2, 126, -24, -62, 90, 68, 89, 77, -37, 47, 31, 80, 36, -126, 5, -64, -10, -9, -5, 6, -120, -18, -72, 119, -114, -13, 57, 82, 103, 29, -43, -25, -41, 110, -48, -83, -15, -32, 18, -8, 7, 37, 16, -74, 75, -120, -119, 28, -53, -72, -8, -118, -98, 112, 5, 117, -6, -88, -28, -117, 41, 123, -15, -21, 71, -71, -40, -11, 86, -30, 41, -38, 13, -6, -59, 63, -24, -80, -38, -128, -38, 58, 103, 102, -106, -107, 73, -83, -127, 40, -43, 36, -32, 23, -22, -65, -32]", + "x-ms-client-request-id" : "e3852821-f908-4508-9104-66993c5dced3", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + } ], + "variables" : [ "70e98d95-cf02-4a49-b2c2-5fbeaa4d5a8d", "jtcuploaddownload0localkeytestuploaddownloada06506847931b", "javablobuploaddownload1localkeytestuploaddownloada0619788733", "8531ac28-5e2a-4896-8eeb-906b2fae24bb" ] +} \ No newline at end of file diff --git a/sdk/storage/test-resources.json b/sdk/storage/test-resources.json index d60bc654fa19..3c07180ccf24 100644 --- a/sdk/storage/test-resources.json +++ b/sdk/storage/test-resources.json @@ -9,6 +9,13 @@ "type": "string", "defaultValue": "core.windows.net" }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, "testApplicationOid": { "type": "string", "metadata": { @@ -18,6 +25,7 @@ }, "variables": { "storageApiVersion": "2019-06-01", + "keyVaultApiVersion": "2016-10-01", "authorizationApiVersion": "2018-09-01-preview", "blobDataContributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", "contributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]", @@ -26,6 +34,8 @@ "premiumAccountName": "[concat('prem', parameters('baseName'))]", "dataLakeAccountName": "[concat('dtlk', parameters('baseName'))]", "premiumFileAccountName": "[concat('premf', parameters('baseName'))]", + "keyvaultName": "[concat(parameters('baseName'), 'kvlt')]", + "azureKeyVaultUrl": "[format('https://{0}.vault.azure.net', variables('keyvaultName'))]", "location": "[resourceGroup().location]" }, "resources": [ @@ -239,6 +249,77 @@ "keySource": "Microsoft.Storage" } } + }, + { + "type": "Microsoft.KeyVault/vaults", + "apiVersion": "[variables('keyvaultApiVersion')]", + "name": "[variables('keyvaultName')]", + "location": "[variables('location')]", + "properties": { + "sku": { + "family": "A", + "name": "premium" + }, + "tenantId": "[parameters('tenantId')]", + "accessPolicies": [ + { + "tenantId": "[parameters('tenantId')]", + "objectId": "[parameters('testApplicationOid')]", + "permissions": { + "keys": [ + "get", + "list", + "update", + "create", + "import", + "delete", + "recover", + "backup", + "restore", + "decrypt", + "encrypt", + "unwrapKey", + "wrapKey", + "verify", + "sign", + "purge" + ], + "secrets": [ + "get", + "list", + "set", + "delete", + "recover", + "backup", + "restore", + "purge" + ], + "certificates": [ + "get", + "list", + "update", + "create", + "import", + "delete", + "recover", + "backup", + "restore", + "managecontacts", + "manageissuers", + "getissuers", + "listissuers", + "setissuers", + "deleteissuers", + "purge" + ] + } + } + ], + "enabledForDeployment": false, + "enabledForDiskEncryption": false, + "enabledForTemplateDeployment": false, + "enableSoftDelete": false + } } ], "outputs": { @@ -326,7 +407,10 @@ "AZURE_STORAGE_QUEUE_CONNECTION_STRING": { "type": "string", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('primaryAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('storageApiVersion')).keys[0].value, ';EndpointSuffix=', parameters('endpointSuffix'))]" + }, + "KEYVAULT_URL":{ + "type": "string", + "value": "[variables('azureKeyVaultUrl')]" } - } }