Skip to content

Commit

Permalink
[KeyVault-Keys] Missing tests and a tweak on the recordings. (#6126)
Browse files Browse the repository at this point in the history
Added missing tests for importKey, getDeletedKey and purgeDeletedKey. I also changed some previously unchanged before/after calls to beforeEach and afterEach, since that makes future diffs smaller and future new recordings easier.

The import code comes from: https://github.com/Azure/azure-sdk-for-python/blob/1d42b625af9d66cc94fd87bad383464c0f6ade4c/sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py#L111

Fixes #5731
  • Loading branch information
sadasant authored Nov 11, 2019
1 parent bc7597e commit 8484e25
Show file tree
Hide file tree
Showing 108 changed files with 201,233 additions and 41,790 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recordings": [],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"recordings": [
{
"method": "DELETE",
"url": "https://keyvault_name.vault.azure.net/keys/recoverKeyName-cantgetadeletedkeythatdoesntexist-",
"query": {
"api-version": "7.0"
},
"requestBody": "",
"status": 401,
"response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"Request is missing a Bearer or PoP token.\"}}",
"responseHeaders": {
"strict-transport-security": "max-age=31536000;includeSubDomains",
"www-authenticate": "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"",
"x-ms-keyvault-network-info": "addr=52.183.14.89;act_addr_fam=InterNetwork;",
"x-aspnet-version": "4.0.30319",
"x-powered-by": "ASP.NET",
"status": "401",
"x-ms-keyvault-region": "westus",
"content-length": "87",
"pragma": "no-cache",
"server": "Microsoft-IIS/10.0",
"x-ms-keyvault-service-version": "1.1.0.882",
"date": "Fri, 08 Nov 2019 20:55:55 GMT",
"content-type": "application/json; charset=utf-8",
"x-ms-request-id": "0b36f5ae-920f-4ccf-ba51-0b2aab368dd5",
"cache-control": "no-cache",
"x-content-type-options": "nosniff",
"expires": "-1"
}
},
{
"method": "POST",
"url": "https://login.microsoftonline.com/azure_tenant_id/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\":3600,\"ext_expires_in\":3600,\"access_token\":\"access_token\"}",
"responseHeaders": {
"pragma": "no-cache",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"date": "Fri, 08 Nov 2019 20:55:55 GMT",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"x-ms-request-id": "6100db0b-f191-4431-9206-41c5c80b2400",
"cache-control": "no-cache, no-store",
"content-type": "application/json; charset=utf-8",
"content-length": "1231",
"x-ms-ests-server": "2.1.9645.7 - NCUS ProdSlices",
"referrer-policy": "strict-origin-when-cross-origin",
"expires": "-1"
}
},
{
"method": "DELETE",
"url": "https://keyvault_name.vault.azure.net/keys/recoverKeyName-cantgetadeletedkeythatdoesntexist-",
"query": {
"api-version": "7.0"
},
"requestBody": null,
"status": 404,
"response": "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Key not found: recoverKeyName-cantgetadeletedkeythatdoesntexist-\"}}",
"responseHeaders": {
"strict-transport-security": "max-age=31536000;includeSubDomains",
"x-content-type-options": "nosniff",
"x-ms-keyvault-network-info": "addr=52.183.14.89;act_addr_fam=InterNetwork;",
"x-aspnet-version": "4.0.30319",
"x-powered-by": "ASP.NET",
"status": "404",
"x-ms-keyvault-region": "westus",
"content-length": "125",
"pragma": "no-cache",
"server": "Microsoft-IIS/10.0",
"x-ms-keyvault-service-version": "1.1.0.882",
"date": "Fri, 08 Nov 2019 20:55:55 GMT",
"content-type": "application/json; charset=utf-8",
"x-ms-request-id": "58c8c07b-9f74-40bf-9a18-01c7d93d4ef0",
"cache-control": "no-cache",
"expires": "-1"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"recordings": [
{
"method": "GET",
"url": "https://keyvault_name.vault.azure.net/keys/recoverKeyName-deletenonexistingkey-/",
"query": {
"api-version": "7.0"
},
"requestBody": "",
"status": 401,
"response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"Request is missing a Bearer or PoP token.\"}}",
"responseHeaders": {
"strict-transport-security": "max-age=31536000;includeSubDomains",
"www-authenticate": "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"",
"x-ms-keyvault-network-info": "addr=52.183.14.89;act_addr_fam=InterNetwork;",
"x-aspnet-version": "4.0.30319",
"x-powered-by": "ASP.NET",
"status": "401",
"x-ms-keyvault-region": "westus",
"content-length": "87",
"pragma": "no-cache",
"server": "Microsoft-IIS/10.0",
"x-ms-keyvault-service-version": "1.1.0.882",
"date": "Fri, 08 Nov 2019 20:55:02 GMT",
"content-type": "application/json; charset=utf-8",
"x-ms-request-id": "caa91383-d8ec-4c13-8bc7-1bd858b54ffb",
"cache-control": "no-cache",
"x-content-type-options": "nosniff",
"expires": "-1"
}
},
{
"method": "POST",
"url": "https://login.microsoftonline.com/azure_tenant_id/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\":3600,\"ext_expires_in\":3600,\"access_token\":\"access_token\"}",
"responseHeaders": {
"pragma": "no-cache",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"date": "Fri, 08 Nov 2019 20:55:02 GMT",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"x-ms-request-id": "e1e400fb-3c07-4f36-956d-a36f10112200",
"cache-control": "no-cache, no-store",
"content-type": "application/json; charset=utf-8",
"content-length": "1231",
"x-ms-ests-server": "2.1.9645.7 - NCUS ProdSlices",
"referrer-policy": "strict-origin-when-cross-origin",
"expires": "-1"
}
},
{
"method": "GET",
"url": "https://keyvault_name.vault.azure.net/keys/recoverKeyName-deletenonexistingkey-/",
"query": {
"api-version": "7.0"
},
"requestBody": null,
"status": 404,
"response": "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Key not found: recoverKeyName-deletenonexistingkey-\"}}",
"responseHeaders": {
"strict-transport-security": "max-age=31536000;includeSubDomains",
"x-content-type-options": "nosniff",
"x-ms-keyvault-network-info": "addr=52.183.14.89;act_addr_fam=InterNetwork;",
"x-aspnet-version": "4.0.30319",
"x-powered-by": "ASP.NET",
"status": "404",
"x-ms-keyvault-region": "westus",
"content-length": "111",
"pragma": "no-cache",
"server": "Microsoft-IIS/10.0",
"x-ms-keyvault-service-version": "1.1.0.882",
"date": "Fri, 08 Nov 2019 20:55:02 GMT",
"content-type": "application/json; charset=utf-8",
"x-ms-request-id": "8ca12568-73f0-4ef2-8444-f55335d38183",
"cache-control": "no-cache",
"expires": "-1"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"recordings": [
{
"method": "PUT",
"url": "https://keyvault_name.vault.azure.net/keys/mergeKeyName-canimportakey-undefined",
"query": {
"api-version": "7.0"
},
"requestBody": "",
"status": 401,
"response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"Request is missing a Bearer or PoP token.\"}}",
"responseHeaders": {
"strict-transport-security": "max-age=31536000;includeSubDomains",
"www-authenticate": "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"",
"x-ms-keyvault-network-info": "addr=52.183.14.89;act_addr_fam=InterNetwork;",
"x-aspnet-version": "4.0.30319",
"x-powered-by": "ASP.NET",
"status": "401",
"x-ms-keyvault-region": "westus",
"content-length": "87",
"pragma": "no-cache",
"server": "Microsoft-IIS/10.0",
"x-ms-keyvault-service-version": "1.1.0.882",
"date": "Fri, 08 Nov 2019 20:57:25 GMT",
"content-type": "application/json; charset=utf-8",
"x-ms-request-id": "6425033c-abb6-42d8-a2e4-834264d2c113",
"cache-control": "no-cache",
"x-content-type-options": "nosniff",
"expires": "-1"
}
},
{
"method": "POST",
"url": "https://login.microsoftonline.com/azure_tenant_id/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\":3600,\"ext_expires_in\":3600,\"access_token\":\"access_token\"}",
"responseHeaders": {
"pragma": "no-cache",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"date": "Fri, 08 Nov 2019 20:57:24 GMT",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"x-ms-request-id": "f8dc6cff-cc5c-4adf-8877-9fcd99db5a00",
"cache-control": "no-cache, no-store",
"content-type": "application/json; charset=utf-8",
"content-length": "1231",
"x-ms-ests-server": "2.1.9645.7 - EUS ProdSlices",
"referrer-policy": "strict-origin-when-cross-origin",
"expires": "-1"
}
},
{
"method": "PUT",
"url": "https://keyvault_name.vault.azure.net/keys/mergeKeyName-canimportakey-undefined",
"query": {
"api-version": "7.0"
},
"requestBody": "{\"key\":{\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"dec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6oBgMSnGDV_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\"}}",
"status": 200,
"response": "{\"key\":{\"kid\":\"https://keyvault_name.vault.azure.net/keys/mergeKeyName-canimportakey-undefined/735b40536929488bba41cfe75fad4ce1\",\"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\"},\"attributes\":{\"enabled\":true,\"created\":1573246645,\"updated\":1573246645,\"recoveryLevel\":\"Recoverable+Purgeable\"}}",
"responseHeaders": {
"strict-transport-security": "max-age=31536000;includeSubDomains",
"x-content-type-options": "nosniff",
"x-ms-keyvault-network-info": "addr=52.183.14.89;act_addr_fam=InterNetwork;",
"x-aspnet-version": "4.0.30319",
"x-powered-by": "ASP.NET",
"status": "200",
"x-ms-keyvault-region": "westus",
"content-length": "683",
"pragma": "no-cache",
"server": "Microsoft-IIS/10.0",
"x-ms-keyvault-service-version": "1.1.0.882",
"date": "Fri, 08 Nov 2019 20:57:25 GMT",
"content-type": "application/json; charset=utf-8",
"x-ms-request-id": "822312f7-30c7-41a9-8f2c-147aff15622a",
"cache-control": "no-cache",
"expires": "-1"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
}
}
Loading

0 comments on commit 8484e25

Please sign in to comment.