diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index 08395509fd39..bbb5c3b0eeec 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -51,13 +51,6 @@ known_presence_issues: - ['sdk/cognitiveservices/ms-azure-cs-visualsearch', '#2847'] - ['sdk/cognitiveservices/ms-azure-cs-websearch', '#2847'] - ['sdk/eventhubs/microsoft-azure-eventhubs-extensions', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault-core', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault-cryptography', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault-extensions', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault-webkey', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault-test', '#2847'] - - ['sdk/keyvault/microsoft-azure-keyvault-complete', '#2847'] - ['sdk/mediaservices/microsoft-azure-media', '#2847'] - ['sdk/servicebus/microsoft-azure-servicebus', '#2847'] # Changelog List diff --git a/eng/CredScanSuppression.json b/eng/CredScanSuppression.json index 8cc0bae48db0..503d55cc9a9e 100644 --- a/eng/CredScanSuppression.json +++ b/eng/CredScanSuppression.json @@ -50,14 +50,7 @@ "sdk/identity/azure-identity/src/test/resources/cert-chain.pem", "sdk/identity/azure-identity/src/test/resources/key.pem", "sdk/identity/azure-identity/src/test/resources/keyStore.pfx", - "sdk/keyvault/azure-security-keyvault-certificates/src/test/resources/pemCert.pem", - "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/pkcs12_base64_testdata.cer", - "sdk/keyvault/microsoft-azure-keyvault-cryptography/src/test/resources/p256key.pem", - "sdk/keyvault/microsoft-azure-keyvault-cryptography/src/test/resources/p256keynew.pem", - "sdk/keyvault/microsoft-azure-keyvault-cryptography/src/test/resources/p384keynew.pem", - "sdk/keyvault/microsoft-azure-keyvault-cryptography/src/test/resources/p521keynew.pem", - "sdk/keyvault/microsoft-azure-keyvault-cryptography/src/test/resources/SECP256key.pem", - "sdk/keyvault/microsoft-azure-keyvault-cryptography/src/test/resources/secp256keynew.pem" + "sdk/keyvault/azure-security-keyvault-certificates/src/test/resources/pemCert.pem" ], "_justification": "File contains private key used by test code." }, @@ -71,8 +64,6 @@ "file": [ "sdk/communication/azure-communication-common-perf/src/main/java/com.azure.communication.common.perf/FakeCredentialInTest.java", "sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialInTest.java", - "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/session-records/createCertificatePemForCertificateOperationsTest.json", - "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/session-records/createSelfSignedCertificatePemForCertificateOperationsTest.json", "sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/session-records/AzureResourceManagerTests.testContainerRegistry.json", "sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/FakeCredentialInTest.java", "sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/FakeCredentialInTest.java", diff --git a/eng/java.gdnbaselines b/eng/java.gdnbaselines deleted file mode 100644 index d5f2f5c90dab..000000000000 --- a/eng/java.gdnbaselines +++ /dev/null @@ -1,44 +0,0 @@ -{ - "version": "latest", - "baselines": { - "baseline": { - "name": "baseline", - "createdDate": "2022-11-01 17:35:53Z", - "lastUpdatedDate": "2022-11-01 17:35:53Z" - } - }, - "results": { - "c08c04ea0fe6389eae3666e45228de613ac583913f3a7ba9b138c69a200ed2a3": { - "signature": "c08c04ea0fe6389eae3666e45228de613ac583913f3a7ba9b138c69a200ed2a3", - "alternativeSignatures": [ - "ed824173fee09dc515622edd61640d577c3e9bedc7b023e667ca1d8997c1c9a0" - ], - "target": "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/session-records/createCertificatePemForCertificateOperationsTest.json", - "memberOf": [ - "baseline" - ], - "tool": "credscan", - "ruleId": "CSCAN-GENERAL0020", - "justification": null, - "createdDate": "2022-11-01 17:35:53Z", - "expirationDate": null, - "type": null - }, - "43f1b622f70df0a1b6dea2e359104ebfb6797c5743dfd3c376eb21b37ea82c1c": { - "signature": "43f1b622f70df0a1b6dea2e359104ebfb6797c5743dfd3c376eb21b37ea82c1c", - "alternativeSignatures": [ - "e65763b223141e108acb6f919751431aa6a168b628ba4d3a9a81abb58425b91e" - ], - "target": "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/session-records/createSelfSignedCertificatePemForCertificateOperationsTest.json", - "memberOf": [ - "baseline" - ], - "tool": "credscan", - "ruleId": "CSCAN-GENERAL0020", - "justification": null, - "createdDate": "2022-11-01 17:35:53Z", - "expirationDate": null, - "type": null - } - } -} \ No newline at end of file diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 32228909d0fd..a8fe028ca1af 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -34,7 +34,6 @@ com.microsoft.azure:azure-core;0.9.8 com.microsoft.azure:azure-keyvault-cryptography;1.2.2 com.microsoft.azure:qpid-proton-j-extensions;1.2.5 com.microsoft.azure.sdk.iot:iot-service-client;1.30.0 -com.microsoft.rest:client-runtime;1.7.4 com.microsoft.sqlserver:mssql-jdbc;10.2.3.jre8 com.microsoft.azure:azure-functions-maven-plugin;1.30.0 com.microsoft.azure.functions:azure-functions-java-library;2.2.0 @@ -114,10 +113,8 @@ com.github.tomakehurst:wiremock-jre8-standalone;2.35.1 com.microsoft.azure:adal4j;1.6.5 com.microsoft.azure:azure;1.24.1 com.microsoft.azure:azure-mgmt-graph-rbac;1.3.0 -com.microsoft.azure:azure-mgmt-keyvault;1.11.1 com.microsoft.azure:azure-mgmt-network;1.33.0 com.microsoft.azure:azure-mgmt-resources;1.3.0 -com.microsoft.azure:azure-mgmt-storage;1.3.0 com.microsoft.azure:azure-storage;8.0.0 com.microsoft.azure:msal4j;1.17.2 com.microsoft.azure:msal4j-brokers;1.0.0 @@ -231,9 +228,6 @@ org.revapi:revapi-maven-plugin;0.14.6 # going to be some investigation necessary to find, at the very least, a newer version # which is, hopefully, not a SNAPSHOT. # sdk\batch\microsoft-azure-batch\pom.xml -# sdk\keyvault\microsoft-azure-keyvault\pom.xml -# sdk\keyvault\microsoft-azure-keyvault-extensions\pom.xml -# sdk\keyvault\microsoft-azure-keyvault-test\pom.xml test_jar_com.microsoft.azure:azure-mgmt-resources;1.3.1-SNAPSHOT # Special test dependencies for clientcore integrations @@ -297,11 +291,6 @@ cosmos_org.apache.avro:avro;1.11.3 # This dependency is needed since Jackson Avro uses an older dependency on Apache Avro which is another library. jacksonavro_org.apache.avro:avro-maven-plugin;1.8.2 -# sdk\keyvault\microsoft-azure-keyvault-extensions\pom.xml -keyvault_org.mockito:mockito-core;1.10.19 -# sdk\keyvault\microsoft-azure-keyvault-test\pom.xml -keyvault_com.microsoft.azure:azure-storage;4.4.0 - # sdk\mediaservices\microsoft-azure-media\pom.xml which hasn't been released for 2 years # all of these unique references below are listed here because they're old, some are over 10 years old media_javax.xml.bind:jaxb-api;2.2.7 diff --git a/eng/versioning/version_data.txt b/eng/versioning/version_data.txt index 570e58cd1a39..c283e965e45c 100644 --- a/eng/versioning/version_data.txt +++ b/eng/versioning/version_data.txt @@ -25,9 +25,5 @@ com.microsoft.azure.cognitiveservices:azure-cognitiveservices-qnamaker;1.0.0-bet com.microsoft.azure:azure-eventhubs;3.3.0;3.4.0-beta.1 com.microsoft.azure:azure-eventhubs-eph;3.3.0;3.4.0-beta.1 com.microsoft.azure:azure-eventhubs-extensions;3.3.2;3.4.0-beta.1 -com.microsoft.azure:azure-keyvault-complete;1.2.4;1.2.6 -com.microsoft.azure:azure-keyvault-core;1.2.6;1.3.0-beta.1 -com.microsoft.azure:azure-keyvault-extensions;1.2.6;1.3.0-beta.1 -com.microsoft.azure:azure-keyvault-test;1.2.3;1.2.6 com.microsoft.azure:azure-servicebus;3.6.7;3.7.0-beta.1 com.microsoft.azure:azure-media;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/keyvault/LICENSE b/sdk/keyvault/LICENSE deleted file mode 100644 index 21071075c245..000000000000 --- a/sdk/keyvault/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/sdk/keyvault/REGENERATING.md b/sdk/keyvault/REGENERATING.md deleted file mode 100644 index a0a116503c61..000000000000 --- a/sdk/keyvault/REGENERATING.md +++ /dev/null @@ -1,19 +0,0 @@ -# Regenerating SDK - -The code in the azure-keyvault package is generated via AutoREST. After code generation, there are currently several manual modifications that need to be made for the build to succeed. In the root of the azure-keyvault-java repo, there is a Python script called "regenerate_and_fix_sdk.py" which will automatically regenerate the code and apply the necessary fixes. To regenerate the code using this script: - -- Install AutoREST: https://github.com/Azure/autorest/blob/master/docs/install/readme.md -- Open the script in your favorite editor and change "swagger_source_branch" to contain the branch of the Azure REST spec API repo that you'd like the API spec to be sourced from – likely either "master" or "keyvault_preview" - - If there is a tag you'd like to pass to AutoREST – set the "autorest_tag" branch accordingly. -- Using Python 3.6+, run the script from the root of the checked out repository. Verify that no errors appear, and then build/test the SDK. - - - -The changes made by the script post-regeneration are as follows: - -* The generated webkey models will be removed - - -* Any generated model class which has a corresponding custom class in the "models/custom" folder will be changed to inherit from the custom class. -* Any class which utilizes webkey models will have the correct imports from the azure-keyvault-webkey package added -* AutoREST occasionally generates broken parameter declarations in the Javadoc comments - these are repaired. diff --git a/sdk/keyvault/ci.data.yml b/sdk/keyvault/ci.data.yml deleted file mode 100644 index 1dcf1feddf5d..000000000000 --- a/sdk/keyvault/ci.data.yml +++ /dev/null @@ -1,76 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/keyvault/ci.data.yml - - sdk/keyvault/microsoft-azure-keyvault/ - - sdk/keyvault/microsoft-azure-keyvault-complete/ - - sdk/keyvault/microsoft-azure-keyvault-core/ - - sdk/keyvault/microsoft-azure-keyvault-cryptography/ - - sdk/keyvault/microsoft-azure-keyvault-extensions/ - - sdk/keyvault/microsoft-azure-keyvault-test/ - - sdk/keyvault/microsoft-azure-keyvault-webkey/ - exclude: - - sdk/keyvault/pom.xml - - sdk/keyvault/microsoft-azure-keyvault/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-complete/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-core/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-cryptography/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-extensions/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-test/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-webkey/pom.xml - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/keyvault/ci.data.yml - - sdk/keyvault/microsoft-azure-keyvault/ - - sdk/keyvault/microsoft-azure-keyvault-complete/ - - sdk/keyvault/microsoft-azure-keyvault-core/ - - sdk/keyvault/microsoft-azure-keyvault-cryptography/ - - sdk/keyvault/microsoft-azure-keyvault-extensions/ - - sdk/keyvault/microsoft-azure-keyvault-test/ - - sdk/keyvault/microsoft-azure-keyvault-webkey/ - exclude: - - sdk/keyvault/pom.xml - - sdk/keyvault/microsoft-azure-keyvault/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-complete/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-core/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-cryptography/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-extensions/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-test/pom.xml - - sdk/keyvault/microsoft-azure-keyvault-webkey/pom.xml - -extends: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - SDKType: data - ServiceDirectory: keyvault - Artifacts: - - name: azure-keyvault - groupId: com.microsoft.azure - safeName: azurekeyvault - - name: azure-keyvault-core - groupId: com.microsoft.azure - safeName: azurekeyvaultcore - - name: azure-keyvault-cryptography - groupId: com.microsoft.azure - safeName: azurekeyvaultcryptography - - name: azure-keyvault-extensions - groupId: com.microsoft.azure - safeName: azurekeyvaultextensions - - name: azure-keyvault-webkey - groupId: com.microsoft.azure - safeName: azurekeyvaultwebkey diff --git a/sdk/keyvault/history.md b/sdk/keyvault/history.md deleted file mode 100644 index 451e453641a6..000000000000 --- a/sdk/keyvault/history.md +++ /dev/null @@ -1,17 +0,0 @@ -# Release History - -## 1.1 -* Moving azure-keyvault to stable API version 7.0 -* Renaming curve SECP256K1 and algorithm ECDSA256 to P-256K and ES256K respectively - -### 1.1-beta-1 -* Added elliptic curve key support -* Added message encryption support for message encryption enabled vaults - -### 1.1-alpha-1 -* Adding managed storage account key backup, restore and soft-delete support -* Added certificate backup and restore support -* Added managed storage account SasDefintion creation - -## 1.0.0 -* Initial release diff --git a/sdk/keyvault/microsoft-azure-keyvault-complete/pom.xml b/sdk/keyvault/microsoft-azure-keyvault-complete/pom.xml deleted file mode 100644 index eb1e9a54c9f8..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-complete/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - 4.0.0 - - - com.azure - azure-data-sdk-parent - 1.3.0 - ../../parents/azure-data-sdk-parent - - - com.microsoft.azure - azure-keyvault-complete - 1.2.6 - pom - - Microsoft Azure Key Vault SDK Complete - - This library has been replaced by new Azure SDKs, you can read about them at https://aka.ms/azsdkvalueprop. The latest libraries to interact with the Azure Key Vault service are: - (1) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-keys. - (2) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-secrets. - (3) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-certificates. - It is recommended that you move to the new package. - - https://github.com/Azure/azure-sdk-for-java - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - https://github.com/Azure/azure-sdk-for-java - - - - UTF-8 - - - - - - - com.microsoft.azure - azure-keyvault-core - 1.3.0-beta.1 - - - com.microsoft.azure - azure-keyvault-extensions - 1.3.0-beta.1 - - - - diff --git a/sdk/keyvault/microsoft-azure-keyvault-core/pom.xml b/sdk/keyvault/microsoft-azure-keyvault-core/pom.xml deleted file mode 100644 index 86d56415357a..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-core/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - 4.0.0 - - com.azure - azure-data-sdk-parent - 1.3.0 - ../../parents/azure-data-sdk-parent - - - com.microsoft.azure - azure-keyvault-core - 1.3.0-beta.1 - jar - - Microsoft Azure SDK for Key Vault Core - - This library has been replaced by new Azure SDKs, you can read about them at https://aka.ms/azsdkvalueprop. The latest libraries to interact with the Azure Key Vault service are: - (1) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-keys. - (2) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-secrets. - (3) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-certificates. - It is recommended that you move to the new package. - - https://github.com/Azure/azure-sdk-for-java - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - https://github.com/Azure/azure-sdk-for-java - - - UTF-8 - - - - - - - org.apache.commons - commons-lang3 - 3.12.0 - - - com.google.guava - guava - 33.1.0-jre - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.6.0 - - - - - diff --git a/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKey.java b/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKey.java deleted file mode 100644 index 8141909b99f1..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKey.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.core; - -import java.io.Closeable; -import java.security.NoSuchAlgorithmException; - -import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.lang3.tuple.Triple; - -import com.google.common.util.concurrent.ListenableFuture; - - -/** - * Interface for representing cryptographic keys with the Microsoft Azure Key - * Vault libraries. - */ -public interface IKey extends Closeable { - - /** - * The default encryption algorithm for this key, using the representations - * from Json Web Key Algorithms, RFC7513. - * - * @return The default encryption algorithm for this key. - */ - String getDefaultEncryptionAlgorithm(); - - /** - * The default key wrap algorithm for this key, using the representations - * from Json Web Key Algorithms, RFC7513. - * - * @return The default key wrap algorithm for this key. - */ - String getDefaultKeyWrapAlgorithm(); - - /** - * The default signature algorithm for this key, using the representations - * from Json Web Key Algorithms, RFC7513. - * - * @return The default signature algorithm for this key. - */ - String getDefaultSignatureAlgorithm(); - - /** - * The unique key identifier for this key. - * - * @return The key identifier - */ - String getKid(); - - /** - * Decrypts the specified cipher text. Note that not all algorithms require, - * or support, all parameters. - * - * @param ciphertext - * The cipher text to decrypt - * @param iv - * The initialization vector (optional with some algorithms) - * @param authenticationData - * Additional authentication data (optional with some algorithms) - * @param authenticationTag - * The authentication tag from the encrypt operation (optional - * with some algorithms) - * @param algorithm - * The encryption algorithm to use, must be supplied - * @return A ListenableFuture containing the plain text - * @throws NoSuchAlgorithmException the algorithm is not valid - */ - ListenableFuture decryptAsync(final byte[] ciphertext, final byte[] iv, final byte[] authenticationData, final byte[] authenticationTag, final String algorithm) throws NoSuchAlgorithmException; - - /** - * Encrypts the specified plain text. Note that not all algorithms require, - * or support, all parameters. - * - * @param plaintext - * The plain text to encrypt - * @param iv - * The initialization vector (optional with some algorithms) - * @param authenticationData - * Additional authentication data (optional with some algorithms) - * @param algorithm - * The encryption algorithm to use, defaults to the keys - * DefaultEncryptionAlgorithm - * @return A ListenableFuture containing the cipher text, the authentication - * tag and the algorithm that was used - * @throws NoSuchAlgorithmException the algorithm is not valid - */ - ListenableFuture> encryptAsync(final byte[] plaintext, final byte[] iv, final byte[] authenticationData, final String algorithm) throws NoSuchAlgorithmException; - - /** - * Wraps (encrypts) the specified symmetric key material using the specified - * algorithm, or the keys DefaultKeyWrapAlgorithm if none is specified. - * - * @param key - * The symmetric key to wrap - * @param algorithm - * The wrapping algorithm to use, defaults to the keys - * DefaultKeyWrapAlgorithm - * @return ListenableFuture containing the encrypted key and the algorithm - * that was used - * @throws NoSuchAlgorithmException the algorithm is not valid - */ - ListenableFuture> wrapKeyAsync(final byte[] key, final String algorithm) throws NoSuchAlgorithmException; - - /** - * Unwraps (decrypts) the specified encryped key material. - * - * @param encryptedKey - * The encrypted key to decrypt - * @param algorithm - * The algorithm to use, must be supplied - * @return A ListenableFuture containing the unwrapped key - * @throws NoSuchAlgorithmException the algorithm is not valid - */ - ListenableFuture unwrapKeyAsync(final byte[] encryptedKey, final String algorithm) throws NoSuchAlgorithmException; - - /** - * Signs the specified digest using the specified algorithm, or the keys - * DefaultSignatureAlgorithm if no algorithm is specified. - * - * @param digest - * The digest to sign - * @param algorithm - * The signature algorithm to use - * @return A ListenableFuture containing the signature and the algorithm used. - * @throws NoSuchAlgorithmException the algorithm is not valid - */ - ListenableFuture> signAsync(final byte[] digest, final String algorithm) throws NoSuchAlgorithmException; - - /** - * Verifies the supplied signature value using the supplied digest and - * algorithm. - * - * @param digest - * The digest input - * @param signature - * The signature to verify - * @param algorithm - * The algorithm to use, must be provided - * @return A ListenableFuture containing the signature and the algorithm used. - * @throws NoSuchAlgorithmException the algorithm is not valid - */ - ListenableFuture verifyAsync(final byte[] digest, final byte[] signature, final String algorithm) throws NoSuchAlgorithmException; -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKeyResolver.java b/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKeyResolver.java deleted file mode 100644 index d0fa3d0310ab..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKeyResolver.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.core; - -import com.google.common.util.concurrent.ListenableFuture; - -/** - * Interface for representing key resolving operations with the Microsoft Azure Key - * Vault libraries. - */ -public interface IKeyResolver { - - /** - * Retrieves an IKey implementation for the specified key identifier. - * Implementations should check the format of the kid to ensure that it is - * recognized. Null, rather than an exception, should be returned for - * unrecognized key identifiers to enable chaining of key resolvers. - * - * @param kid - * The key identifier to resolve. - * @return A ListenableFuture containing the resolved IKey - */ - ListenableFuture resolveKeyAsync(String kid); -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/package-info.java b/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/package-info.java deleted file mode 100644 index e69854baa071..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * This package contains the interface for IKey and IKeyResolver. - */ -package com.microsoft.azure.keyvault.core; diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/pom.xml b/sdk/keyvault/microsoft-azure-keyvault-extensions/pom.xml deleted file mode 100644 index babca19792be..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/pom.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - 4.0.0 - - com.azure - azure-data-sdk-parent - 1.3.0 - ../../parents/azure-data-sdk-parent - - - com.microsoft.azure - azure-keyvault-extensions - 1.3.0-beta.1 - jar - - Microsoft Azure SDK for Key Vault Extensions - - This library has been replaced by new Azure SDKs, you can read about them at https://aka.ms/azsdkvalueprop. The latest libraries to interact with the Azure Key Vault service are: - (1) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-keys. - (2) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-secrets. - (3) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-certificates. - It is recommended that you move to the new package. - - https://github.com/Azure/azure-sdk-for-java - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - https://github.com/Azure/azure-sdk-for-java - - - UTF-8 - - - - - - - - com.microsoft.azure - azure-keyvault-core - 1.3.0-beta.1 - - - - - com.microsoft.azure - azure-mgmt-resources - 1.3.0 - - - - - com.microsoft.rest - client-runtime - 1.7.4 - - - - - com.google.guava - guava - 33.1.0-jre - - - org.apache.commons - commons-lang3 - 3.12.0 - - - commons-codec - commons-codec - 1.15 - - - - - - - com.microsoft.azure - azure-mgmt-resources - 1.3.1-SNAPSHOT - test-jar - test - - - com.microsoft.azure - adal4j - 1.6.5 - test - - - - - junit - junit - 4.13.2 - test - - - org.bouncycastle - bcprov-jdk15to18 - 1.78.1 - test - - - org.mockito - mockito-core - 1.10.19 - test - - - - - - - org.eclipse.jetty - jetty-maven-plugin - 9.4.33.v20201020 - - 0 - 11079 - stop-azure-keyvault-extensions - 20 - false - ../../../jetty.xml - jar - - - - start-jetty - process-test-classes - - run-forked - - - - stop-jetty - post-integration-test - - stop - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.6.0 - - - - - diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/AggregateKeyResolver.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/AggregateKeyResolver.java deleted file mode 100644 index 849ff9b008cc..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/AggregateKeyResolver.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.extensions; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import com.google.common.util.concurrent.AbstractFuture; -import com.google.common.util.concurrent.ListenableFuture; -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.core.IKeyResolver; - -/** - * The collection of key resolvers that would iterate on a key id to resolve to {@link IKey}. - */ -public class AggregateKeyResolver implements IKeyResolver { - - /** - * Future key class that resolves a key id after the async result is available. - */ - class FutureKey extends AbstractFuture { - - private final String kid; - - private boolean isCancelled = false; - private boolean isDone = false; - private IKey result = null; - - FutureKey(String kid) { - this.kid = kid; - } - - @Override - public boolean cancel(boolean mayInterruptIfRunning) { - - // mark cancelled - isCancelled = true; - - return isCancelled; - } - - @Override - public boolean isCancelled() { - return isCancelled; - } - - @Override - public boolean isDone() { - - // always true - return isDone; - } - - @Override - public IKey get() throws InterruptedException, ExecutionException { - - // throw if cancelled - if (isCancelled) { - throw new InterruptedException(); - } - - synchronized (resolvers) { - for (IKeyResolver resolver : resolvers) { - Future futureKey = resolver.resolveKeyAsync(kid); - - result = futureKey.get(); - - if (result != null) { - break; - } - } - } - - // Mark done - isDone = true; - - return result; - } - - @Override - public IKey get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { - - // throw if cancelled - if (isCancelled) { - throw new InterruptedException(); - } - - synchronized (resolvers) { - for (IKeyResolver resolver : resolvers) { - Future futureKey = resolver.resolveKeyAsync(kid); - - result = futureKey.get(timeout, unit); - - if (result != null) { - break; - } - } - } - - // Mark done - isDone = true; - - return result; - } - } - - private final List resolvers; - - /** - * Constructor. - */ - public AggregateKeyResolver() { - - resolvers = Collections.synchronizedList(new ArrayList()); - } - - /** - * Adds a key resolver to the collection of key resolvers. - * @param resolver the key resolver - */ - public void add(IKeyResolver resolver) { - - synchronized (resolvers) { - resolvers.add(resolver); - } - } - - @Override - public ListenableFuture resolveKeyAsync(String kid) { - return new FutureKey(kid); - } - -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java deleted file mode 100644 index 4b8577028a81..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.extensions; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.MoreExecutors; -import com.microsoft.azure.keyvault.KeyIdentifier; -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.core.IKeyResolver; - -import java.util.concurrent.ExecutionException; - -/** - * The key resolver that caches the key after resolving to {@link IKey}. - */ -public class CachingKeyResolver implements IKeyResolver { - - private final IKeyResolver keyResolver; - private final LoadingCache> cache; - - /** - * Constructor. - * @param capacity the cache size - * @param keyResolver the key resolver - */ - public CachingKeyResolver(int capacity, final IKeyResolver keyResolver) { - this.keyResolver = keyResolver; - cache = CacheBuilder.newBuilder().maximumSize(capacity) - .build(new CachingKeyResolverCacheLoader(keyResolver)); - } - - @Override - public ListenableFuture resolveKeyAsync(String kid) { - KeyIdentifier keyIdentifier = new KeyIdentifier(kid); - if (keyIdentifier.version() == null) { - final ListenableFuture key = keyResolver.resolveKeyAsync(kid); - key.addListener(new Runnable() { - @Override - public void run() { - try { - cache.put(key.get().getKid(), key); - } catch (InterruptedException | ExecutionException e) { - // Key caching will occur on first read - } - } - }, MoreExecutors.directExecutor() - ); - return key; - } else { - return cache.getUnchecked(kid); - } - } - - private static class CachingKeyResolverCacheLoader extends CacheLoader> { - - private final IKeyResolver keyResolver; - - CachingKeyResolverCacheLoader(IKeyResolver keyResolver) { - this.keyResolver = keyResolver; - } - - @Override - public ListenableFuture load(String kid) { - return keyResolver.resolveKeyAsync(kid); - } - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKey.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKey.java deleted file mode 100644 index d5d8ab2e2094..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKey.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.microsoft.azure.keyvault.extensions; - -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.util.Objects; - -import com.google.common.util.concurrent.MoreExecutors; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.lang3.tuple.Triple; - -import com.google.common.base.Function; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.microsoft.azure.keyvault.KeyVaultClient; -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.cryptography.RsaKey; -import com.microsoft.azure.keyvault.webkey.JsonWebKey; -import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; -import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; -import com.microsoft.azure.keyvault.models.KeyBundle; -import com.microsoft.azure.keyvault.models.KeyOperationResult; -import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; - -/** - * The key vault key that performs cryptography operations. - */ -public class KeyVaultKey implements IKey { - - /** - * Transforms the result of decrypt operation to byte array. - */ - static class DecryptResultTransform implements Function { - - DecryptResultTransform() { - super(); - } - - @Override - public byte[] apply(KeyOperationResult result) { - Objects.requireNonNull(result, "Parameter 'result' should not be null"); - - return result.result(); - } - } - - /** - * Transforms the result of sign operation to byte array and algorithm pair. - */ - static class SignResultTransform implements Function> { - - private final String algorithm; - - SignResultTransform(String algorithm) { - super(); - this.algorithm = algorithm; - } - - @Override - public Pair apply(KeyOperationResult input) { - Objects.requireNonNull(input, "Parameter 'input' should not be null"); - - return Pair.of(input.result(), algorithm); - } - } - - private final KeyVaultClient client; - private IKey implementation; - - protected KeyVaultKey(KeyVaultClient client, KeyBundle keyBundle) { - - if (client == null) { - throw new IllegalArgumentException("client"); - } - - if (keyBundle == null) { - throw new IllegalArgumentException("keyBundle"); - } - - JsonWebKey key = keyBundle.key(); - - if (key == null) { - throw new IllegalArgumentException("keyBundle must contain a key"); - } - - if (key.kty().equals(JsonWebKeyType.RSA)) { - // The private key is not available for KeyVault keys - implementation = new RsaKey(key.kid(), key.toRSA(false)); - } else if (key.kty().equals(JsonWebKeyType.RSA_HSM)) { - // The private key is not available for KeyVault keys - implementation = new RsaKey(key.kid(), key.toRSA(false)); - } - - if (implementation == null) { - throw new IllegalArgumentException(String.format("The key type %s is not supported", key.kty())); - } - - this.client = client; - } - - @Override - public void close() throws IOException { - if (implementation != null) { - implementation.close(); - } - } - - @Override - public String getDefaultEncryptionAlgorithm() { - if (implementation == null) { - return null; - } - - return implementation.getDefaultEncryptionAlgorithm(); - } - - @Override - public String getDefaultKeyWrapAlgorithm() { - - if (implementation == null) { - return null; - } - - return implementation.getDefaultKeyWrapAlgorithm(); - } - - @Override - public String getDefaultSignatureAlgorithm() { - - if (implementation == null) { - return null; - } - - return implementation.getDefaultSignatureAlgorithm(); - } - - @Override - public String getKid() { - - if (implementation == null) { - return null; - } - - return implementation.getKid(); - } - - @Override - public ListenableFuture decryptAsync(byte[] ciphertext, byte[] iv, byte[] authenticationData, byte[] authenticationTag, String algorithm) { - - if (implementation == null) { - return null; - } - - if (Strings.isNullOrWhiteSpace(algorithm)) { - algorithm = getDefaultEncryptionAlgorithm(); - } - - // Never local - ListenableFuture futureCall = - client.decryptAsync( - implementation.getKid(), - new JsonWebKeyEncryptionAlgorithm(algorithm), - ciphertext, - null); - return Futures.transform(futureCall, new DecryptResultTransform(), MoreExecutors.directExecutor()); - } - - @Override - public ListenableFuture> encryptAsync(byte[] plaintext, byte[] iv, byte[] authenticationData, String algorithm) throws NoSuchAlgorithmException { - if (implementation == null) { - return null; - } - - return implementation.encryptAsync(plaintext, iv, authenticationData, algorithm); - } - - @Override - public ListenableFuture> wrapKeyAsync(byte[] plaintext, String algorithm) throws NoSuchAlgorithmException { - if (implementation == null) { - return null; - } - - return implementation.wrapKeyAsync(plaintext, algorithm); - } - - @Override - public ListenableFuture unwrapKeyAsync(byte[] ciphertext, String algorithm) { - if (implementation == null) { - return null; - } - - if (Strings.isNullOrWhiteSpace(algorithm)) { - algorithm = getDefaultKeyWrapAlgorithm(); - } - - // Never local - ListenableFuture futureCall = - client.unwrapKeyAsync( - implementation.getKid(), - new JsonWebKeyEncryptionAlgorithm(algorithm), - ciphertext, - null); - return Futures.transform(futureCall, new DecryptResultTransform(), MoreExecutors.directExecutor()); - } - - @Override - public ListenableFuture> signAsync(byte[] digest, String algorithm) throws NoSuchAlgorithmException { - if (implementation == null) { - return null; - } - - if (Strings.isNullOrWhiteSpace(algorithm)) { - algorithm = getDefaultSignatureAlgorithm(); - } - - // Never local - ListenableFuture futureCall = - client.signAsync( - implementation.getKid(), - new JsonWebKeySignatureAlgorithm(algorithm), - digest, - null); - return Futures.transform(futureCall, new SignResultTransform(algorithm), MoreExecutors.directExecutor()); - } - - @Override - public ListenableFuture verifyAsync(byte[] digest, byte[] signature, String algorithm) throws NoSuchAlgorithmException { - if (implementation == null) { - return null; - } - - return implementation.verifyAsync(digest, signature, algorithm); - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKeyResolver.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKeyResolver.java deleted file mode 100644 index f78e631bd433..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKeyResolver.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.extensions; - -import java.security.Provider; - -import com.google.common.util.concurrent.MoreExecutors; -import org.apache.commons.codec.binary.Base64; - -import com.google.common.base.Function; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.microsoft.azure.keyvault.KeyIdentifier; -import com.microsoft.azure.keyvault.KeyVaultClient; -import com.microsoft.azure.keyvault.SecretIdentifier; -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.core.IKeyResolver; -import com.microsoft.azure.keyvault.cryptography.SymmetricKey; -import com.microsoft.azure.keyvault.models.KeyBundle; -import com.microsoft.azure.keyvault.models.SecretBundle; - -/** - * The key resolver class that handles resolving key id to type {@link IKey} - * to be used for cryptography operations. - */ -public class KeyVaultKeyResolver implements IKeyResolver { - - static final Base64 BASE64 = new Base64(-1, null, true); - - /** - * Transforms {@link KeyBundle} to {@link IKey}. - */ - class FutureKeyFromKey implements Function { - - protected FutureKeyFromKey() { - super(); - } - - @Override - public IKey apply(KeyBundle keyBundle) { - - if (keyBundle != null) { - return new KeyVaultKey(client, keyBundle); - } - - return null; - } - } - - /** - * Transforms {@link SecretBundle} to {@link IKey}. - */ - class FutureKeyFromSecret implements Function { - - protected FutureKeyFromSecret() { - super(); - } - - @Override - public IKey apply(SecretBundle secretBundle) { - - if (secretBundle != null && secretBundle.contentType().equalsIgnoreCase("application/octet-stream")) { - byte[] keyBytes = BASE64.decode(secretBundle.value()); - - if (keyBytes != null) { - return new SymmetricKey(secretBundle.id(), keyBytes, provider); - } - } - - return null; - } - } - - private final KeyVaultClient client; - private final Provider provider; - - /** - * Constructor. - * @param client the key vault client - */ - public KeyVaultKeyResolver(KeyVaultClient client) { - this.client = client; - this.provider = null; - } - - /** - * Constructor. - * @param client the key vault client - * @param provider the java security provider - */ - public KeyVaultKeyResolver(KeyVaultClient client, Provider provider) { - this.client = client; - this.provider = provider; - } - - private ListenableFuture resolveKeyFromSecretAsync(String kid) { - - ListenableFuture futureCall = client.getSecretAsync(kid, null); - return Futures.transform(futureCall, new FutureKeyFromSecret(), MoreExecutors.directExecutor()); - } - - private ListenableFuture resolveKeyFromKeyAsync(String kid) { - - ListenableFuture futureCall = client.getKeyAsync(kid, null); - return Futures.transform(futureCall, new FutureKeyFromKey(), MoreExecutors.directExecutor()); - } - - @Override - public ListenableFuture resolveKeyAsync(String kid) { - - if (KeyIdentifier.isKeyIdentifier(kid)) { - return resolveKeyFromKeyAsync(kid); - } else if (SecretIdentifier.isSecretIdentifier(kid)) { - return resolveKeyFromSecretAsync(kid); - } - - return Futures.immediateFuture(null); - } - -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/Strings.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/Strings.java deleted file mode 100644 index 1bab9f916ca6..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/Strings.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.extensions; - -/** - * String handlers. - */ -public class Strings { - - /** - * Determines whether the parameter string is either null or empty. - * @param arg the string to verify - * @return true if the string is empty or null and false otherwise. - */ - public static boolean isNullOrEmpty(String arg) { - - if (arg == null || arg.length() == 0) { - return true; - } - - return false; - } - - /** - * Determines whether the parameter string is null, empty or whitespace. - * @param arg the string to verify - * @return true if the string is empty, contains only whitespace or is null and false otherwise - */ - public static boolean isNullOrWhiteSpace(String arg) { - - if (Strings.isNullOrEmpty(arg) || arg.trim().isEmpty()) { - return true; - } - - return false; - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/package.html b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/package.html deleted file mode 100644 index 12edd05fd0ba..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/package.html +++ /dev/null @@ -1,5 +0,0 @@ - - -This package contains the Azure Key Vault Extension classes. - - diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/CachingKeyResolverTest.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/CachingKeyResolverTest.java deleted file mode 100644 index b39f5fee4178..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/CachingKeyResolverTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * - * Copyright (c) Microsoft and contributors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.microsoft.azure.keyvault.extensions.test; - -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.UncheckedExecutionException; -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.core.IKeyResolver; -import com.microsoft.azure.keyvault.extensions.CachingKeyResolver; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import java.util.concurrent.Executor; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class CachingKeyResolverTest { - - @SuppressWarnings("unchecked") - final ListenableFuture ikeyAsync = mock(ListenableFuture.class); - static final String KEY_ID = "https://test.vault.azure.net/keys/keyID/version"; - static final String KEY_ID_2 = "https://test.vault.azure.net/keys/keyID2/version"; - static final String KEY_ID_3 = "https://test.vault.azure.net/keys/keyID3/version"; - static final String NEWER_KEY_ID_3 = "https://test.vault.azure.net/keys/keyID3/version2"; - static final String UNVERSIONNED_KEY_ID_3 = "https://test.vault.azure.net/keys/keyID3"; - - /* - * Tests the capacity limit of CachingKeyResolver by adding more keys - * than the cache limit and verifying that least recently used entity is evicted. - */ - @Test - public void capacityLimitOfCachingKeyResolver() { - IKeyResolver mockedKeyResolver = mock(IKeyResolver.class); - CachingKeyResolver resolver = new CachingKeyResolver(2, mockedKeyResolver); - - when(mockedKeyResolver.resolveKeyAsync(KEY_ID)).thenReturn(ikeyAsync); - when(mockedKeyResolver.resolveKeyAsync(KEY_ID_2)).thenReturn(ikeyAsync); - when(mockedKeyResolver.resolveKeyAsync(KEY_ID_3)).thenReturn(ikeyAsync); - - resolver.resolveKeyAsync(KEY_ID); - resolver.resolveKeyAsync(KEY_ID_2); - resolver.resolveKeyAsync(KEY_ID_3); - - resolver.resolveKeyAsync(KEY_ID_2); - resolver.resolveKeyAsync(KEY_ID_3); - resolver.resolveKeyAsync(KEY_ID); - resolver.resolveKeyAsync(KEY_ID_3); - - verify(mockedKeyResolver, times(1)).resolveKeyAsync(KEY_ID_2); - verify(mockedKeyResolver, times(1)).resolveKeyAsync(KEY_ID_3); - verify(mockedKeyResolver, times(2)).resolveKeyAsync(KEY_ID); - } - - /* - * Tests the behavior of CachingKeyResolver when resolving key throws - * and validate that the failed entity is not added to the cache. - */ - @Test - public void cachingKeyResolverThrows() { - IKeyResolver mockedKeyResolver = mock(IKeyResolver.class); - CachingKeyResolver resolver = new CachingKeyResolver(10, mockedKeyResolver); - - // First throw exception and for the second call return a value - when(mockedKeyResolver.resolveKeyAsync(KEY_ID)) - .thenThrow(new RuntimeException("test")) - .thenReturn(ikeyAsync); - - try { - resolver.resolveKeyAsync(KEY_ID); - fail("Should have thrown an exception."); - } catch (UncheckedExecutionException e) { - assertTrue("RuntimeException is expected.", e.getCause() instanceof RuntimeException); - } - - resolver.resolveKeyAsync(KEY_ID); - resolver.resolveKeyAsync(KEY_ID); - - verify(mockedKeyResolver, times(2)).resolveKeyAsync(KEY_ID); - } - - /* - * Tests that CachingKeyResolver does not cache un-versioned keys, - * but does cache the result versioned key - */ - @Test - public void cachingUnversionnedKey() throws Exception { - IKeyResolver mockedKeyResolver = mock(IKeyResolver.class); - CachingKeyResolver resolver = new CachingKeyResolver(2, mockedKeyResolver); - - IKey key = mock(IKey.class); - - when(mockedKeyResolver.resolveKeyAsync(UNVERSIONNED_KEY_ID_3)).thenReturn(ikeyAsync); - when(ikeyAsync.get()).thenReturn(key); - doAnswer(new Answer() { - @Override - public Object answer(InvocationOnMock invocationOnMock) throws Throwable { - invocationOnMock.getArgumentAt(0, Runnable.class).run(); - return null; - } - }).when(ikeyAsync).addListener(any(Runnable.class), any(Executor.class)); - when(key.getKid()).thenReturn(KEY_ID_3); - - /* - * First resolve unversionned key - */ - ListenableFuture result = resolver.resolveKeyAsync(UNVERSIONNED_KEY_ID_3); - assertEquals(result.get().getKid(), KEY_ID_3); - verify(mockedKeyResolver, times(1)).resolveKeyAsync(UNVERSIONNED_KEY_ID_3); - verify(mockedKeyResolver, times(0)).resolveKeyAsync(KEY_ID_3); - - /* - * Second resolve unversionned key, but the result should be a newer key - */ - when(key.getKid()).thenReturn(NEWER_KEY_ID_3); - result = resolver.resolveKeyAsync(UNVERSIONNED_KEY_ID_3); - assertEquals(result.get().getKid(), NEWER_KEY_ID_3); - verify(mockedKeyResolver, times(2)).resolveKeyAsync(UNVERSIONNED_KEY_ID_3); - verify(mockedKeyResolver, times(0)).resolveKeyAsync(KEY_ID_3); - verify(mockedKeyResolver, times(0)).resolveKeyAsync(NEWER_KEY_ID_3); - - /* - * Check that versionned keys were added to the cache, and do not get resolved again - */ - resolver.resolveKeyAsync(KEY_ID_3); - resolver.resolveKeyAsync(NEWER_KEY_ID_3); - verify(mockedKeyResolver, times(0)).resolveKeyAsync(KEY_ID_3); - verify(mockedKeyResolver, times(0)).resolveKeyAsync(NEWER_KEY_ID_3); - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultClientIntegrationTestBase.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultClientIntegrationTestBase.java deleted file mode 100644 index 117eec09f163..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultClientIntegrationTestBase.java +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.extensions.test; - -import com.microsoft.aad.adal4j.AuthenticationContext; -import com.microsoft.aad.adal4j.AuthenticationResult; -import com.microsoft.aad.adal4j.ClientCredential; -import com.microsoft.azure.AzureResponseBuilder; -import com.microsoft.azure.keyvault.KeyVaultClient; -import com.microsoft.azure.keyvault.authentication.KeyVaultCredentials; -import com.microsoft.azure.keyvault.models.Attributes; -import com.microsoft.azure.keyvault.models.DeletedCertificateBundle; -import com.microsoft.azure.keyvault.models.DeletedKeyBundle; -import com.microsoft.azure.keyvault.models.DeletedSecretBundle; -import com.microsoft.azure.management.resources.core.InterceptorManager; -import com.microsoft.azure.management.resources.core.TestBase; -import com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor; -import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; -import com.microsoft.azure.serializer.AzureJacksonAdapter; -import com.microsoft.rest.LogLevel; -import com.microsoft.rest.RestClient; -import com.microsoft.rest.credentials.ServiceClientCredentials; -import com.microsoft.rest.interceptors.LoggingInterceptor; -import org.junit.After; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.rules.TestName; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -public class KeyVaultClientIntegrationTestBase { - - private static TestBase.TestMode testMode = null; - private PrintStream out; - - protected enum RunCondition { - MOCK_ONLY, LIVE_ONLY, BOTH - } - - protected static KeyVaultClient keyVaultClient; - - protected static final String ZERO_SUBSCRIPTION = "00000000-0000-0000-0000-000000000000"; - protected static final String ZERO_TENANT = "00000000-0000-0000-0000-000000000000"; - private static final String PLAYBACK_URI_BASE = "http://localhost:"; - protected static String playbackUri = null; - - private final RunCondition runCondition; - - protected KeyVaultClientIntegrationTestBase() { - this(RunCondition.BOTH); - } - - protected KeyVaultClientIntegrationTestBase(RunCondition runCondition) { - this.runCondition = runCondition; - } - - /** - * Primary vault URI, used for keys and secrets tests. - */ - public static String getVaultUri() { - return getLiveVaultUri1(); - } - - /** - * Secondary vault URI, used to verify ability to transparently authenticate - * against a different resource. - */ - public static String getSecondaryVaultUri() { - return getLiveVaultUri2(); - } - - private static String getLiveVaultUri1() { - return getenvOrDefault("KEYVAULT_VAULTURI", "https://javasdktestvault.vault.azure.net"); - } - - private static String getLiveVaultUri2() { - return getenvOrDefault("KEYVAULT_VAULTURI_ALT", "https://javasdktestvault2.vault.azure.net"); - } - - private static String getenvOrDefault(String varName, String defValue) { - String value = System.getenv(varName); - return value != null ? value : defValue; - } - - protected static void compareAttributes(Attributes expectedAttributes, Attributes actualAttribute) { - if (expectedAttributes != null) { - Assert.assertEquals(expectedAttributes.enabled(), actualAttribute.enabled()); - Assert.assertEquals(expectedAttributes.expires(), actualAttribute.expires()); - Assert.assertEquals(expectedAttributes.notBefore(), actualAttribute.notBefore()); - } - } - - private static AuthenticationResult getAccessToken(String authorization, String resource) throws Exception { - - String clientId = System.getenv("AZURE_KEYVAULT_CLIENT_ID"); - - if (clientId == null) { - throw new Exception("Please inform arm.clientid in the environment settings."); - } - - String clientKey = System.getenv("AZURE_KEYVAULT_CLIENT_SECRET"); - String username = System.getenv("arm.username"); - String password = System.getenv("arm.password"); - - AuthenticationResult result = null; - ExecutorService service = null; - try { - service = Executors.newFixedThreadPool(1); - AuthenticationContext context = new AuthenticationContext(authorization, false, service); - - Future future = null; - - if (clientKey != null && password == null) { - ClientCredential credentials = new ClientCredential(clientId, clientKey); - future = context.acquireToken(resource, credentials, null); - } - - if (password != null && clientKey == null) { - future = context.acquireToken(resource, clientId, username, password, null); - } - - if (future == null) { - throw new Exception( - "Missing or ambiguous credentials - please inform exactly one of arm.clientkey or arm.password in the environment settings."); - } - - result = future.get(); - } finally { - service.shutdown(); - } - - if (result == null) { - throw new RuntimeException("authentication result was null"); - } - return result; - } - - private static ServiceClientCredentials createTestCredentials() throws Exception { - return new KeyVaultCredentials() { - - @Override - public String doAuthenticate(String authorization, String resource, String scope) { - try { - - if (isRecordMode()) { - AuthenticationResult authResult = getAccessToken(authorization, resource); - return authResult.getAccessToken(); - } else { - return ""; - } - - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - }; - } - - protected void initializeClients(RestClient restClient, String s, String s1) throws IOException { - try { - RestClient restClientWithTimeout = buildRestClient(new RestClient.Builder() - .withBaseUrl("https://{vaultBaseUrl}").withSerializerAdapter(new AzureJacksonAdapter()) - .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) - .withCredentials(createTestCredentials()).withLogLevel(LogLevel.BODY_AND_HEADERS) - .withNetworkInterceptor(interceptorManager.initInterceptor())); - createTestCredentials(); - keyVaultClient = new KeyVaultClient(restClientWithTimeout); - - // keyVaultClient = new KeyVaultClient(restClient); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static String generateRandomResourceName(String prefix, int maxLen) { - return SdkContext.randomResourceName(prefix, maxLen); - } - - - private String shouldCancelTest(boolean isPlaybackMode) { - // Determine whether to run the test based on the condition the test has been - // configured with - switch (this.runCondition) { - case MOCK_ONLY: - return (!isPlaybackMode) ? "Test configured to run only as mocked, not live." : null; - case LIVE_ONLY: - return (isPlaybackMode) ? "Test configured to run only as live, not mocked." : null; - default: - return null; - } - } - - private static void initTestMode() throws IOException { - String azureTestMode = System.getenv("AZURE_TEST_MODE"); - if (azureTestMode != null) { - if (azureTestMode.equalsIgnoreCase("Record")) { - testMode = TestBase.TestMode.RECORD; - } else if (azureTestMode.equalsIgnoreCase("Playback")) { - testMode = TestBase.TestMode.PLAYBACK; - } else { - throw new IOException("Unknown AZURE_TEST_MODE: " + azureTestMode); - } - } else { - // System.out.print("Environment variable 'AZURE_TEST_MODE' has not been set - // yet. Using 'Playback' mode."); - testMode = TestBase.TestMode.PLAYBACK; - } - } - - private static void initPlaybackUri() throws IOException { - if (isPlaybackMode()) { - Properties mavenProps = new Properties(); - InputStream in = TestBase.class.getResourceAsStream("/maven.properties"); - if (in == null) { - throw new IOException( - "The file \"maven.properties\" has not been generated yet. Please execute \"mvn compile\" to generate the file."); - } - mavenProps.load(in); - String port = mavenProps.getProperty("playbackServerPort"); - playbackUri = PLAYBACK_URI_BASE + port; - } else { - playbackUri = PLAYBACK_URI_BASE + "1234"; - } - } - - public static boolean isPlaybackMode() { - if (testMode == null) { - try { - initTestMode(); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException("Can't init test mode."); - } - } - - return testMode == TestBase.TestMode.PLAYBACK; - } - - public static boolean isRecordMode() { - return !isPlaybackMode(); - } - - private static void printThreadInfo(String what) { - long id = Thread.currentThread().getId(); - String name = Thread.currentThread().getName(); - System.out.println(String.format("\n***\n*** [%s:%s] - %s\n***\n", name, id, what)); - } - - @Rule - public TestName testName = new TestName(); - - protected InterceptorManager interceptorManager = null; - - @BeforeClass - public static void beforeClass() throws IOException { - printThreadInfo("beforeclass"); - initTestMode(); - initPlaybackUri(); - } - - @Before - public void beforeMethod() throws Exception { - printThreadInfo(String.format("%s: %s", "beforeTest", testName.getMethodName())); - final String skipMessage = shouldCancelTest(isPlaybackMode()); - Assume.assumeTrue(skipMessage, skipMessage == null); - - interceptorManager = InterceptorManager.create(testName.getMethodName(), testMode); - - RestClient restClient; - String defaultSubscription; - ServiceClientCredentials credentials = createTestCredentials(); - - if (isRecordMode()) { - - restClient = buildRestClient(new RestClient.Builder().withBaseUrl("https://{vaultBaseUrl}") - .withSerializerAdapter(new AzureJacksonAdapter()) - .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) - .withLogLevel(LogLevel.NONE) - .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) - .withNetworkInterceptor(interceptorManager.initInterceptor()) - .withInterceptor(new ResourceManagerThrottlingInterceptor())); - - interceptorManager.addTextReplacementRule("https://management.azure.com/", playbackUri + "/"); - interceptorManager.addTextReplacementRule("https://graph.windows.net/", playbackUri + "/"); - - keyVaultClient = new KeyVaultClient(restClient); - } else { // is Playback Mode - - restClient = buildRestClient(new RestClient.Builder().withBaseUrl(playbackUri + "/") - .withSerializerAdapter(new AzureJacksonAdapter()) - .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) - .withLogLevel(LogLevel.NONE) - .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) - .withNetworkInterceptor(interceptorManager.initInterceptor()) - .withInterceptor(new ResourceManagerThrottlingInterceptor())); - defaultSubscription = ZERO_SUBSCRIPTION; - - out = System.out; - System.setOut(new PrintStream(new OutputStream() { - public void write(int b) { - // DO NOTHING - } - })); - - keyVaultClient = new KeyVaultClient(restClient); - } - - } - - protected static DeletedCertificateBundle pollOnCertificateDeletion(String vaultBaseUrl, String certificateName) - throws Exception { - int pendingPollCount = 0; - while (pendingPollCount < 21) { - DeletedCertificateBundle certificateBundle = keyVaultClient.getDeletedCertificate(vaultBaseUrl, - certificateName); - if (certificateBundle == null) { - if (isRecordMode()) { - Thread.sleep(10000); - } - pendingPollCount += 1; - continue; - } else { - return certificateBundle; - } - } - throw new Exception("Deleting certificate delayed"); - } - - protected static DeletedKeyBundle pollOnKeyDeletion(String vaultBaseUrl, String certificateName) throws Exception { - int pendingPollCount = 0; - while (pendingPollCount < 21) { - DeletedKeyBundle deletedKeyBundle = keyVaultClient.getDeletedKey(vaultBaseUrl, certificateName); - if (deletedKeyBundle == null) { - if (isRecordMode()) { - Thread.sleep(10000); - } - pendingPollCount += 1; - continue; - } else { - return deletedKeyBundle; - } - } - throw new Exception("Deleting key delayed"); - } - - protected static DeletedSecretBundle pollOnSecretDeletion(String vaultBaseUrl, String secretName) throws Exception { - int pendingPollCount = 0; - while (pendingPollCount < 70) { - DeletedSecretBundle deletedSecretBundle = keyVaultClient.getDeletedSecret(vaultBaseUrl, secretName); - if (deletedSecretBundle == null) { - if (isRecordMode()) { - Thread.sleep(10000); - } - pendingPollCount += 1; - continue; - } else { - return deletedSecretBundle; - } - } - throw new Exception("Deleting secret delayed"); - } - - - @After - public void afterMethod() throws IOException { - if (shouldCancelTest(isPlaybackMode()) != null) { - return; - } - - interceptorManager.finalizeInterceptor(); - } - - protected RestClient buildRestClient(RestClient.Builder builder) { - return builder.build(); - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverBCProviderTest.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverBCProviderTest.java deleted file mode 100644 index 9a4ae31ce412..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverBCProviderTest.java +++ /dev/null @@ -1,281 +0,0 @@ -// -//Copyright © Microsoft Corporation, All Rights Reserved -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -//OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION -//ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A -//PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. -// -//See the Apache License, Version 2.0 for the specific language -//governing permissions and limitations under the License. - -package com.microsoft.azure.keyvault.extensions.test; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.fail; - -import java.security.Provider; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -import org.apache.commons.codec.binary.Base64; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.extensions.KeyVaultKeyResolver; -import com.microsoft.azure.keyvault.models.KeyBundle; -import com.microsoft.azure.keyvault.models.SecretBundle; -import com.microsoft.azure.keyvault.requests.CreateKeyRequest; -import com.microsoft.azure.keyvault.requests.SetSecretRequest; -import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; - -public class KeyVaultKeyResolverBCProviderTest extends KeyVaultClientIntegrationTestBase { - - private Provider provider = null; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - try { - provider = (Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance(); - } catch (ClassNotFoundException | IllegalAccessException | InstantiationException ex) { - throw new RuntimeException(ex.getMessage()); - } - } - - @After - public void tearDown() throws Exception { - } - - private static final String KEY_NAME = "JavaExtensionKey"; - private static final String SECRET_NAME = "JavaExtensionSecret"; - private static final Base64 BASE_64 = new Base64(-1, null, true); - - @Test - public void keyKeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException { - String testKeyName = KEY_NAME + "1"; - try { - // Create a key on a vault. - CreateKeyRequest request = new CreateKeyRequest.Builder(getVaultUri(), testKeyName, JsonWebKeyType.RSA).build(); - KeyBundle bundle = keyVaultClient.createKey(request); - - if (bundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient, provider); - - Future baseKeyFuture = resolver.resolveKeyAsync(bundle.keyIdentifier().baseIdentifier()); - Future versionKeyFuture = resolver.resolveKeyAsync(bundle.keyIdentifier().identifier()); - - IKey baseKey = baseKeyFuture.get(); - IKey versionKey = versionKeyFuture.get(); - - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - } finally { - // Delete the key - keyVaultClient.deleteKey(getVaultUri(), testKeyName); - pollOnKeyDeletion(getVaultUri(), testKeyName); - keyVaultClient.purgeDeletedKey(getVaultUri(), testKeyName); - - } - } - } catch (Exception ex) { - Assert.fail(ex.getMessage()); - } - } - - /* - * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. - */ - @Test - public void secret128Base64KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException { - // Arrange - byte[] keyBytes = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}; - byte[] cek = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF}; - byte[] ek = {0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5}; - - String testSecretName = SECRET_NAME + "1"; - try { - - SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), testSecretName, BASE_64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); - SecretBundle secretBundle = keyVaultClient.setSecret(request); - - if (secretBundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient); - - IKey baseKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().identifier()).get(); - - // Check for correct key identifiers - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - - // Ensure key operations give the expected results - byte[] encrypted = null; - - try { - encrypted = baseKey.wrapKeyAsync(cek, "A128KW").get().getLeft(); - } catch (Exception e) { - fail(e.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - - try { - encrypted = versionKey.wrapKeyAsync(cek, "A128KW").get().getLeft(); - } catch (Exception e) { - fail(e.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - } finally { - // Delete the secret - keyVaultClient.deleteSecret(getVaultUri(), testSecretName); - pollOnSecretDeletion(getVaultUri(), testSecretName); - keyVaultClient.purgeDeletedSecret(getVaultUri(), testSecretName); - - } - } - } catch (Exception ex) { - Assert.fail(ex.getMessage()); - } - } - - /* - * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. - */ - @Test - public void secret192Base64KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException { - // Arrange - byte[] keyBytes = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}; - byte[] cek = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF}; - byte[] ek = {(byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D}; - - String testSecretName = SECRET_NAME + "2"; - try { - SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), testSecretName, BASE_64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); - SecretBundle secretBundle = keyVaultClient.setSecret(request); - - if (secretBundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient, provider); - - IKey baseKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().identifier()).get(); - - // Check for correct key identifiers - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - - // Ensure key operations give the expected results - byte[] encrypted = null; - - try { - encrypted = baseKey.wrapKeyAsync(cek, "A192KW").get().getLeft(); - } catch (Exception e) { - fail(e.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - - try { - encrypted = versionKey.wrapKeyAsync(cek, "A192KW").get().getLeft(); - } catch (Exception e) { - fail(e.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - } finally { - // Delete the key - keyVaultClient.deleteSecret(getVaultUri(), testSecretName); - pollOnSecretDeletion(getVaultUri(), testSecretName); - keyVaultClient.purgeDeletedSecret(getVaultUri(), testSecretName); - } - } - } catch (Exception ex) { - Assert.fail(ex.getMessage()); - } - } - - /* - * Test resolving a key from a 256bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. - */ - @Test - public void secret256Base64KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException { - // Arrange - byte[] keyBytes = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F}; - byte[] cek = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF}; - byte[] ek = {0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7}; - - String testSecretName = SECRET_NAME + "3"; - - try { - SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), testSecretName, BASE_64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); - SecretBundle secretBundle = keyVaultClient.setSecret(request); - - if (secretBundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient, provider); - - IKey baseKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().identifier()).get(); - - // Check for correct key identifiers - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - - // Ensure key operations give the expected results - byte[] encrypted = null; - - try { - encrypted = baseKey.wrapKeyAsync(cek, "A256KW").get().getLeft(); - } catch (Exception e) { - fail(e.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - - try { - encrypted = versionKey.wrapKeyAsync(cek, "A256KW").get().getLeft(); - } catch (Exception e) { - fail(e.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - } finally { - // Delete the key - keyVaultClient.deleteSecret(getVaultUri(), testSecretName); - pollOnSecretDeletion(getVaultUri(), testSecretName); - keyVaultClient.purgeDeletedSecret(getVaultUri(), testSecretName); - } - } - } catch (Exception ex) { - fail(ex.getMessage()); - } - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverDefaultProviderTest.java b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverDefaultProviderTest.java deleted file mode 100644 index a5afe68b8c12..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverDefaultProviderTest.java +++ /dev/null @@ -1,320 +0,0 @@ -package com.microsoft.azure.keyvault.extensions.test; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.fail; - -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.concurrent.ExecutionException; -import javax.crypto.Cipher; - -import org.apache.commons.codec.binary.Base64; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.microsoft.azure.keyvault.core.IKey; -import com.microsoft.azure.keyvault.extensions.KeyVaultKeyResolver; -import com.microsoft.azure.keyvault.models.KeyBundle; -import com.microsoft.azure.keyvault.models.SecretBundle; -import com.microsoft.azure.keyvault.requests.CreateKeyRequest; -import com.microsoft.azure.keyvault.requests.SetSecretRequest; -import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; - -// -//Copyright © Microsoft Corporation, All Rights Reserved -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -//OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION -//ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A -//PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. -// -//See the Apache License, Version 2.0 for the specific language -//governing permissions and limitations under the License. - -public class KeyVaultKeyResolverDefaultProviderTest extends KeyVaultClientIntegrationTestBase { - private static boolean hasUnlimitedCrypto() { - try { - return Cipher.getMaxAllowedKeyLength("RC5") >= 256; - } catch (NoSuchAlgorithmException e) { - return false; - } - } - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - private static final boolean UNLIMITED = hasUnlimitedCrypto(); - - - private static final String KEY_NAME = "JavaExtensionKey"; - private static final String SECRET_NAME = "JavaExtensionSecret"; - - private static final Base64 BASE_64 = new Base64(-1, null, true); - - @Test - public void keyKeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException { - String testKeyName = KEY_NAME + "1"; - try { - // Create a key on a vault. - CreateKeyRequest request = new CreateKeyRequest.Builder(getVaultUri(), testKeyName, JsonWebKeyType.RSA).build(); - KeyBundle keyBundle = keyVaultClient.createKey(request); - - try { - // ctor with client - final KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient); - - IKey baseKey = resolver.resolveKeyAsync(keyBundle.keyIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(keyBundle.keyIdentifier().identifier()).get(); - - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - } finally { - // Delete the key - keyVaultClient.deleteKey(getVaultUri(), testKeyName); - pollOnKeyDeletion(getVaultUri(), testKeyName); - keyVaultClient.purgeDeletedKey(getVaultUri(), testKeyName); - } - } catch (Exception ex) { - fail(ex.getMessage()); - } - } - - /* - * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. - */ - @Test - public void secret128Base64KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException { - // Arrange - byte[] keyBytes = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}; - byte[] cek = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF}; - byte[] ek = {0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5}; - - String testSecretName = SECRET_NAME + "2"; - - try { - SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), testSecretName, BASE_64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); - SecretBundle secretBundle = keyVaultClient.setSecret(request); - - if (secretBundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient); - - IKey baseKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().identifier()).get(); - - // Check for correct key identifiers - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - - // Ensure key operations give the expected results - byte[] encrypted = null; - - try { - encrypted = baseKey.wrapKeyAsync(cek, "A128KW").get().getLeft(); - } catch (Exception ex) { - fail(ex.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - - try { - encrypted = versionKey.wrapKeyAsync(cek, "A128KW").get().getLeft(); - } catch (Exception ex) { - fail(ex.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - } finally { - // Delete the key - keyVaultClient.deleteSecret(getVaultUri(), testSecretName); - pollOnSecretDeletion(getVaultUri(), testSecretName); - keyVaultClient.purgeDeletedSecret(getVaultUri(), testSecretName); - } - } - } catch (Exception ex) { - fail(ex.getMessage()); - } - } - - /* - * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. - */ - @Test - public void secret192Base64KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException { - // Arrange - byte[] keyBytes = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}; - byte[] cek = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF}; - byte[] ek = {(byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D}; - - String testSecretName = SECRET_NAME + "4"; - - try { - SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), testSecretName, BASE_64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); - SecretBundle secretBundle = keyVaultClient.setSecret(request); - - if (secretBundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient); - - IKey baseKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().identifier()).get(); - - // Check for correct key identifiers - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - - // Ensure key operations give the expected results - byte[] encrypted = null; - - try { - encrypted = baseKey.wrapKeyAsync(cek, "A192KW").get().getLeft(); - - if (!UNLIMITED) { - fail("Expected ExecutionException"); - } - } catch (ExecutionException e) { - // In the limited case, the failure should be InvalidKeyException - // In the unlimited case, this should not fail - if (!UNLIMITED) { - Throwable cause = e.getCause(); - if (!(cause instanceof InvalidKeyException)) { - fail("ExecutionException"); - } - } else { - fail("ExecutionException"); - } - } catch (Exception ex) { - fail(ex.getMessage()); - } - - if (UNLIMITED) { - // Assert - assertArrayEquals(ek, encrypted); - - try { - encrypted = versionKey.wrapKeyAsync(cek, "A192KW").get().getLeft(); - } catch (Exception ex) { - fail(ex.getMessage()); - } - - // Assert - assertArrayEquals(ek, encrypted); - } - } finally { - // Delete the key - keyVaultClient.deleteSecret(getVaultUri(), testSecretName); - pollOnSecretDeletion(getVaultUri(), testSecretName); - keyVaultClient.purgeDeletedSecret(getVaultUri(), testSecretName); - } - } - } catch (Exception ex) { - fail(ex.getMessage()); - } - } - - /* - * Test resolving a key from a 256bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. - */ - @Test - public void secret256Base64KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException { - // Arrange - byte[] keyBytes = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F}; - byte[] cek = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF}; - byte[] ek = {0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7}; - - String testSecretName = SECRET_NAME + "1"; - - try { - SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), testSecretName, BASE_64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); - SecretBundle secretBundle = keyVaultClient.setSecret(request); - - if (secretBundle != null) { - try { - // ctor with client - KeyVaultKeyResolver resolver = new KeyVaultKeyResolver(keyVaultClient); - - IKey baseKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().baseIdentifier()).get(); - IKey versionKey = resolver.resolveKeyAsync(secretBundle.secretIdentifier().identifier()).get(); - - // Check for correct key identifiers - Assert.assertEquals(baseKey.getKid(), versionKey.getKid()); - - // Ensure key operations give the expected results - byte[] encrypted = null; - - try { - encrypted = baseKey.wrapKeyAsync(cek, "A256KW").get().getLeft(); - - if (!UNLIMITED) { - fail("Expected ExecutionException"); - } - } catch (InterruptedException e) { - fail("InterruptedException"); - } catch (ExecutionException e) { - // In the limited case, the failure should be InvalidKeyException - // In the unlimited case, this should not fail - if (!UNLIMITED) { - Throwable cause = e.getCause(); - if (!(cause instanceof InvalidKeyException)) { - fail("ExecutionException"); - } - } else { - fail("ExecutionException"); - } - } catch (NoSuchAlgorithmException e) { - fail("NoSuchAlgorithmException"); - } - - if (UNLIMITED) { - // Assert - assertArrayEquals(ek, encrypted); - - try { - encrypted = versionKey.wrapKeyAsync(cek, "A256KW").get().getLeft(); - } catch (InterruptedException e) { - fail("InterrupedException"); - } catch (ExecutionException e) { - fail("ExecutionException"); - } catch (NoSuchAlgorithmException e) { - fail("NoSuchAlgorithmException"); - } - - // Assert - assertArrayEquals(ek, encrypted); - } - } finally { - // Delete the key - keyVaultClient.deleteSecret(getVaultUri(), testSecretName); - pollOnSecretDeletion(getVaultUri(), testSecretName); - keyVaultClient.purgeDeletedSecret(getVaultUri(), testSecretName); - } - } - } catch (Exception ex) { - fail(ex.getMessage()); - } - } -} diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/keyKeyVaultKeyResolverBCProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/keyKeyVaultKeyResolverBCProviderTest.json deleted file mode 100644 index 2e4d6da3eb53..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/keyKeyVaultKeyResolverBCProviderTest.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:19 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "2e0ca1f2-c6e9-4f81-8fdb-fdd28708e6e6", - "Body" : "" - } - }, { - "Method" : "POST", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:20 GMT", - "content-length" : "668", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "35c93088-645c-4a46-8cf0-8c73491298b7", - "Body" : "{\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/7bf695d4513a4236a76f1bc03c57d848\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sycGANkD4TbKaRrm1qY0khvNBysKPUca_VG0ecQvu2sLMxdL7jzDZWDbUyzzjR1oXMSApqQLkk7_OAzD8h8on8Y2WCZzy5mlGQJhHD5-sAZsMTDH1tzC-M-YoAUqlY_fTyJkVM6K5FnO4IiI7SeCzrNAhSUCb7X8Hr8pJ0xeJ23EUfEbiGoNLQQc1k7SDAd9rgY6XJ6nzmbcZFYZ6Gjb49jdKWpDgoaoZGPPn0XPMqL0IB3NPacoy412WzZCYNKMt36pIDaRPG82q6Gp-AA_aZDumQP9Udqxg6PxkYQ5_ycnYwJmpYPt2wcFvFAQQSNR9e5jumnCCsTN_4-gt-5yaw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150360,\"updated\":1547150360,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:20 GMT", - "content-length" : "668", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "bc838004-cdaf-4646-aa77-7bef3a49f0c3", - "Body" : "{\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/7bf695d4513a4236a76f1bc03c57d848\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sycGANkD4TbKaRrm1qY0khvNBysKPUca_VG0ecQvu2sLMxdL7jzDZWDbUyzzjR1oXMSApqQLkk7_OAzD8h8on8Y2WCZzy5mlGQJhHD5-sAZsMTDH1tzC-M-YoAUqlY_fTyJkVM6K5FnO4IiI7SeCzrNAhSUCb7X8Hr8pJ0xeJ23EUfEbiGoNLQQc1k7SDAd9rgY6XJ6nzmbcZFYZ6Gjb49jdKWpDgoaoZGPPn0XPMqL0IB3NPacoy412WzZCYNKMt36pIDaRPG82q6Gp-AA_aZDumQP9Udqxg6PxkYQ5_ycnYwJmpYPt2wcFvFAQQSNR9e5jumnCCsTN_4-gt-5yaw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150360,\"updated\":1547150360,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/7bf695d4513a4236a76f1bc03c57d848?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:20 GMT", - "content-length" : "668", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "c73088e0-2dd7-4b14-b42b-be32cc58275e", - "Body" : "{\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/7bf695d4513a4236a76f1bc03c57d848\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sycGANkD4TbKaRrm1qY0khvNBysKPUca_VG0ecQvu2sLMxdL7jzDZWDbUyzzjR1oXMSApqQLkk7_OAzD8h8on8Y2WCZzy5mlGQJhHD5-sAZsMTDH1tzC-M-YoAUqlY_fTyJkVM6K5FnO4IiI7SeCzrNAhSUCb7X8Hr8pJ0xeJ23EUfEbiGoNLQQc1k7SDAd9rgY6XJ6nzmbcZFYZ6Gjb49jdKWpDgoaoZGPPn0XPMqL0IB3NPacoy412WzZCYNKMt36pIDaRPG82q6Gp-AA_aZDumQP9Udqxg6PxkYQ5_ycnYwJmpYPt2wcFvFAQQSNR9e5jumnCCsTN_4-gt-5yaw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150360,\"updated\":1547150360,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:20 GMT", - "content-length" : "811", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "fc1ea78f-d645-410b-bb0a-4530a86598f6", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1547150360,\"scheduledPurgeDate\":1554926360,\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/7bf695d4513a4236a76f1bc03c57d848\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sycGANkD4TbKaRrm1qY0khvNBysKPUca_VG0ecQvu2sLMxdL7jzDZWDbUyzzjR1oXMSApqQLkk7_OAzD8h8on8Y2WCZzy5mlGQJhHD5-sAZsMTDH1tzC-M-YoAUqlY_fTyJkVM6K5FnO4IiI7SeCzrNAhSUCb7X8Hr8pJ0xeJ23EUfEbiGoNLQQc1k7SDAd9rgY6XJ6nzmbcZFYZ6Gjb49jdKWpDgoaoZGPPn0XPMqL0IB3NPacoy412WzZCYNKMt36pIDaRPG82q6Gp-AA_aZDumQP9Udqxg6PxkYQ5_ycnYwJmpYPt2wcFvFAQQSNR9e5jumnCCsTN_4-gt-5yaw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150360,\"updated\":1547150360,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:20 GMT", - "content-length" : "85", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "b1c13587-b3d6-477f-9961-ff740da82b43", - "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: JavaExtensionKey1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:30 GMT", - "content-length" : "85", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "739a3f49-befb-49ca-b406-49bd2177832c", - "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: JavaExtensionKey1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:41 GMT", - "content-length" : "811", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "9a898e8c-f910-4f97-b341-5f5b7a8b4367", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1547150360,\"scheduledPurgeDate\":1554926360,\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/7bf695d4513a4236a76f1bc03c57d848\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sycGANkD4TbKaRrm1qY0khvNBysKPUca_VG0ecQvu2sLMxdL7jzDZWDbUyzzjR1oXMSApqQLkk7_OAzD8h8on8Y2WCZzy5mlGQJhHD5-sAZsMTDH1tzC-M-YoAUqlY_fTyJkVM6K5FnO4IiI7SeCzrNAhSUCb7X8Hr8pJ0xeJ23EUfEbiGoNLQQc1k7SDAd9rgY6XJ6nzmbcZFYZ6Gjb49jdKWpDgoaoZGPPn0XPMqL0IB3NPacoy412WzZCYNKMt36pIDaRPG82q6Gp-AA_aZDumQP9Udqxg6PxkYQ5_ycnYwJmpYPt2wcFvFAQQSNR9e5jumnCCsTN_4-gt-5yaw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150360,\"updated\":1547150360,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:42 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "e89cd7dc-97e4-4f0f-a0ac-c4d3992eb04c", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/keyKeyVaultKeyResolverDefaultProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/keyKeyVaultKeyResolverDefaultProviderTest.json deleted file mode 100644 index dcf087fb4bc9..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/keyKeyVaultKeyResolverDefaultProviderTest.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:14 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "a4456697-998b-4d64-acb0-e5ebcb029af0", - "Body" : "" - } - }, { - "Method" : "POST", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:14 GMT", - "content-length" : "668", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "b1597717-2323-48a7-b9e5-95e2912f3e83", - "Body" : "{\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/a885b12673b04178b81ea08d00fabbdd\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"xLxIGgi_kDaME6p3N_26SWKbVX3-mQRHiNqfefzj7zAB4owyMTqOfQXUvHoOYhcWCG_cCEj9kTQXAF-ZT7SyQVyqcT_rUvBoiIywqx3si2G8KQ3bin8gNFfJuxXepmjWMpA6rrMFWYn5ly5mYjLtJc-itdoAITPVFHnIzHHcMKKiB3wh-rOQjZqKHO1Dkp5IK_v8SXOQ4FpNTNxoQKvxM3iaWcWS0w5-Bui8HEn2OZOP6A-WeQBYIrCyTPH34JZ7EDFykVmxfsmVIZT4cQ1BtSy54srJUDJnzfZExkkTDSDPByKIvrLTWgqjlaAK2MnlaWI2Ec0WfymSNxE4jFXE4w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150474,\"updated\":1547150474,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:14 GMT", - "content-length" : "668", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "841de62e-2ce3-47eb-8dad-1a3697e50360", - "Body" : "{\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/a885b12673b04178b81ea08d00fabbdd\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"xLxIGgi_kDaME6p3N_26SWKbVX3-mQRHiNqfefzj7zAB4owyMTqOfQXUvHoOYhcWCG_cCEj9kTQXAF-ZT7SyQVyqcT_rUvBoiIywqx3si2G8KQ3bin8gNFfJuxXepmjWMpA6rrMFWYn5ly5mYjLtJc-itdoAITPVFHnIzHHcMKKiB3wh-rOQjZqKHO1Dkp5IK_v8SXOQ4FpNTNxoQKvxM3iaWcWS0w5-Bui8HEn2OZOP6A-WeQBYIrCyTPH34JZ7EDFykVmxfsmVIZT4cQ1BtSy54srJUDJnzfZExkkTDSDPByKIvrLTWgqjlaAK2MnlaWI2Ec0WfymSNxE4jFXE4w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150474,\"updated\":1547150474,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/a885b12673b04178b81ea08d00fabbdd?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:15 GMT", - "content-length" : "668", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "6ee3f3c2-0b67-4524-a509-b3bf4f21c555", - "Body" : "{\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/a885b12673b04178b81ea08d00fabbdd\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"xLxIGgi_kDaME6p3N_26SWKbVX3-mQRHiNqfefzj7zAB4owyMTqOfQXUvHoOYhcWCG_cCEj9kTQXAF-ZT7SyQVyqcT_rUvBoiIywqx3si2G8KQ3bin8gNFfJuxXepmjWMpA6rrMFWYn5ly5mYjLtJc-itdoAITPVFHnIzHHcMKKiB3wh-rOQjZqKHO1Dkp5IK_v8SXOQ4FpNTNxoQKvxM3iaWcWS0w5-Bui8HEn2OZOP6A-WeQBYIrCyTPH34JZ7EDFykVmxfsmVIZT4cQ1BtSy54srJUDJnzfZExkkTDSDPByKIvrLTWgqjlaAK2MnlaWI2Ec0WfymSNxE4jFXE4w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150474,\"updated\":1547150474,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:15 GMT", - "content-length" : "811", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "42b5f8d6-2c4d-4214-88f0-e6335288b8ef", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1547150475,\"scheduledPurgeDate\":1554926475,\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/a885b12673b04178b81ea08d00fabbdd\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"xLxIGgi_kDaME6p3N_26SWKbVX3-mQRHiNqfefzj7zAB4owyMTqOfQXUvHoOYhcWCG_cCEj9kTQXAF-ZT7SyQVyqcT_rUvBoiIywqx3si2G8KQ3bin8gNFfJuxXepmjWMpA6rrMFWYn5ly5mYjLtJc-itdoAITPVFHnIzHHcMKKiB3wh-rOQjZqKHO1Dkp5IK_v8SXOQ4FpNTNxoQKvxM3iaWcWS0w5-Bui8HEn2OZOP6A-WeQBYIrCyTPH34JZ7EDFykVmxfsmVIZT4cQ1BtSy54srJUDJnzfZExkkTDSDPByKIvrLTWgqjlaAK2MnlaWI2Ec0WfymSNxE4jFXE4w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150474,\"updated\":1547150474,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:15 GMT", - "content-length" : "85", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "8d390cdc-4b97-4f38-93c5-eb0bde7069a8", - "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: JavaExtensionKey1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:25 GMT", - "content-length" : "811", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "0a1c23f6-2405-4d50-823e-dfa3287128db", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1547150475,\"scheduledPurgeDate\":1554926475,\"key\":{\"kid\":\"https://azure-keyvault-3.vault.azure.net/keys/JavaExtensionKey1/a885b12673b04178b81ea08d00fabbdd\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"xLxIGgi_kDaME6p3N_26SWKbVX3-mQRHiNqfefzj7zAB4owyMTqOfQXUvHoOYhcWCG_cCEj9kTQXAF-ZT7SyQVyqcT_rUvBoiIywqx3si2G8KQ3bin8gNFfJuxXepmjWMpA6rrMFWYn5ly5mYjLtJc-itdoAITPVFHnIzHHcMKKiB3wh-rOQjZqKHO1Dkp5IK_v8SXOQ4FpNTNxoQKvxM3iaWcWS0w5-Bui8HEn2OZOP6A-WeQBYIrCyTPH34JZ7EDFykVmxfsmVIZT4cQ1BtSy54srJUDJnzfZExkkTDSDPByKIvrLTWgqjlaAK2MnlaWI2Ec0WfymSNxE4jFXE4w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1547150474,\"updated\":1547150474,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:26 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "6ead49d4-5c80-4e3f-af1b-5193068292c4", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret128Base64KeyVaultKeyResolverBCProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret128Base64KeyVaultKeyResolverBCProviderTest.json deleted file mode 100644 index 7763f1cf3ed6..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret128Base64KeyVaultKeyResolverBCProviderTest.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:21 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "c626a696-f380-4a2b-88cd-08640c917e40", - "Body" : "" - } - }, { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:21 GMT", - "content-length" : "297", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "d02750c1-f70d-4a5e-99a4-d73e1e78f0f8", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/e0b9414ee6b94be5a52516ab720d1f8e\",\"attributes\":{\"enabled\":true,\"created\":1547150302,\"updated\":1547150302,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:22 GMT", - "content-length" : "297", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "73f3596b-a745-44f5-a8f1-81b378649518", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/e0b9414ee6b94be5a52516ab720d1f8e\",\"attributes\":{\"enabled\":true,\"created\":1547150302,\"updated\":1547150302,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/e0b9414ee6b94be5a52516ab720d1f8e?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:22 GMT", - "content-length" : "297", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "bdc0ed8d-4415-4e53-a8cb-2c3b8ff4d959", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/e0b9414ee6b94be5a52516ab720d1f8e\",\"attributes\":{\"enabled\":true,\"created\":1547150302,\"updated\":1547150302,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:22 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "a90c7b6c-3574-4dae-9f6f-1526e93aa842", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1547150303,\"scheduledPurgeDate\":1554926303,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/e0b9414ee6b94be5a52516ab720d1f8e\",\"attributes\":{\"enabled\":true,\"created\":1547150302,\"updated\":1547150302,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:23 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "3148c4bb-7aa4-4288-b0c2-efcbe7b476e0", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:34 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "107c235d-597c-4759-913f-f6320a77db84", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:44 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "9c64c5e8-2f8a-4c4c-ab55-d78d7deddce0", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1547150303,\"scheduledPurgeDate\":1554926303,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/e0b9414ee6b94be5a52516ab720d1f8e\",\"attributes\":{\"enabled\":true,\"created\":1547150302,\"updated\":1547150302,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:44 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1f734e1d-2555-4550-8802-0a24c9dddb8e", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret128Base64KeyVaultKeyResolverDefaultProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret128Base64KeyVaultKeyResolverDefaultProviderTest.json deleted file mode 100644 index eadfe9c1a824..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret128Base64KeyVaultKeyResolverDefaultProviderTest.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:27 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "4a28e018-6f99-4a62-805d-7b720a396bec", - "Body" : "" - } - }, { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:28 GMT", - "content-length" : "297", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "f6c41d9e-a683-41bd-8ec3-e23cdf338bd2", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/7901c768da48439a84a68f53e2e5c028\",\"attributes\":{\"enabled\":true,\"created\":1547150429,\"updated\":1547150429,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:28 GMT", - "content-length" : "297", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "cce32591-55b4-4c26-8c88-a1cba9dad219", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/7901c768da48439a84a68f53e2e5c028\",\"attributes\":{\"enabled\":true,\"created\":1547150429,\"updated\":1547150429,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/7901c768da48439a84a68f53e2e5c028?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:28 GMT", - "content-length" : "297", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "b1524a94-1d06-4f2f-ae36-4135fd58c473", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/7901c768da48439a84a68f53e2e5c028\",\"attributes\":{\"enabled\":true,\"created\":1547150429,\"updated\":1547150429,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:28 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "64e48715-aa07-4539-a67b-62c5f84965cb", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1547150429,\"scheduledPurgeDate\":1554926429,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/7901c768da48439a84a68f53e2e5c028\",\"attributes\":{\"enabled\":true,\"created\":1547150429,\"updated\":1547150429,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:29 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "7b5b6438-af72-4cb3-8281-418a70210c88", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret2\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:40 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1ee4a0a3-08c6-441d-8b38-ee676a3cb854", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret2\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:50 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "6bcaa8cc-f083-4f07-bd4a-3ba4d517282c", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1547150429,\"scheduledPurgeDate\":1554926429,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/7901c768da48439a84a68f53e2e5c028\",\"attributes\":{\"enabled\":true,\"created\":1547150429,\"updated\":1547150429,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:50 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "b2cbcce0-00cc-4c02-a17f-0d32fa28a50a", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret192Base64KeyVaultKeyResolverBCProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret192Base64KeyVaultKeyResolverBCProviderTest.json deleted file mode 100644 index 32787e41e1ea..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret192Base64KeyVaultKeyResolverBCProviderTest.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:42 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "24567de2-83f7-4735-b655-30480fbbd41e", - "Body" : "" - } - }, { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:42 GMT", - "content-length" : "307", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "89abcae5-7584-4fcd-9881-9101ca98a882", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/3749478e538c41d083e74e5eb1473257\",\"attributes\":{\"enabled\":true,\"created\":1547150382,\"updated\":1547150382,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:43 GMT", - "content-length" : "307", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "8a0306fe-919e-49b4-90dc-cf8404280931", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/3749478e538c41d083e74e5eb1473257\",\"attributes\":{\"enabled\":true,\"created\":1547150382,\"updated\":1547150382,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/3749478e538c41d083e74e5eb1473257?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:43 GMT", - "content-length" : "307", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "a7429165-7960-4579-babd-26e594451fe3", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/3749478e538c41d083e74e5eb1473257\",\"attributes\":{\"enabled\":true,\"created\":1547150382,\"updated\":1547150382,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:43 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "6f227089-2201-4113-aec5-90867971ff52", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1547150383,\"scheduledPurgeDate\":1554926383,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/3749478e538c41d083e74e5eb1473257\",\"attributes\":{\"enabled\":true,\"created\":1547150382,\"updated\":1547150382,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:44 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "2dbbff82-2e7a-429f-b5aa-3d118c3c8e66", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret2\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:54 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "2ff97d94-fa94-4e10-919d-9abb8baaf9fc", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret2\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:04 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "d0baabdf-7584-4916-91d0-c2816a8aacf4", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1547150383,\"scheduledPurgeDate\":1554926383,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret2/3749478e538c41d083e74e5eb1473257\",\"attributes\":{\"enabled\":true,\"created\":1547150382,\"updated\":1547150382,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:04 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1a42d678-6131-4a23-b70f-a5ddfc27a7dc", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret192Base64KeyVaultKeyResolverDefaultProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret192Base64KeyVaultKeyResolverDefaultProviderTest.json deleted file mode 100644 index ca8dada5d496..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret192Base64KeyVaultKeyResolverDefaultProviderTest.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:05 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1df21e6f-d793-4b19-9e55-bdc9117a4554", - "Body" : "" - } - }, { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:05 GMT", - "content-length" : "307", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "cd2925a3-f298-4cf0-8008-2279ba69d37b", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/d784b6be36044895b918ae64a6be5ded\",\"attributes\":{\"enabled\":true,\"created\":1547150406,\"updated\":1547150406,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:06 GMT", - "content-length" : "307", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "343b4488-618a-47f0-a05a-153b4b9588b6", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/d784b6be36044895b918ae64a6be5ded\",\"attributes\":{\"enabled\":true,\"created\":1547150406,\"updated\":1547150406,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/d784b6be36044895b918ae64a6be5ded?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:06 GMT", - "content-length" : "307", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1a986902-a486-4dd1-b08b-15e22d7158b0", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/d784b6be36044895b918ae64a6be5ded\",\"attributes\":{\"enabled\":true,\"created\":1547150406,\"updated\":1547150406,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:06 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "623be169-106a-48ee-b199-42488a7283be", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret4\",\"deletedDate\":1547150407,\"scheduledPurgeDate\":1554926407,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/d784b6be36044895b918ae64a6be5ded\",\"attributes\":{\"enabled\":true,\"created\":1547150406,\"updated\":1547150406,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:06 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "4ae20389-030a-4997-84f1-82eb67189c5d", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret4\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:16 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1a2aa860-0ffc-4587-a1b6-d2abc60643bf", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret4\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:27 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "5538180c-9f18-4036-82dd-ea6a0ddf8d81", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret4\",\"deletedDate\":1547150407,\"scheduledPurgeDate\":1554926407,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret4/d784b6be36044895b918ae64a6be5ded\",\"attributes\":{\"enabled\":true,\"created\":1547150406,\"updated\":1547150406,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret4?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:28 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "a395d98d-dcd9-4194-934a-fe55229fca15", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret256Base64KeyVaultKeyResolverBCProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret256Base64KeyVaultKeyResolverBCProviderTest.json deleted file mode 100644 index cd1b232de0ab..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret256Base64KeyVaultKeyResolverBCProviderTest.json +++ /dev/null @@ -1,272 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:45 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "0094806c-cd0a-44fb-bb76-990cbdf6c847", - "Body" : "" - } - }, { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:45 GMT", - "content-length" : "318", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "1d224a31-9e80-45ee-a867-8ac901a0569f", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/fdbccb1f9bc74804a1ded13270332875\",\"attributes\":{\"enabled\":true,\"created\":1547150325,\"updated\":1547150325,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:45 GMT", - "content-length" : "318", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "81c4c64b-b05e-40c1-af97-775f575ef7f0", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/fdbccb1f9bc74804a1ded13270332875\",\"attributes\":{\"enabled\":true,\"created\":1547150325,\"updated\":1547150325,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/fdbccb1f9bc74804a1ded13270332875?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:45 GMT", - "content-length" : "318", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "cbf88aa7-0771-44d2-8f7b-5c7283b9651c", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/fdbccb1f9bc74804a1ded13270332875\",\"attributes\":{\"enabled\":true,\"created\":1547150325,\"updated\":1547150325,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:46 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "a0bbe15c-f0b2-4e50-8668-5cc83cff7023", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3\",\"deletedDate\":1547150326,\"scheduledPurgeDate\":1554926326,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/fdbccb1f9bc74804a1ded13270332875\",\"attributes\":{\"enabled\":true,\"created\":1547150325,\"updated\":1547150325,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:46 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "cff1fd71-385a-4b3a-a7b4-2746843ef869", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret3\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:58:57 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "2eb9f0c1-2f4a-41dc-8fb2-b59b5ba6b5a4", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret3\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:07 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "2a1eb189-584d-4f11-8ec3-d0ea73c05f9e", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret3\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:18 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "ee1a54bd-f199-4c32-bfe9-487e5fefd18b", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3\",\"deletedDate\":1547150326,\"scheduledPurgeDate\":1554926326,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret3/fdbccb1f9bc74804a1ded13270332875\",\"attributes\":{\"enabled\":true,\"created\":1547150325,\"updated\":1547150325,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 19:59:18 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "2be72338-9165-49bc-aa43-9d681493f1ba", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret256Base64KeyVaultKeyResolverDefaultProviderTest.json b/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret256Base64KeyVaultKeyResolverDefaultProviderTest.json deleted file mode 100644 index b4465af60563..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-extensions/src/test/resources/session-records/secret256Base64KeyVaultKeyResolverDefaultProviderTest.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:50 GMT", - "content-length" : "0", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", - "retry-after" : "0", - "StatusCode" : "401", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "61dc2e64-c06c-42b2-b860-a2759cec4574", - "Body" : "" - } - }, { - "Method" : "PUT", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:51 GMT", - "content-length" : "318", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "d0655b38-6266-429e-9ccf-a06cd23a868e", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/ca70a527ac8343b7aa072199df4bd0b0\",\"attributes\":{\"enabled\":true,\"created\":1547150451,\"updated\":1547150451,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:51 GMT", - "content-length" : "318", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "8792d2e0-b9f8-4720-b957-a177e277dc51", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/ca70a527ac8343b7aa072199df4bd0b0\",\"attributes\":{\"enabled\":true,\"created\":1547150451,\"updated\":1547150451,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/ca70a527ac8343b7aa072199df4bd0b0?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:51 GMT", - "content-length" : "318", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "977a4075-b6ef-4927-916f-ea0a0d3b5251", - "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/ca70a527ac8343b7aa072199df4bd0b0\",\"attributes\":{\"enabled\":true,\"created\":1547150451,\"updated\":1547150451,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:51 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "5ccf5eb6-e37b-4cc9-8f8d-57053557792a", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1547150452,\"scheduledPurgeDate\":1554926452,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/ca70a527ac8343b7aa072199df4bd0b0\",\"attributes\":{\"enabled\":true,\"created\":1547150451,\"updated\":1547150451,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:00:53 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "0365c882-c010-420d-9e03-e28483300844", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:03 GMT", - "content-length" : "94", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "404", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "4f1c25ef-339c-4d53-84de-77429995fa20", - "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" - } - }, { - "Method" : "GET", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:13 GMT", - "content-length" : "413", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "200", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "content-type" : "application/json; charset=utf-8", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "ec8c4229-cc5d-42c0-908d-b2fb04c4c8af", - "Body" : "{\"recoveryId\":\"https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1547150452,\"scheduledPurgeDate\":1554926452,\"contentType\":\"application/octet-stream\",\"id\":\"https://azure-keyvault-3.vault.azure.net/secrets/JavaExtensionSecret1/ca70a527ac8343b7aa072199df4bd0b0\",\"attributes\":{\"enabled\":true,\"created\":1547150451,\"updated\":1547150451,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azure-keyvault-3.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", - "Headers" : { - "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e17e79495730aacb146cd2196f12d68b3ba7dc2cad3e3f710ef4ea0fdba6280 Java:11.0.1 (KeyVaultClientBase, 7.0)", - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "date" : "Thu, 10 Jan 2019 20:01:13 GMT", - "server" : "Microsoft-IIS/10.0", - "expires" : "-1", - "x-aspnet-version" : "4.0.30319", - "retry-after" : "0", - "StatusCode" : "204", - "pragma" : "no-cache", - "strict-transport-security" : "max-age=31536000;includeSubDomains", - "x-content-type-options" : "nosniff", - "x-powered-by" : "ASP.NET", - "x-ms-keyvault-network-info" : "addr=167.220.24.139;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region" : "westus2", - "cache-control" : "no-cache", - "x-ms-keyvault-service-version" : "1.1.0.859", - "x-ms-request-id" : "51325014-48db-4263-911f-ac8799cea53c", - "Body" : "" - } - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/keyvault/microsoft-azure-keyvault-test/pom.xml b/sdk/keyvault/microsoft-azure-keyvault-test/pom.xml deleted file mode 100644 index c004391a91ec..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-test/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - 4.0.0 - - com.azure - azure-data-sdk-parent - 1.3.0 - ../../parents/azure-data-sdk-parent - - - com.microsoft.azure - azure-keyvault-test - 1.2.6 - azure-keyvault-test - - This library has been replaced by new Azure SDKs, you can read about them at https://aka.ms/azsdkvalueprop. The latest libraries to interact with the Azure Key Vault service are: - (1) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-keys. - (2) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-secrets. - (3) https://central.sonatype.com/artifact/com.azure/azure-security-keyvault-certificates. - It is recommended that you move to the new package. - - https://github.com/Azure/azure-sdk-for-java - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - https://github.com/Azure/azure-sdk-for-java - - - UTF-8 - playback - - - - - junit - junit - 4.13.2 - test - - - com.microsoft.azure - azure-mgmt-storage - 1.3.0 - test - - - com.microsoft.azure - azure-mgmt-graph-rbac - 1.3.0 - test - - - com.microsoft.azure - azure-mgmt-resources - 1.3.0 - test - - - com.microsoft.azure - azure-mgmt-keyvault - 1.11.1 - test - - - com.microsoft.azure - azure-mgmt-resources - 1.3.1-SNAPSHOT - test-jar - test - - - com.microsoft.azure - adal4j - 1.6.5 - test - - - com.microsoft.azure - azure-storage - 4.4.0 - test - - - diff --git a/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java b/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java deleted file mode 100644 index b96b62d4a7ec..000000000000 --- a/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.azure.keyvault.test; - -import static org.junit.Assert.*; - -import java.io.IOException; -import java.math.BigInteger; -import java.security.KeyFactory; -import java.security.KeyPair; -import java.security.MessageDigest; -import java.security.spec.KeySpec; -import java.security.spec.RSAPrivateCrtKeySpec; -import java.security.spec.RSAPublicKeySpec; -import java.util.Arrays; -import java.util.Random; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestName; - -import com.microsoft.aad.adal4j.AuthenticationContext; -import com.microsoft.aad.adal4j.AuthenticationResult; -import com.microsoft.aad.adal4j.ClientCredential; -import com.microsoft.azure.AzureResponseBuilder; -import com.microsoft.azure.keyvault.KeyIdentifier; -import com.microsoft.azure.keyvault.KeyVaultClient; -import com.microsoft.azure.keyvault.authentication.KeyVaultCredentials; -import com.microsoft.azure.keyvault.cryptography.EcKey; -import com.microsoft.azure.keyvault.models.KeyBundle; -import com.microsoft.azure.keyvault.models.KeyOperationResult; -import com.microsoft.azure.keyvault.models.KeyVerifyResult; -import com.microsoft.azure.keyvault.requests.ImportKeyRequest; -import com.microsoft.azure.keyvault.webkey.*; -import com.microsoft.azure.management.resources.core.InterceptorManager; -import com.microsoft.azure.management.resources.core.TestBase; -import com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor; -import com.microsoft.azure.serializer.AzureJacksonAdapter; -import com.microsoft.rest.LogLevel; -import com.microsoft.rest.RestClient; -import com.microsoft.rest.credentials.ServiceClientCredentials; -import com.microsoft.rest.interceptors.LoggingInterceptor; - -public class EcKeyIntegrationTests { - - private static TestBase.TestMode testMode = null; - - protected InterceptorManager interceptorManager = null; - - protected final static String ZERO_SUBSCRIPTION = "00000000-0000-0000-0000-000000000000"; - protected final static String ZERO_TENANT = "00000000-0000-0000-0000-000000000000"; - private static final String PLAYBACK_URI_BASE = "http://localhost:"; - private static final String PLAYBACK_VAULT = "https://test-vault.vault.azure.net"; - - protected static String playbackUri = null; - - static KeyVaultClient keyVaultClient; - - static String VAULT_URI; - - @Rule - public TestName testName = new TestName(); - - @BeforeClass - public static void setUp() throws Exception { - initTestMode(); - initPlaybackUri(); - } - - @Before - public void beforeMethod() throws Exception { - - RestClient restClient; - ServiceClientCredentials credentials = createTestCredentials(); - interceptorManager = InterceptorManager.create(testName.getMethodName(), testMode); - - if (isRecordMode()) { - VAULT_URI = System.getenv("VAULT_URI"); - restClient = new RestClient.Builder().withBaseUrl("https://{vaultBaseUrl}") - .withSerializerAdapter(new AzureJacksonAdapter()) - .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) - .withLogLevel(LogLevel.NONE) - .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) - .withNetworkInterceptor(interceptorManager.initInterceptor()) - .withInterceptor(new ResourceManagerThrottlingInterceptor()).build(); - - interceptorManager.addTextReplacementRule("https://management.azure.com/", playbackUri + "/"); - interceptorManager.addTextReplacementRule("https://graph.windows.net/", playbackUri + "/"); - interceptorManager.addTextReplacementRule(VAULT_URI, PLAYBACK_VAULT); - keyVaultClient = new KeyVaultClient(restClient); - } else { // is Playback Mode - VAULT_URI = PLAYBACK_VAULT; - restClient = new RestClient.Builder().withBaseUrl(playbackUri + "/") - .withSerializerAdapter(new AzureJacksonAdapter()) - .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) - .withLogLevel(LogLevel.NONE) - .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) - .withNetworkInterceptor(interceptorManager.initInterceptor()) - .withInterceptor(new ResourceManagerThrottlingInterceptor()).build(); - keyVaultClient = new KeyVaultClient(restClient); - } - } - - @Test - @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") - public void testSignVerifyIntegrationES256() throws Exception { - validateSignVerifyInterop(importTestKey("itwkk-p256", P256TestKey()), JsonWebKeySignatureAlgorithm.ES256, "SHA-256"); - } - - @Test - @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") - public void testSignVerifyIntegrationES256K() throws Exception { - validateSignVerifyInterop(importTestKey("itwkk-p256k", P256KTestKey()), JsonWebKeySignatureAlgorithm.ES256K, "SHA-256"); - } - - @Test - @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") - public void testSignVerifyIntegrationES384() throws Exception { - validateSignVerifyInterop(importTestKey("itwkk-p384", P384TestKey()), JsonWebKeySignatureAlgorithm.ES384, "SHA-384"); - } - - @Test - @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") - public void testSignVerifyIntegrationES521() throws Exception { - validateSignVerifyInterop(importTestKey("itwkk-p521", P521TestKey()), JsonWebKeySignatureAlgorithm.ES512, "SHA-512"); - } - - private void validateSignVerifyInterop(JsonWebKey jwk, JsonWebKeySignatureAlgorithm algorithm, String digestAlg) - throws Exception { - - EcKey key = EcKey.fromJsonWebKey(jwk, true); - - KeyIdentifier keyId = new KeyIdentifier(jwk.kid()); - - // Test variables - byte[] plainText = new byte[100]; - new Random(0x1234567L).nextBytes(plainText); - MessageDigest md = MessageDigest.getInstance(digestAlg); - md.update(plainText); - byte[] digest = md.digest(); - - // sign with both the client and the service - byte[] clientSig = key.signAsync(digest, algorithm.toString()).get().getLeft(); - byte[] serverSig = keyVaultClient.sign(jwk.kid(), algorithm, digest).result(); - - // verify client signature with service and vice versa - Assert.assertTrue(keyVaultClient.verify(jwk.kid(), algorithm, digest, clientSig).value()); - Assert.assertTrue(key.verifyAsync(digest, serverSig, algorithm.toString()).get()); - - key.close(); - } - - // crv P_256 - // x 11232949079473245496693243696083285102762129989847161609854555188949850883563 - // y 1879583613806065892642092774705384015240844626261169536236224087556053896803 - // d 110376418358044062637363537183067346723507769076789115121629366563620220951085 - private static JsonWebKey P256TestKey() - { - return new JsonWebKey() - .withKty(JsonWebKeyType.EC) - .withKeyOps(Arrays.asList(JsonWebKeyOperation.SIGN, JsonWebKeyOperation.VERIFY)) - .withCrv(JsonWebKeyCurveName.P_256) - .withX(new BigInteger("11232949079473245496693243696083285102762129989847161609854555188949850883563").toByteArray()) - .withY(new BigInteger("1879583613806065892642092774705384015240844626261169536236224087556053896803").toByteArray()) - .withD(new BigInteger("110376418358044062637363537183067346723507769076789115121629366563620220951085").toByteArray()); - } - - - // crv P_256K - // x 112542251246878300879834909875895196605604676102246979012590954738722135052808 - // y 6774601013471644037178985795211162469224640637200491504041212042624768103421 - // d 5788737892080795185076661111780678315827024120706807264074833863296072596641 - private static JsonWebKey P256KTestKey() - { - return new JsonWebKey() - .withKty(JsonWebKeyType.EC) - .withKeyOps(Arrays.asList(JsonWebKeyOperation.SIGN, JsonWebKeyOperation.VERIFY)) - .withCrv(JsonWebKeyCurveName.P_256K) - .withX(new BigInteger("112542251246878300879834909875895196605604676102246979012590954738722135052808").toByteArray()) - .withY(new BigInteger("6774601013471644037178985795211162469224640637200491504041212042624768103421").toByteArray()) - .withD(new BigInteger("5788737892080795185076661111780678315827024120706807264074833863296072596641").toByteArray()); - } - - // crv P_384 - // x 25940251081638606466066580153999823282664621938556856505612612711663486152226861175055792115101185005519603532468591 - // y 38849021239011943917620782277253508239698260816711858953045039688987325246933521190178660888358757011735327467604293 - // d 32295109630567236352165497564914579106522760535338683398753720328854294758072198979189259927479998588892483377447907 - private static JsonWebKey P384TestKey() - { - return new JsonWebKey() - .withKty(JsonWebKeyType.EC) - .withKeyOps(Arrays.asList(JsonWebKeyOperation.SIGN, JsonWebKeyOperation.VERIFY)) - .withCrv(JsonWebKeyCurveName.P_384) - .withX(new BigInteger("25940251081638606466066580153999823282664621938556856505612612711663486152226861175055792115101185005519603532468591").toByteArray()) - .withY(new BigInteger("38849021239011943917620782277253508239698260816711858953045039688987325246933521190178660888358757011735327467604293").toByteArray()) - .withD(new BigInteger("32295109630567236352165497564914579106522760535338683398753720328854294758072198979189259927479998588892483377447907").toByteArray()); - } - - // crv P_521 - // x 6855414495738791694053590132729898471597826721317714885490415738464754554924249115378421758975070989210614663357146557161470466328735789754640064414018012235 - // y 3677272094599002495753508473603911533283562539125734660410262665439216117639982407670262587277222630266240230828668340712916997947964051679058455330395658230 - // d 1119526436113918255892609748222452225184162390267181240143092765692579316239102968513115940220551308699050504250027618944913182129917648549423125636042752861 - private static JsonWebKey P521TestKey() - { - return new JsonWebKey() - .withKty(JsonWebKeyType.EC) - .withKeyOps(Arrays.asList(JsonWebKeyOperation.SIGN, JsonWebKeyOperation.VERIFY)) - .withCrv(JsonWebKeyCurveName.P_521) - .withX(new BigInteger("6855414495738791694053590132729898471597826721317714885490415738464754554924249115378421758975070989210614663357146557161470466328735789754640064414018012235").toByteArray()) - .withY(new BigInteger("3677272094599002495753508473603911533283562539125734660410262665439216117639982407670262587277222630266240230828668340712916997947964051679058455330395658230").toByteArray()) - .withD(new BigInteger("1119526436113918255892609748222452225184162390267181240143092765692579316239102968513115940220551308699050504250027618944913182129917648549423125636042752861").toByteArray()); - } - - private static JsonWebKey importTestKey(String keyName, JsonWebKey jwk) throws Exception { - - KeyBundle keyBundle = keyVaultClient.importKey(VAULT_URI, keyName, jwk); - - return jwk.withKid(keyBundle.key().kid()); - } - - private static AuthenticationResult getAccessToken(String authorization, String resource) throws Exception { - - String clientId = System.getenv("arm.clientid"); - - if (clientId == null) { - throw new Exception("Please inform arm.clientid in the environment settings."); - } - - String clientKey = System.getenv("arm.clientkey"); - String username = System.getenv("arm.username"); - String password = System.getenv("arm.password"); - - AuthenticationResult result = null; - ExecutorService service = null; - try { - service = Executors.newFixedThreadPool(1); - AuthenticationContext context = new AuthenticationContext(authorization, false, service); - - Future future = null; - - if (clientKey != null && password == null) { - ClientCredential credentials = new ClientCredential(clientId, clientKey); - future = context.acquireToken(resource, credentials, null); - } - - if (password != null && clientKey == null) { - future = context.acquireToken(resource, clientId, username, password, null); - } - - if (future == null) { - throw new Exception( - "Missing or ambiguous credentials - please inform exactly one of arm.clientkey or arm.password in the environment settings."); - } - - result = future.get(); - } finally { - service.shutdown(); - } - - if (result == null) { - throw new RuntimeException("authentication result was null"); - } - return result; - } - - private static ServiceClientCredentials createTestCredentials() throws Exception { - return new KeyVaultCredentials() { - - @Override - public String doAuthenticate(String authorization, String resource, String scope) { - try { - if (isRecordMode()) { - AuthenticationResult authResult = getAccessToken(authorization, resource); - return authResult.getAccessToken(); - } else { - return ""; - } - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - }; - } - - @After - public void afterMethod() throws IOException { - interceptorManager.finalizeInterceptor(); - } - - private static void initPlaybackUri() throws IOException { - if (isPlaybackMode()) { - // 11080 and 11081 needs to be in sync with values in jetty.xml file - playbackUri = PLAYBACK_URI_BASE + "11080"; - } else { - playbackUri = PLAYBACK_URI_BASE + "1234"; - } - } - - public static boolean isPlaybackMode() { - if (testMode == null) - try { - initTestMode(); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException("Can't init test mode."); - } - return testMode == TestBase.TestMode.PLAYBACK; - } - - public static boolean isRecordMode() { - return !isPlaybackMode(); - } - - private static void initTestMode() throws IOException { - String azureTestMode = System.getenv("AZURE_TEST_MODE"); - if (azureTestMode != null) { - if (azureTestMode.equalsIgnoreCase("Record")) { - testMode = TestBase.TestMode.RECORD; - } else if (azureTestMode.equalsIgnoreCase("Playback")) { - testMode = TestBase.TestMode.PLAYBACK; - } else { - throw new IOException("Unknown AZURE_TEST_MODE: " + azureTestMode); - } - } else { - // System.out.print("Environment variable 'AZURE_TEST_MODE' has not been set - // yet. Using 'Playback' mode."); - testMode = TestBase.TestMode.PLAYBACK; - } - } - -} diff --git a/sdk/keyvault/pom.xml b/sdk/keyvault/pom.xml index 54d5c9716d9d..49033e1de3ed 100644 --- a/sdk/keyvault/pom.xml +++ b/sdk/keyvault/pom.xml @@ -9,17 +9,12 @@ 1.0.0 - microsoft-azure-keyvault-complete - microsoft-azure-keyvault-core - microsoft-azure-keyvault-extensions - microsoft-azure-keyvault-test - azure-security-test-keyvault-jca - azure-security-keyvault-administration - azure-security-keyvault-certificates - azure-security-keyvault-jca - azure-security-keyvault-keys - azure-security-keyvault-secrets - azure-security-keyvault-perf - - + azure-security-test-keyvault-jca + azure-security-keyvault-administration + azure-security-keyvault-certificates + azure-security-keyvault-jca + azure-security-keyvault-keys + azure-security-keyvault-secrets + azure-security-keyvault-perf + diff --git a/sdk/keyvault/regenerate_and_fix_sdk.py b/sdk/keyvault/regenerate_and_fix_sdk.py deleted file mode 100644 index a27f9324d19c..000000000000 --- a/sdk/keyvault/regenerate_and_fix_sdk.py +++ /dev/null @@ -1,124 +0,0 @@ -import os, sys, subprocess, re -from distutils.dir_util import copy_tree, remove_tree - -# Need python 3.6 for new subprocess API -MIN_PYTHON = (3, 6) -if sys.version_info < MIN_PYTHON: - sys.exit("Python %s.%s or later is required.\n" % MIN_PYTHON) - -# Configuration -verbose = True -autorest_target_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "tmp") -swagger_source_branch = "keyvault_preview" # Source branch in swagger repo to generate from -autorest_tag = "package-7.0-preview" # Autorest tag to use, if any -run_autorest = True # If false, assumes that we just need to repair generated code that is already in tree! -fix_generated_code = True # if false, assumes that we just need to run autorest -source_rest_spec = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/%s/specification/keyvault/data-plane/readme.md" % swagger_source_branch # Builds the URL to Swagger readme from branch -autorest_cmd = "autorest --java %s --azure-libraries-for-java-folder=%s" % (source_rest_spec, autorest_target_dir) - -if autorest_tag is not None: - autorest_cmd += " --tag=%s" % autorest_tag - -# Constant values -CODE_TARGET_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), "azure-keyvault", "src", "main", "java", "com", "microsoft", "azure", "keyvault") -CUSTOM_MODEL_DIR = os.path.join(CODE_TARGET_DIRECTORY, "models", "custom") -WEBKEY_REPLACE_MODELS = ['JsonWebKey', 'JsonWebKeyEncryptionAlgorithm', 'JsonWebKeyOperation', 'JsonWebKeySignatureAlgorithm', 'JsonWebKeyType'] -WEBKEY_NAMESPACE = 'com.microsoft.azure.keyvault.webkey' -CUSTOM_MODEL_NAMESPACE = 'com.microsoft.azure.keyvault.models.custom' -MODEL_NAMESPACE = 'com.microsoft.azure.keyvault.models' -FILES_TO_REMOVE = [ - 'azure-keyvault/models/%s.java' % model for model in WEBKEY_REPLACE_MODELS -] -FILES_TO_REMOVE.append('azure-keyvault/implementation/package-info.java') - -# Method definitions -def move_generated_code(autorest_target_dir, verbose): - # Remove JWK models, since those are in a separate non-generated package for now - print("Removing generated JWK models/package info") - for fn in FILES_TO_REMOVE: - - path = os.path.join(autorest_target_dir, fn) - if os.path.exists(path): - if verbose: - print("Removing %s" % path) - os.remove(path) - - # move (gen_directory)\azure-keyvault\* --> ./azure-keyvault\src\main\java\com\microsoft\azure\keyvault - print("Replacing old generated code") - copy_tree(os.path.join(autorest_target_dir, "azure-keyvault"), CODE_TARGET_DIRECTORY) - - print("Removing temporary generated files") - remove_tree(autorest_target_dir) - print("Done with generation process") - -# Fixes an individual source file -def correct_file(file, verbose): - if not file.endswith(".java"): - return - - with open(file) as f: - code = f.read() - - # Fix webkey models - for model in WEBKEY_REPLACE_MODELS: - code = code.replace("import %s.%s;" % (MODEL_NAMESPACE, model), "import %s.%s;" % (WEBKEY_NAMESPACE, model)) - - # Fix broken javadoc - jdocre = re.compile(r'([a-z|A-Z|0-9]*\<.*?\>)( \* \@param)') - code = jdocre.sub(r'\2', code) - - - classre = re.compile(r'public class ([a-z|A-Z|0-9]*?)[ \n\r\t]*{') - - # If this is a model class and not a custom model class, extend our custom code if necessary - additionally add back potentially removed imports - dir, fn = os.path.split(file) - if os.path.split(dir)[1] == "models": - classes = classre.search(code) - if classes is not None: - classname = classes.group(1) - # check for corresponding custom class - if os.path.exists(os.path.join(CUSTOM_MODEL_DIR, classname + ".java")): - if verbose: - print("Updating generated '%s' to extend custom '%s'" % (classname, classname)) - code = classre.sub(r'public class \1 extends %s.\1 {' % CUSTOM_MODEL_NAMESPACE, code) - - # Add back webkey imports which may have been removed - class_usage_re = re.compile(r'[ \t<](' + '|'.join(WEBKEY_REPLACE_MODELS) + ')[ \t>]') - needed_classes = list(set(class_usage_re.findall(code))) - if len(needed_classes) > 0: - if verbose: - print("Adding webkey imports for %s to %s" % ( ",".join(needed_classes), fn )) - potential_imports = ["import %s.%s;" % (WEBKEY_NAMESPACE, needed) for needed in needed_classes] - imports = [] - - for i in potential_imports: - if i not in code: - imports.append(i) - - if len(imports) > 0: - # find package statement at beginning of code, splice and add the imports in between - package_re = re.compile(r'package (.+?);\n\n') - package = package_re.search(code).group(0) - before, after = code.split(package, 2) - code = before + package + "\n".join(imports) + "\n" + after - - - # Write back to disk - with open(file, 'w') as f: - f.write(code) - - -if run_autorest: - print("Running autorest..") - if verbose: - print(autorest_cmd) - subprocess.run(autorest_cmd, check=True, shell=True) - move_generated_code(autorest_target_dir, verbose) - -if fix_generated_code: - print("Fixing generated code..") - for path, dirs, files in os.walk(CODE_TARGET_DIRECTORY): - if path == CUSTOM_MODEL_DIR: # skip custom code - continue - for file in files: - correct_file(os.path.join(path, file), verbose) \ No newline at end of file