diff --git a/sdk/keyvault/keyvault-common/src/dom.d.ts b/sdk/keyvault/keyvault-common/src/dom.d.ts new file mode 100644 index 000000000000..88bcf1442b2f --- /dev/null +++ b/sdk/keyvault/keyvault-common/src/dom.d.ts @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/// diff --git a/sdk/keyvault/keyvault-common/src/parseWWWAuthenticate.ts b/sdk/keyvault/keyvault-common/src/parseWWWAuthenticate.ts index e330317d6272..cf35c1bb061d 100644 --- a/sdk/keyvault/keyvault-common/src/parseWWWAuthenticate.ts +++ b/sdk/keyvault/keyvault-common/src/parseWWWAuthenticate.ts @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/// /** * @internal * diff --git a/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_can_import_a_key.json b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_can_import_a_key.json index 34ee818116a6..8326414315cc 100644 --- a/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_can_import_a_key.json +++ b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_can_import_a_key.json @@ -1,88 +1,86 @@ { - "recordings": [ - { - "method": "PUT", - "url": "https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-", - "query": { - "api-version": "7.3-preview" - }, - "requestBody": "", - "status": 401, - "response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"Request is missing a Bearer or PoP token.\"}}", - "responseHeaders": { - "cache-control": "no-cache", - "content-length": "87", - "content-type": "application/json; charset=utf-8", - "date": "Wed, 28 Apr 2021 22:11:47 GMT", - "expires": "-1", - "pragma": "no-cache", - "status": "401", - "strict-transport-security": "max-age=31536000;includeSubDomains", - "www-authenticate": "Bearer authorization=\"https://login.windows.net/12345678-1234-1234-1234-123456789012\", resource=\"https://vault.azure.net\"", - "x-content-type-options": "nosniff", - "x-ms-client-request-id": "d6aa7587-c0ef-4fb2-b0d9-45fa9efa72d2", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.68.182.20;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.2.265.0", - "x-ms-request-id": "80b22461-c8d2-4737-8292-31bf0b063f61", - "x-powered-by": "ASP.NET" - } - }, - { - "method": "POST", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fvault.azure.net%2F.default", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1315", - "content-type": "application/json; charset=utf-8", - "date": "Wed, 28 Apr 2021 22:11:48 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11654.16 - EUS ProdSlices", - "x-ms-request-id": "2581370d-525c-449a-8781-7cf3ab5c5401" - } - }, - { - "method": "PUT", - "url": "https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-", - "query": { - "api-version": "7.3-preview" - }, - "requestBody": "{\"key\":{\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAH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Z-a8CD95qsKfn0dOZAvXY-2xhQYTEwbED-0bpTNEKbIpA-ZkaHygmnzJkNbbFAnb9pkkzU8ZQqDP3JNgMfVIroWx58Oth9nJza2j7i-MkPRCUPEq3Ao0J52z7WJIiLji8TTVYW_NaiM1oxzsH\",\"p\":\"ANHerI1o3dLB_VLVmZZVss8VZSYN5SaeQ_0qhfOSgOFwj__waCFmy2EG7l6l6f_Z-Y0L7Mn_LNov68lyWSFa2EuQUeVj4UoFHc5Di8ZUGiSsTwFM-XMtNuv8HmGgDYLL5BIJD3eTz71LdgW-Ez38OZH34b7VeG8zfeUDb8Hi30zz\",\"q\":\"AMPcZrZBqbc82DO8Q5zTT8ZXRGWrW36KktMllaIk1W2RHnRiQiW0jBWmcCgqUcQNHa1LwumjyNqwx28QBS37BTvG7ULGUoio6LrOeoiBGEMj-U19sX6m37plEhj5Mak7j3OPPY_T9rohjTW5aGGg9YSwq4jdz0RrmBX00ofYOjI3\"}}", - "status": 200, - "response": "{\"key\":{\"kid\":\"https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-/c3822ce302324dbf95b0d70f987f496d\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1619647908,\"updated\":1619647908,\"recoveryLevel\":\"CustomizedRecoverable+Purgeable\",\"recoverableDays\":7}}", - "responseHeaders": { - "cache-control": "no-cache", - "content-length": "719", - "content-type": "application/json; charset=utf-8", - "date": "Wed, 28 Apr 2021 22:11:48 GMT", - "expires": "-1", - "pragma": "no-cache", - "status": "200", - "strict-transport-security": "max-age=31536000;includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-client-request-id": "d6aa7587-c0ef-4fb2-b0d9-45fa9efa72d2", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.68.182.20;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.2.265.0", - "x-ms-request-id": "154d7ccf-58f2-407c-b7ac-d71934a79287", - "x-powered-by": "ASP.NET" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} + "recordings": [ + { + "method": "PUT", + "url": "https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "", + "status": 401, + "response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"AKV10000: Request is missing a Bearer or PoP token.\"}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "97", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:45 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "www-authenticate": "Bearer authorization=\"https://login.windows.net/12345678-1234-1234-1234-123456789012\", resource=\"https://vault.azure.net\"", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "c85ab439-5f77-4dfb-9d39-762856522e65", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.150.1", + "x-ms-request-id": "567f23e7-fcec-4124-b9f3-90c5d9a60787", + "x-powered-by": "ASP.NET" + } }, - "hash": "80f1d585a0f4590c035a1ac6fb18bd6b" -} + { + "method": "POST", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", + "status": 200, + "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", + "responseHeaders": { + "cache-control": "no-store, no-cache", + "content-length": "1315", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:45 GMT", + "expires": "-1", + "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", + "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", + "pragma": "no-cache", + "referrer-policy": "strict-origin-when-cross-origin", + "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-ests-server": "2.1.12158.6 - WUS2 ProdSlices", + "x-ms-request-id": "e9846899-834f-48db-bbc3-f3ccffc5fc00" + } + }, + { + "method": "PUT", + "url": "https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "{\"key\":{\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj17rUFN0f9GZMZ0pqEQNCPRBLVJ_-TEe2nGCWSC0exxGsRqz6R1zFkB-icfzQPe4WjQELOUXQ7J9RxhAPTT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_VLVmZZVss8VZSYN5SaeQ_0qhfOSgOFwj__waCFmy2EG7l6l6f_Z-Y0L7Mn_LNov68lyWSFa2EuQUeVj4UoFHc5Di8ZUGiSsTwFM-XMtNuv8HmGgDYLL5BIJD3eTz71LdgW-Ez38OZH34b7VeG8zfeUDb8Hi30zz\",\"q\":\"AMPcZrZBqbc82DO8Q5zTT8ZXRGWrW36KktMllaIk1W2RHnRiQiW0jBWmcCgqUcQNHa1LwumjyNqwx28QBS37BTvG7ULGUoio6LrOeoiBGEMj-U19sX6m37plEhj5Mak7j3OPPY_T9rohjTW5aGGg9YSwq4jdz0RrmBX00ofYOjI3\"}}", + "status": 200, + "response": "{\"key\":{\"kid\":\"https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-/15cfce70301b43588fee9f9be2135174\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1634773546,\"updated\":1634773546,\"recoveryLevel\":\"CustomizedRecoverable+Purgeable\",\"recoverableDays\":7}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "724", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:45 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "c85ab439-5f77-4dfb-9d39-762856522e65", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.150.1", + "x-ms-request-id": "9af049ec-7567-46d6-9625-7fd1abdf769a", + "x-powered-by": "ASP.NET" + } + } + ], + "uniqueTestInfo": { + "uniqueName": {}, + "newDate": {} + }, + "hash": "637db5b7f3d6dc59b0d58f5b506e834a" +} \ No newline at end of file diff --git a/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_prefers_key_ops_over_keyops_when_both_are_provided.json b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_prefers_key_ops_over_keyops_when_both_are_provided.json new file mode 100644 index 000000000000..c934ee48f94a --- /dev/null +++ b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_prefers_key_ops_over_keyops_when_both_are_provided.json @@ -0,0 +1,88 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://keyvault_name.vault.azure.net/keys/keyops163477354760709525", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "", + "status": 401, + "response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"AKV10000: Request is missing a Bearer or PoP token.\"}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "97", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:45 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "www-authenticate": "Bearer authorization=\"https://login.windows.net/12345678-1234-1234-1234-123456789012\", resource=\"https://vault.azure.net\"", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "cadc9ba1-8ece-43f8-ab96-b6a55f96c1f9", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.150.1", + "x-ms-request-id": "f422f139-0198-4bfc-aa8e-cbe38362c94e", + "x-powered-by": "ASP.NET" + } + }, + { + "method": "POST", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", + "status": 200, + "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", + "responseHeaders": { + "cache-control": "no-store, no-cache", + "content-length": "1315", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:45 GMT", + "expires": "-1", + "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", + "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", + "pragma": "no-cache", + "referrer-policy": "strict-origin-when-cross-origin", + "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-ests-server": "2.1.12158.6 - NCUS ProdSlices", + "x-ms-request-id": "c809bd05-f1db-4e90-bb48-60414f170601" + } + }, + { + "method": "PUT", + "url": "https://keyvault_name.vault.azure.net/keys/keyops163477354760709525", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "{\"key\":{\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj17rUFN0f9GZMZ0pqEQNCPRBLVJ_-T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Ao0J52z7WJIiLji8TTVYW_NaiM1oxzsH\",\"p\":\"ANHerI1o3dLB_VLVmZZVss8VZSYN5SaeQ_0qhfOSgOFwj__waCFmy2EG7l6l6f_Z-Y0L7Mn_LNov68lyWSFa2EuQUeVj4UoFHc5Di8ZUGiSsTwFM-XMtNuv8HmGgDYLL5BIJD3eTz71LdgW-Ez38OZH34b7VeG8zfeUDb8Hi30zz\",\"q\":\"AMPcZrZBqbc82DO8Q5zTT8ZXRGWrW36KktMllaIk1W2RHnRiQiW0jBWmcCgqUcQNHa1LwumjyNqwx28QBS37BTvG7ULGUoio6LrOeoiBGEMj-U19sX6m37plEhj5Mak7j3OPPY_T9rohjTW5aGGg9YSwq4jdz0RrmBX00ofYOjI3\"}}", + "status": 200, + "response": "{\"key\":{\"kid\":\"https://keyvault_name.vault.azure.net/keys/keyops163477354760709525/c36b0c7960fd4869b7301f0834d3e797\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1634773546,\"updated\":1634773546,\"recoveryLevel\":\"CustomizedRecoverable+Purgeable\",\"recoverableDays\":7}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "666", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:46 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "cadc9ba1-8ece-43f8-ab96-b6a55f96c1f9", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.150.1", + "x-ms-request-id": "51d96fb1-5a8e-4e64-9fb0-bdc72619b621", + "x-powered-by": "ASP.NET" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "keyops": "keyops163477354760709525" + }, + "newDate": {} + }, + "hash": "d6a1858eafb61dd687039180af4f3a59" +} \ No newline at end of file diff --git a/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_uses_keyops_when_key_ops_is_not_provided.json b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_uses_keyops_when_key_ops_is_not_provided.json new file mode 100644 index 000000000000..8e9b9a5f8c5f --- /dev/null +++ b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__import_keys/recording_uses_keyops_when_key_ops_is_not_provided.json @@ -0,0 +1,88 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://keyvault_name.vault.azure.net/keys/keyops163477354863308202", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "", + "status": 401, + "response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"AKV10000: Request is missing a Bearer or PoP token.\"}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "97", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:46 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "www-authenticate": "Bearer authorization=\"https://login.windows.net/12345678-1234-1234-1234-123456789012\", resource=\"https://vault.azure.net\"", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "81e48429-bc30-4479-82f6-3403e274df6e", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.150.1", + "x-ms-request-id": "b841ff51-5ed9-4598-8b24-2d1f1001589c", + "x-powered-by": "ASP.NET" + } + }, + { + "method": "POST", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", + "status": 200, + "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", + "responseHeaders": { + "cache-control": "no-store, no-cache", + "content-length": "1315", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:46 GMT", + "expires": "-1", + "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", + "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", + "pragma": "no-cache", + "referrer-policy": "strict-origin-when-cross-origin", + "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-ests-server": "2.1.12158.6 - EUS ProdSlices", + "x-ms-request-id": "64be5a7c-e0d0-457d-abf9-c16a53345f00" + } + }, + { + "method": "PUT", + "url": "https://keyvault_name.vault.azure.net/keys/keyops163477354863308202", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "{\"key\":{\"kty\":\"RSA\",\"key_ops\":[\"sign\",\"verify\"],\"n\":\"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj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MfVIroWx58Oth9nJza2j7i-MkPRCUPEq3Ao0J52z7WJIiLji8TTVYW_NaiM1oxzsH\",\"p\":\"ANHerI1o3dLB_VLVmZZVss8VZSYN5SaeQ_0qhfOSgOFwj__waCFmy2EG7l6l6f_Z-Y0L7Mn_LNov68lyWSFa2EuQUeVj4UoFHc5Di8ZUGiSsTwFM-XMtNuv8HmGgDYLL5BIJD3eTz71LdgW-Ez38OZH34b7VeG8zfeUDb8Hi30zz\",\"q\":\"AMPcZrZBqbc82DO8Q5zTT8ZXRGWrW36KktMllaIk1W2RHnRiQiW0jBWmcCgqUcQNHa1LwumjyNqwx28QBS37BTvG7ULGUoio6LrOeoiBGEMj-U19sX6m37plEhj5Mak7j3OPPY_T9rohjTW5aGGg9YSwq4jdz0RrmBX00ofYOjI3\"}}", + "status": 200, + "response": "{\"key\":{\"kid\":\"https://keyvault_name.vault.azure.net/keys/keyops163477354863308202/6a8f2912935848cb90a17de01a8662ab\",\"kty\":\"RSA\",\"key_ops\":[\"sign\",\"verify\"],\"n\":\"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1634773547,\"updated\":1634773547,\"recoveryLevel\":\"CustomizedRecoverable+Purgeable\",\"recoverableDays\":7}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "662", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 20 Oct 2021 23:45:47 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "81e48429-bc30-4479-82f6-3403e274df6e", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.150.1", + "x-ms-request-id": "6b08105a-4eb6-432e-aa72-7d5c069a2ba2", + "x-powered-by": "ASP.NET" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "keyops": "keyops163477354863308202" + }, + "newDate": {} + }, + "hash": "a5ed6a22fa4f282f4fe9273d7101196f" +} \ No newline at end of file diff --git a/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_can_import_a_key.js b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_can_import_a_key.js index 8f8fa6abf5b9..a7a8ab67888c 100644 --- a/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_can_import_a_key.js +++ b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_can_import_a_key.js @@ -1,19 +1,19 @@ let nock = require('nock'); -module.exports.hash = "752b83a6a49a7f25f825dc706cf1e6c8"; +module.exports.hash = "ebc071b7c5c53eaa226cf5b96f653afc"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) .put('/keys/importKeyName-canimportakey-') .query(true) - .reply(401, {"error":{"code":"Unauthorized","message":"Request is missing a Bearer or PoP token."}}, [ + .reply(401, {"error":{"code":"Unauthorized","message":"AKV10000: Request is missing a Bearer or PoP token."}}, [ 'Cache-Control', 'no-cache', 'Pragma', 'no-cache', 'Content-Length', - '87', + '97', 'Content-Type', 'application/json; charset=utf-8', 'Expires', @@ -23,13 +23,13 @@ nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) 'x-ms-keyvault-region', 'westus2', 'x-ms-client-request-id', - '8745ade7-8f59-4ed7-92d3-0a24aaaccacb', + '2f3ffcc2-445b-477b-afd4-70608436f5d4', 'x-ms-request-id', - 'c2e0ea4f-4e15-44d3-a6c9-c34d715111cb', + 'c026c88b-7bbc-4399-b2db-bab617fcc894', 'x-ms-keyvault-service-version', - '1.2.265.0', + '1.9.150.1', 'x-ms-keyvault-network-info', - 'conn_type=Ipv4;addr=72.68.182.20;act_addr_fam=InterNetwork;', + 'conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;', 'X-Powered-By', 'ASP.NET', 'Strict-Transport-Security', @@ -37,7 +37,7 @@ nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) 'X-Content-Type-Options', 'nosniff', 'Date', - 'Wed, 28 Apr 2021 21:30:38 GMT' + 'Wed, 20 Oct 2021 23:45:38 GMT' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) @@ -59,26 +59,26 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'cda09be2-d28c-47e1-810b-8e9e3b2ab401', + '92d31b54-6fb5-4b5f-a07a-51effa9c4900', 'x-ms-ests-server', - '2.1.11654.16 - EUS ProdSlices', + '2.1.12158.6 - NCUS ProdSlices', 'Set-Cookie', - 'fpc=Au5BirxN9hhJvoEMGUBOFo6nSoKIAwAAABvKG9gOAAAA4BL6Uw8AAAAjyhvYDgAAAA; expires=Fri, 28-May-2021 21:30:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AiOFNFgO9TpGliWFMa0cHeg; expires=Fri, 19-Nov-2021 23:45:39 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrEtMGMnKUBqY88iIh0tvP3Vono4WX6eE7fvElp3y7W3_QWJ_0l8WrUvSt5lZchHC9Zv26bPgOfB59DyH_ZejORDKLJKwsHGGOYCAulzOvLjqhe2GTK9v1N1T3wv_gnDbU-0GgQk3yWyF6898Th9r6jx9Ynx61VShQXQwjD-KEpCAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrRdi_s3pMxDetheclGHOTS2bhjDA3OAmCNKXKLog3tVquNwM8wCmxcb5ufS93HIfEB_N2DRzU5eRsdjSs9dWLR_TU8_1vvfj2a1Hm0kRvAu1oZY51XL3Q38tl6yuC7x_uBszUL1ZcnCs0vJ0mV2-WpQwg24pGfmbZM4fBU0pH5y4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 28 Apr 2021 21:30:38 GMT', + 'Wed, 20 Oct 2021 23:45:39 GMT', 'Content-Length', '980' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ 'Cache-Control', 'max-age=86400, private', 'Content-Type', @@ -94,35 +94,30 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '90904e39-7df4-4f2e-ae2b-9e71fadb6501', + 'f9780d4c-76d7-4442-abf4-7155da661501', 'x-ms-ests-server', - '2.1.11654.16 - EUS ProdSlices', + '2.1.12158.6 - SCUS ProdSlices', 'Set-Cookie', - 'fpc=Au5BirxN9hhJvoEMGUBOFo6nSoKIAwAAABvKG9gOAAAA4BL6Uw8AAAAjyhvYDgAAAA; expires=Fri, 28-May-2021 21:30:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AhZypJ-NsFlOhUkARnjRsvs; expires=Fri, 19-Nov-2021 23:45:39 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrQLtoAyLPJ3fEpdWYGN3sDGYKeSESpGFhwY1lG2pcQ0Q8RD9nxIabQJGUACnXmZmv7ukHBhsOlM1WoPaDaNjTfI-RhNLO5UbnpCKaAqexp0hjl6CMdY3V1h4hzQPZ9IXmjrK9H4rk-P-jmIdludXdEjyNT-SAQLkIPP8OUzY_6VsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrhvowBBOU0uXjtn2jICObCcOVjrjVFHmLGvQJDJ_bdAMZ0OXpdWf4iHsqPSaxTOzVy3r_EvFTmdyGxwk7kmoC0Hl2EbqKy4i3fnTYBCS4kE8YbP-J3TcZ8AmUSL0pjS5Gop9d6rg-PJrIJz0KCj3QxmmXvEH0dwO8TD5_jVnIRv4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 28 Apr 2021 21:30:38 GMT', + 'Wed, 20 Oct 2021 23:45:39 GMT', 'Content-Length', - '1651' + '1753' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .filteringRequestBody(function (body) { - return body.replace(/client-request-id=[^&]*/g, "client-request-id=client-request-id"); - }) - .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fvault.azure.net%2F.default%20openid%20profile%20offline_access&grant_type=client_credentials&client-request-id=client-request-id&client_secret=azure_client_secret") + .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=5cdab3d2-d598-4a4a-9da9-a8145ea632c9&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', 'Pragma', 'no-cache', - 'Content-Length', - '1315', 'Content-Type', 'application/json; charset=utf-8', 'Expires', @@ -134,25 +129,27 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '67cf752f-861c-42a8-9b93-d6600e4f4701', + '131395b4-aa53-4ce7-9c43-d2de6ca10d01', 'x-ms-ests-server', - '2.1.11654.16 - SCUS ProdSlices', + '2.1.12158.6 - EUS ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=Au5BirxN9hhJvoEMGUBOFo6nSoKIAwAAABvKG9gOAAAA4BL6Uw8AAAAjyhvYDgAAAA; expires=Fri, 28-May-2021 21:30:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Av_j-NnRYMpPtObFFDY1NZcW-HEQAQAAACOhAtkOAAAA; expires=Fri, 19-Nov-2021 23:45:39 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 28 Apr 2021 21:30:38 GMT' + 'Wed, 20 Oct 2021 23:45:39 GMT', + 'Content-Length', + '1315' ]); nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) .put('/keys/importKeyName-canimportakey-', {"key":{"kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj17rUFN0f9GZMZ0pqEQNCPRBLVJ_-TEe2nGCWSC0exxGsRqz6R1zFkB-icfzQPe4WjQELOUXQ7J9RxhAPTTHtDivYYG-BeTRHrmF04JT1_6b9T_C8bAC0i0teT-nmlBLarQtBJKATXBx1yegbPOoiTqlQrFQP4MrKWNxtnB9Tcbjcvj-Z9je0ckI_eRc4DvAhqcUh_p15Dqg4GeaoNIO_jU","e":"AQAB","d":"Ynx9JGaBSP4iUsf6ZJ6opantRNdcdmzaQrKbZg6ZQE8Ohi1FYabJWvaoPSE-CiJEsDzShXZHMhUHN4X7Bn8BXaGQhK3p9HXgiwQKmix7oAJTu4ElUIyd8UC3UWHSZr40el4PaQD-HYu_eMzCXus34MnRiNbh_BUWm6T-Eidhk9d3kNIyaSi9YND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"https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-/80aa5b39fa984945bb523cd81e27850c","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ","e":"AQAB"},"attributes":{"enabled":true,"created":1619645439,"updated":1619645439,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7}}, [ + .reply(200, {"key":{"kid":"https://keyvault_name.vault.azure.net/keys/importKeyName-canimportakey-/4995a5d782be43709bbda60a10f15dd2","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ","e":"AQAB"},"attributes":{"enabled":true,"created":1634773539,"updated":1634773539,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7}}, [ 'Cache-Control', 'no-cache', 'Pragma', @@ -164,13 +161,13 @@ nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) 'x-ms-keyvault-region', 'westus2', 'x-ms-client-request-id', - '8745ade7-8f59-4ed7-92d3-0a24aaaccacb', + '2f3ffcc2-445b-477b-afd4-70608436f5d4', 'x-ms-request-id', - '3faf26aa-cdf8-4b9c-aab2-04b91a0cb998', + '8ebbe9ea-e46b-4638-97ff-8e493f03ad05', 'x-ms-keyvault-service-version', - '1.2.265.0', + '1.9.150.1', 'x-ms-keyvault-network-info', - 'conn_type=Ipv4;addr=72.68.182.20;act_addr_fam=InterNetwork;', + 'conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;', 'X-Powered-By', 'ASP.NET', 'Strict-Transport-Security', @@ -178,7 +175,7 @@ nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) 'X-Content-Type-Options', 'nosniff', 'Date', - 'Wed, 28 Apr 2021 21:30:39 GMT', + 'Wed, 20 Oct 2021 23:45:39 GMT', 'Content-Length', - '719' + '726' ]); diff --git a/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_prefers_key_ops_over_keyops_when_both_are_provided.js b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_prefers_key_ops_over_keyops_when_both_are_provided.js new file mode 100644 index 000000000000..a94d82cb7a5d --- /dev/null +++ b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_prefers_key_ops_over_keyops_when_both_are_provided.js @@ -0,0 +1,181 @@ +let nock = require('nock'); + +module.exports.hash = "692bd91b23c6427e3997093a50f81559"; + +module.exports.testInfo = {"uniqueName":{"keyops":"keyops163477354107608629"},"newDate":{}} + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .put('/keys/keyops163477354107608629') + .query(true) + .reply(401, {"error":{"code":"Unauthorized","message":"AKV10000: Request is missing a Bearer or PoP token."}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '97', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'WWW-Authenticate', + 'Bearer authorization="https://login.windows.net/12345678-1234-1234-1234-123456789012", resource="https://vault.azure.net"', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + 'e6e68792-4ee5-4e65-8d48-754d80dc5cf0', + 'x-ms-request-id', + 'd17e6af4-f242-4a49-aabc-251995730c35', + 'x-ms-keyvault-service-version', + '1.9.150.1', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Wed, 20 Oct 2021 23:45:39 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'a12e57a8-34e3-43ea-a4d0-ac9e39424400', + 'x-ms-ests-server', + '2.1.12158.6 - NCUS ProdSlices', + 'Set-Cookie', + 'fpc=AhJ8uPHr_HhIhZi3MtaKraQ; expires=Fri, 19-Nov-2021 23:45:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrmS5OXI42_RLNKCjB8_Zk45ZiRCTUSV878RM7xKojvtWRjbjHlnk6jmPIutIPKkoeZx5vRCNwUiMOJagJ5XvtCxKYFT-HAWKIHV6bNV0AFqzsvow5V1dJ5DqsLo-R63p7dMFKiibml51-xxX9g0tMAF1GGslYs1rIQw71W2nqvXcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Wed, 20 Oct 2021 23:45:39 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0df3c4e2-442a-45a6-ac63-e29f41560301', + 'x-ms-ests-server', + '2.1.12158.6 - NCUS ProdSlices', + 'Set-Cookie', + 'fpc=Ah9JP4iS_qFMkOKmtpu7Cw8; expires=Fri, 19-Nov-2021 23:45:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrPWQWaLddLEQJDmrKDQWIqRvEncZw8mgliF52KFEBVuEQEKiWuF-DsaP0-wEc4oBFhmdzdqvV0MOK25xGGWeQ5f_4qSttyr3R0vLzOnmLNcThFbVs5iyVhrBuXCdxwKBn_ZAHnBCO-4WYfGsTACbJz14A3TsU8lJ4rpCsk_0tTaIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Wed, 20 Oct 2021 23:45:39 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=3cd27493-ea54-4776-9bdf-8bace401e888&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0db9bbe6-a8d3-40c7-b626-04f76ffff700', + 'x-ms-ests-server', + '2.1.12158.6 - WUS2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=ArTe1if4zIRDi-39stkHvXYW-HEQAQAAACOhAtkOAAAA; expires=Fri, 19-Nov-2021 23:45:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Wed, 20 Oct 2021 23:45:39 GMT', + 'Content-Length', + '1315' +]); + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .put('/keys/keyops163477354107608629', {"key":{"kty":"RSA","key_ops":["encrypt","decrypt"],"n":"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj17rUFN0f9GZMZ0pqEQNCPRBLVJ_-TEe2nGCWSC0exxGsRqz6R1zFkB-icfzQPe4WjQELOUXQ7J9RxhAPTTHtDivYYG-BeTRHrmF04JT1_6b9T_C8bAC0i0teT-nmlBLarQtBJKATXBx1yegbPOoiTqlQrFQP4MrKWNxtnB9Tcbjcvj-Z9je0ckI_eRc4DvAhqcUh_p15Dqg4GeaoNIO_jU","e":"AQAB","d":"Ynx9JGaBSP4iUsf6ZJ6opantRNdcdmzaQrKbZg6ZQE8Ohi1FYabJWvaoPSE-CiJEsDzShXZHMhUHN4X7Bn8BXaGQhK3p9HXgiwQKmix7oAJTu4ElUIyd8UC3UWHSZr40el4PaQD-HYu_eMzCXus34MnRiNbh_BUWm6T-Eidhk9d3kNIyaSi9YNDQHW6tjWrEhhq63O7JU1j9ZonFChZxpKk20jdkQKQURVAdpOdL-5j4I70ZxFuU6wHZj8DS8oRQfwGOvZKbgYDb5jgf3UNL_7eACqq92XPVX56vm7iKbqeyjCqAIx5y3hrSRIJtZlWCwjYnYQGd4unxDLi8wmJWSQ","dp":"AMmhWb5yZcu6vJr8xJZ-t0_likxJRUMZAtEULaWZt2DgODj4y9JrZDJP6mvckzhQP0WXk2NuWbU2HR5pUeCN2wieG1B76VKoH76vfnaJDqT1NuJVBcP2SLHog3ffwZtMME5zjfygchG3kihqOSpwTQ9ETAqAJTkRC38fEhwAz_Cp","dq":"AKC9TAo9n2RDaggjdLXK8kiLrBVoaWFTpqXkzYXRhtsx4vWPAkxhfSnze05rVMl6HiXv7FnE0f0wYawzUJzoyuXBH0zS6D9BqCZPeF543AmWB27iPf38Q9Z8Rjr6oBgMSnGDV_mm8nDVQkeaDyE4cOZh-5UKvKShTKKQVwunmDNH","qi":"AJ_nrkLpK8BPzVeARkvSHQyKwMWZ-a8CD95qsKfn0dOZAvXY-2xhQYTEwbED-0bpTNEKbIpA-ZkaHygmnzJkNbbFAnb9pkkzU8ZQqDP3JNgMfVIroWx58Oth9nJza2j7i-MkPRCUPEq3Ao0J52z7WJIiLji8TTVYW_NaiM1oxzsH","p":"ANHerI1o3dLB_VLVmZZVss8VZSYN5SaeQ_0qhfOSgOFwj__waCFmy2EG7l6l6f_Z-Y0L7Mn_LNov68lyWSFa2EuQUeVj4UoFHc5Di8ZUGiSsTwFM-XMtNuv8HmGgDYLL5BIJD3eTz71LdgW-Ez38OZH34b7VeG8zfeUDb8Hi30zz","q":"AMPcZrZBqbc82DO8Q5zTT8ZXRGWrW36KktMllaIk1W2RHnRiQiW0jBWmcCgqUcQNHa1LwumjyNqwx28QBS37BTvG7ULGUoio6LrOeoiBGEMj-U19sX6m37plEhj5Mak7j3OPPY_T9rohjTW5aGGg9YSwq4jdz0RrmBX00ofYOjI3"}}) + .query(true) + .reply(200, {"key":{"kid":"https://keyvault_name.vault.azure.net/keys/keyops163477354107608629/d1b587405a5d41c08a39cb89dd5ad9dd","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ","e":"AQAB"},"attributes":{"enabled":true,"created":1634773540,"updated":1634773540,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + 'e6e68792-4ee5-4e65-8d48-754d80dc5cf0', + 'x-ms-request-id', + '3ccc45ff-4d29-4e42-a67a-730cd2b03aa2', + 'x-ms-keyvault-service-version', + '1.9.150.1', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Wed, 20 Oct 2021 23:45:39 GMT', + 'Content-Length', + '666' +]); diff --git a/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_uses_keyops_when_key_ops_is_not_provided.js b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_uses_keyops_when_key_ops_is_not_provided.js new file mode 100644 index 000000000000..3885a49c7f7e --- /dev/null +++ b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__import_keys/recording_uses_keyops_when_key_ops_is_not_provided.js @@ -0,0 +1,181 @@ +let nock = require('nock'); + +module.exports.hash = "bb2fb23c73e3c86706f7187bafcebbea"; + +module.exports.testInfo = {"uniqueName":{"keyops":"keyops163477354153107821"},"newDate":{}} + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .put('/keys/keyops163477354153107821') + .query(true) + .reply(401, {"error":{"code":"Unauthorized","message":"AKV10000: Request is missing a Bearer or PoP token."}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '97', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'WWW-Authenticate', + 'Bearer authorization="https://login.windows.net/12345678-1234-1234-1234-123456789012", resource="https://vault.azure.net"', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + 'f770dfdd-b9a7-4b47-989d-38261433c025', + 'x-ms-request-id', + '9354c2b4-3872-4c8f-86d5-eaf1b7adf9bf', + 'x-ms-keyvault-service-version', + '1.9.150.1', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Wed, 20 Oct 2021 23:45:39 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '24ce9361-04fe-4df2-9ccb-5bea03255700', + 'x-ms-ests-server', + '2.1.12158.6 - EUS ProdSlices', + 'Set-Cookie', + 'fpc=AtV1EjK9S-tAkhMw1pQeyK0; expires=Fri, 19-Nov-2021 23:45:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrgrIEyW51dalQDp-RHjaCuCqauJZup5mNAamM3qXw10t1Wv-4SirwEyB6xAcYeF8xPOuxamCn--8_z5K5nvlSDJlKeP67_Nn5JemEJR6Suk9zwjrahMuUBBSx5AGiCSK8s0OrWQrgHLhfcxXN2O97Ik3scfZUB65gpAzD1iLAQ_sgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Wed, 20 Oct 2021 23:45:40 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'c641e876-9f13-4f57-a451-bb0336d72301', + 'x-ms-ests-server', + '2.1.12158.6 - SCUS ProdSlices', + 'Set-Cookie', + 'fpc=AgvMDMibNPxHuBdb1B7wCdM; expires=Fri, 19-Nov-2021 23:45:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr7hRpEBWvuBZcYDOL5Spasp6mH83lhd3-jIq1WaFPKanH1AZXcils3Sx8U46ghtgAvpy1yo4UQZD9ioxONL5xlyHR-pjc2SaWCRyBJaxVn-z_Q30gXZDazUUS_IPi0Z5slYQ4x-gormQkT0IOpkdX2Llzi7KdKScGvAq03LCFEjcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Wed, 20 Oct 2021 23:45:40 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d56fac40-086e-4f44-b6f3-3c7442a5bd2e&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '708f578a-685a-4a67-8a57-af642e460501', + 'x-ms-ests-server', + '2.1.12158.6 - NCUS ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AicuQGYJoWRFg2NHOBFRiVsW-HEQAQAAACOhAtkOAAAA; expires=Fri, 19-Nov-2021 23:45:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Wed, 20 Oct 2021 23:45:40 GMT', + 'Content-Length', + '1315' +]); + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .put('/keys/keyops163477354153107821', {"key":{"kty":"RSA","key_ops":["sign","verify"],"n":"AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj17rUFN0f9GZMZ0pqEQNCPRBLVJ_-TEe2nGCWSC0exxGsRqz6R1zFkB-icfzQPe4WjQELOUXQ7J9RxhAPTTHtDivYYG-BeTRHrmF04JT1_6b9T_C8bAC0i0teT-nmlBLarQtBJKATXBx1yegbPOoiTqlQrFQP4MrKWNxtnB9Tcbjcvj-Z9je0ckI_eRc4DvAhqcUh_p15Dqg4GeaoNIO_jU","e":"AQAB","d":"Ynx9JGaBSP4iUsf6ZJ6opantRNdcdmzaQrKbZg6ZQE8Ohi1FYabJWvaoPSE-CiJEsDzShXZHMhUHN4X7Bn8BXaGQhK3p9HXgiwQKmix7oAJTu4ElUIyd8UC3UWHSZr40el4PaQD-HYu_eMzCXus34MnRiNbh_BUWm6T-Eidhk9d3kNIyaSi9YNDQHW6tjWrEhhq63O7JU1j9ZonFChZxpKk20jdkQKQURVAdpOdL-5j4I70ZxFuU6wHZj8DS8oRQfwGOvZKbgYDb5jgf3UNL_7eACqq92XPVX56vm7iKbqeyjCqAIx5y3hrSRIJtZlWCwjYnYQGd4unxDLi8wmJWSQ","dp":"AMmhWb5yZcu6vJr8xJZ-t0_likxJRUMZAtEULaWZt2DgODj4y9JrZDJP6mvckzhQP0WXk2NuWbU2HR5pUeCN2wieG1B76VKoH76vfnaJDqT1NuJVBcP2SLHog3ffwZtMME5zjfygchG3kihqOSpwTQ9ETAqAJTkRC38fEhwAz_Cp","dq":"AKC9TAo9n2RDaggjdLXK8kiLrBVoaWFTpqXkzYXRhtsx4vWPAkxhfSnze05rVMl6HiXv7FnE0f0wYawzUJzoyuXBH0zS6D9BqCZPeF543AmWB27iPf38Q9Z8Rjr6oBgMSnGDV_mm8nDVQkeaDyE4cOZh-5UKvKShTKKQVwunmDNH","qi":"AJ_nrkLpK8BPzVeARkvSHQyKwMWZ-a8CD95qsKfn0dOZAvXY-2xhQYTEwbED-0bpTNEKbIpA-ZkaHygmnzJkNbbFAnb9pkkzU8ZQqDP3JNgMfVIroWx58Oth9nJza2j7i-MkPRCUPEq3Ao0J52z7WJIiLji8TTVYW_NaiM1oxzsH","p":"ANHerI1o3dLB_VLVmZZVss8VZSYN5SaeQ_0qhfOSgOFwj__waCFmy2EG7l6l6f_Z-Y0L7Mn_LNov68lyWSFa2EuQUeVj4UoFHc5Di8ZUGiSsTwFM-XMtNuv8HmGgDYLL5BIJD3eTz71LdgW-Ez38OZH34b7VeG8zfeUDb8Hi30zz","q":"AMPcZrZBqbc82DO8Q5zTT8ZXRGWrW36KktMllaIk1W2RHnRiQiW0jBWmcCgqUcQNHa1LwumjyNqwx28QBS37BTvG7ULGUoio6LrOeoiBGEMj-U19sX6m37plEhj5Mak7j3OPPY_T9rohjTW5aGGg9YSwq4jdz0RrmBX00ofYOjI3"}}) + .query(true) + .reply(200, {"key":{"kid":"https://keyvault_name.vault.azure.net/keys/keyops163477354153107821/8350d8cd5d4f4761ac9b93d26658ac65","kty":"RSA","key_ops":["sign","verify"],"n":"oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ","e":"AQAB"},"attributes":{"enabled":true,"created":1634773540,"updated":1634773540,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + 'f770dfdd-b9a7-4b47-989d-38261433c025', + 'x-ms-request-id', + '5ca6faed-49ec-4626-9a05-bf59fe3cd0a3', + 'x-ms-keyvault-service-version', + '1.9.150.1', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.231.105;act_addr_fam=InterNetwork;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Wed, 20 Oct 2021 23:45:40 GMT', + 'Content-Length', + '662' +]); diff --git a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts index b41c3daca276..b4557989a7a3 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts @@ -20,10 +20,7 @@ export class KeyVaultClientContext extends coreHttp.ServiceClient { * @param apiVersion Api Version * @param options The parameter options */ - constructor( - apiVersion: ApiVersion73Preview, - options?: KeyVaultClientOptionalParams - ) { + constructor(apiVersion: ApiVersion73Preview, options?: KeyVaultClientOptionalParams) { if (apiVersion === undefined) { throw new Error("'apiVersion' cannot be null"); } diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/index.ts b/sdk/keyvault/keyvault-keys/src/generated/models/index.ts index 243e0084491d..93c23d6cf2bd 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/index.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/index.ts @@ -77,7 +77,7 @@ export interface JsonWebKey { kid?: string; /** JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. */ kty?: JsonWebKeyType; - keyOps?: string[]; + key_ops?: string[]; /** RSA modulus. */ n?: Uint8Array; /** RSA public exponent. */ @@ -681,8 +681,7 @@ export type KeyEncryptionAlgorithm = string; export type ActionType = "Rotate" | "Notify"; /** Optional parameters. */ -export interface KeyVaultClientCreateKeyOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientCreateKeyOptionalParams extends coreHttp.OperationOptions { /** The key size in bits. For example: 2048, 3072, or 4096 for RSA. */ keySize?: number; /** The public exponent for a RSA key. */ @@ -712,8 +711,7 @@ export type KeyVaultClientCreateKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientRotateKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientRotateKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the rotateKey operation. */ export type KeyVaultClientRotateKeyResponse = KeyBundle & { @@ -728,8 +726,7 @@ export type KeyVaultClientRotateKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientImportKeyOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientImportKeyOptionalParams extends coreHttp.OperationOptions { /** Whether to import as a hardware key (HSM) or software key. */ hsm?: boolean; /** The key management attributes. */ @@ -753,8 +750,7 @@ export type KeyVaultClientImportKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientDeleteKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientDeleteKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the deleteKey operation. */ export type KeyVaultClientDeleteKeyResponse = DeletedKeyBundle & { @@ -769,8 +765,7 @@ export type KeyVaultClientDeleteKeyResponse = DeletedKeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientUpdateKeyOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientUpdateKeyOptionalParams extends coreHttp.OperationOptions { /** Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. */ keyOps?: JsonWebKeyOperation[]; /** The attributes of a key managed by the key vault service. */ @@ -794,8 +789,7 @@ export type KeyVaultClientUpdateKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientGetKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getKey operation. */ export type KeyVaultClientGetKeyResponse = KeyBundle & { @@ -810,8 +804,7 @@ export type KeyVaultClientGetKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyVersionsOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientGetKeyVersionsOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } @@ -829,8 +822,7 @@ export type KeyVaultClientGetKeyVersionsResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeysOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientGetKeysOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } @@ -848,8 +840,7 @@ export type KeyVaultClientGetKeysResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientBackupKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientBackupKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the backupKey operation. */ export type KeyVaultClientBackupKeyResponse = BackupKeyResult & { @@ -864,8 +855,7 @@ export type KeyVaultClientBackupKeyResponse = BackupKeyResult & { }; /** Optional parameters. */ -export interface KeyVaultClientRestoreKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientRestoreKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the restoreKey operation. */ export type KeyVaultClientRestoreKeyResponse = KeyBundle & { @@ -880,8 +870,7 @@ export type KeyVaultClientRestoreKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientEncryptOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientEncryptOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -903,8 +892,7 @@ export type KeyVaultClientEncryptResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientDecryptOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientDecryptOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -926,8 +914,7 @@ export type KeyVaultClientDecryptResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientSignOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientSignOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the sign operation. */ export type KeyVaultClientSignResponse = KeyOperationResult & { @@ -942,8 +929,7 @@ export type KeyVaultClientSignResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientVerifyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientVerifyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the verify operation. */ export type KeyVaultClientVerifyResponse = KeyVerifyResult & { @@ -958,8 +944,7 @@ export type KeyVaultClientVerifyResponse = KeyVerifyResult & { }; /** Optional parameters. */ -export interface KeyVaultClientWrapKeyOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientWrapKeyOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -981,8 +966,7 @@ export type KeyVaultClientWrapKeyResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientUnwrapKeyOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientUnwrapKeyOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -1004,8 +988,7 @@ export type KeyVaultClientUnwrapKeyResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientExportOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientExportOptionalParams extends coreHttp.OperationOptions { /** The export key encryption Json web key. This key MUST be a RSA key that supports encryption. */ wrappingKey?: JsonWebKey; /** The export key encryption key identifier. This key MUST be a RSA key that supports encryption. */ @@ -1027,8 +1010,7 @@ export type KeyVaultClientExportResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientReleaseOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientReleaseOptionalParams extends coreHttp.OperationOptions { /** A client provided nonce for freshness. */ nonce?: string; /** The encryption algorithm to use to protected the exported key material */ @@ -1048,8 +1030,7 @@ export type KeyVaultClientReleaseResponse = KeyReleaseResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetDeletedKeysOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientGetDeletedKeysOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } @@ -1067,8 +1048,7 @@ export type KeyVaultClientGetDeletedKeysResponse = DeletedKeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetDeletedKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientGetDeletedKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getDeletedKey operation. */ export type KeyVaultClientGetDeletedKeyResponse = DeletedKeyBundle & { @@ -1083,12 +1063,10 @@ export type KeyVaultClientGetDeletedKeyResponse = DeletedKeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientPurgeDeletedKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientPurgeDeletedKeyOptionalParams extends coreHttp.OperationOptions {} /** Optional parameters. */ -export interface KeyVaultClientRecoverDeletedKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientRecoverDeletedKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the recoverDeletedKey operation. */ export type KeyVaultClientRecoverDeletedKeyResponse = KeyBundle & { @@ -1135,8 +1113,7 @@ export type KeyVaultClientUpdateKeyRotationPolicyResponse = KeyRotationPolicy & }; /** Optional parameters. */ -export interface KeyVaultClientGetRandomBytesOptionalParams - extends coreHttp.OperationOptions {} +export interface KeyVaultClientGetRandomBytesOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getRandomBytes operation. */ export type KeyVaultClientGetRandomBytesResponse = RandomBytes & { @@ -1151,8 +1128,7 @@ export type KeyVaultClientGetRandomBytesResponse = RandomBytes & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyVersionsNextOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientGetKeyVersionsNextOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } @@ -1170,8 +1146,7 @@ export type KeyVaultClientGetKeyVersionsNextResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeysNextOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientGetKeysNextOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } @@ -1189,8 +1164,7 @@ export type KeyVaultClientGetKeysNextResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetDeletedKeysNextOptionalParams - extends coreHttp.OperationOptions { +export interface KeyVaultClientGetDeletedKeysNextOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } @@ -1208,8 +1182,7 @@ export type KeyVaultClientGetDeletedKeysNextResponse = DeletedKeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientOptionalParams - extends coreHttp.ServiceClientOptions { +export interface KeyVaultClientOptionalParams extends coreHttp.ServiceClientOptions { /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts b/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts index a7f108f88509..f1651a283334 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts @@ -198,7 +198,7 @@ export const JsonWebKey: coreHttp.CompositeMapper = { name: "String" } }, - keyOps: { + key_ops: { serializedName: "key_ops", type: { name: "Sequence", diff --git a/sdk/keyvault/keyvault-keys/src/index.ts b/sdk/keyvault/keyvault-keys/src/index.ts index 9f14f145fb97..f9caa8c68058 100644 --- a/sdk/keyvault/keyvault-keys/src/index.ts +++ b/sdk/keyvault/keyvault-keys/src/index.ts @@ -440,6 +440,12 @@ export class KeyClient { }; } + // Here for backwards compatibility with the deprecated keyOps field + // Can be removed when we remove keyOps entirely in version 5.x + if (key.keyOps && !key.key_ops) { + key.key_ops = key.keyOps; + } + return withTrace(`importKey`, unflattenedOptions, async (updatedOptions) => { const response = await this.client.importKey(this.vaultUrl, name, key, updatedOptions); return getKeyFromKeyBundle(response); diff --git a/sdk/keyvault/keyvault-keys/src/transformations.ts b/sdk/keyvault/keyvault-keys/src/transformations.ts index 2d1bfdef66ee..b2e380ec5c44 100644 --- a/sdk/keyvault/keyvault-keys/src/transformations.ts +++ b/sdk/keyvault/keyvault-keys/src/transformations.ts @@ -35,10 +35,10 @@ export function getKeyFromKeyBundle( delete keyBundle.attributes; const resultObject: KeyVaultKey | DeletedKey = { - key: { ...keyBundle.key, key_ops: keyBundle.key?.keyOps }, + key: { ...keyBundle.key, keyOps: keyBundle.key?.key_ops }, id: keyBundle.key ? keyBundle.key.kid : undefined, name: parsedId.name, - keyOperations: keyBundle.key ? keyBundle.key.keyOps : undefined, + keyOperations: keyBundle.key ? keyBundle.key.key_ops : undefined, keyType: keyBundle.key ? keyBundle.key.kty : undefined, properties: { tags: keyBundle.tags, diff --git a/sdk/keyvault/keyvault-keys/swagger/README.md b/sdk/keyvault/keyvault-keys/swagger/README.md index 1a586ef27934..a85c9b6cefd7 100644 --- a/sdk/keyvault/keyvault-keys/swagger/README.md +++ b/sdk/keyvault/keyvault-keys/swagger/README.md @@ -48,3 +48,22 @@ directive: $.values[0].value = "Rotate"; $.values[1].value = "Notify"; ``` + +### Prevent key_ops from being converted to keyOps when generating types for JsonWebKey + +key_ops is the correct name as per the IETF standard + +```yaml +directive: + - from: swagger-document + where: $.definitions.JsonWebKey.properties.key_ops + transform: > + $["x-ms-client-name"] = "key_ops_keep_snakecase"; +``` + +```yaml +modelerfour: + naming: + override: + key_ops_keep_snakecase: $DO_NOT_NORMALIZE$key_ops +``` diff --git a/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts index 6db613ea90cc..78233f9cd2ea 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts @@ -35,7 +35,7 @@ describe("Transformations", () => { kid: "https://azure_managedhsm.managedhsm.azure.net/keys/transformations/f03e8b3d76554e8b9749994bcf72fc61", kty: "oct-HSM", - keyOps: ["encrypt", "decrypt"] + key_ops: ["encrypt", "decrypt"] }, attributes: { exportable: true, @@ -100,7 +100,7 @@ describe("Transformations", () => { kid: "https://azure_managedhsm.managedhsm.azure.net/keys/transformations/f03e8b3d76554e8b9749994bcf72fc61", kty: "oct-HSM", - keyOps: ["encrypt", "decrypt"] + key_ops: ["encrypt", "decrypt"] }, attributes: { recoverableDays: 1, diff --git a/sdk/keyvault/keyvault-keys/test/public/import.spec.ts b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts index f70f785c2bf6..179a8729847e 100644 --- a/sdk/keyvault/keyvault-keys/test/public/import.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import * as assert from "assert"; +import { assert } from "chai"; import { Context } from "mocha"; import { env, Recorder } from "@azure-tools/test-recorder"; @@ -38,4 +38,24 @@ describe("Keys client - import keys", () => { const key = await client.importKey(keyName, jsonWebKey); assert.equal(key.key!.e!.toString(), jsonWebKey.e!.toString()); }); + + it("prefers key_ops over keyOps when both are provided", async () => { + const jsonWebKey = createRsaKey(); + jsonWebKey.key_ops = ["encrypt", "decrypt"]; + jsonWebKey.keyOps = ["sign", "verify"]; + const keyName = recorder.getUniqueName("keyops"); + const key = await client.importKey(keyName, jsonWebKey); + assert.sameMembers(key.key!.key_ops!, jsonWebKey.key_ops); + assert.sameMembers(key.key!.keyOps!, jsonWebKey.key_ops); + }); + + it("uses keyOps when key_ops is not provided", async () => { + const jsonWebKey = createRsaKey(); + jsonWebKey.key_ops = undefined; + jsonWebKey.keyOps = ["sign", "verify"]; + const keyName = recorder.getUniqueName("keyops"); + const key = await client.importKey(keyName, jsonWebKey); + assert.sameMembers(key.key!.key_ops!, jsonWebKey.keyOps); + assert.sameMembers(key.key!.keyOps!, jsonWebKey.keyOps); + }); }); diff --git a/sdk/keyvault/keyvault-keys/test/utils/crypto.ts b/sdk/keyvault/keyvault-keys/test/utils/crypto.ts index 86e81563f338..2681c772772c 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/crypto.ts +++ b/sdk/keyvault/keyvault-keys/test/utils/crypto.ts @@ -44,7 +44,7 @@ function toBytes(hex: string): Uint8Array { export function createRsaKey(): JsonWebKey { return { kty: "RSA", - keyOps: ["encrypt", "decrypt", "sign", "verify", "wrapKey", "unwrapKey"], + key_ops: ["encrypt", "decrypt", "sign", "verify", "wrapKey", "unwrapKey"], n: toBytes( "00a0914d00234ac683b21b4c15d5bed887bdc959c2e57af54ae734e8f00720d775d275e455207e3784ceeb60a50a4655dd72a7a94d271e8ee8f7959a669ca6e775bf0e23badae991b4529d978528b4bd90521d32dd2656796ba82b6bbfc7668c8f5eeb5053747fd199319d29a8440d08f4412d527ff9311eda71825920b47b1c46b11ab3e91d7316407e89c7f340f7b85a34042ce51743b27d4718403d34c7b438af6181be05e4d11eb985d38253d7fe9bf53fc2f1b002d22d2d793fa79a504b6ab42d0492804d7071d727a06cf3a8893aa542b1503f832b296371b6707d4dc6e372f8fe67d8ded1c908fde45ce03bc086a71487fa75e43aa0e0679aa0d20efe35" ),