Skip to content

Commit

Permalink
[KV] Adjust rotation test for preview behavior (#21093)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccoyp authored Oct 7, 2021
1 parent 8b292dc commit 2a7a465
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def _from_generated(cls, policy):
return cls(
policy_id=policy.id,
lifetime_actions=lifetime_actions,
expires_on=policy.attributes.expiry_time,
expires_in=policy.attributes.expiry_time,
created_on=policy.attributes.created,
updated_on=policy.attributes.updated,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
Content-Type:
- application/json
User-Agent:
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.22000-SP0)
method: POST
uri: https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/create?api-version=7.3-preview
response:
Expand All @@ -28,7 +28,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Tue, 28 Sep 2021 20:28:54 GMT
- Wed, 06 Oct 2021 19:10:18 GMT
expires:
- '-1'
pragma:
Expand All @@ -45,7 +45,7 @@ interactions:
x-ms-keyvault-region:
- westus
x-ms-keyvault-service-version:
- 1.9.79.2
- 1.9.132.3
x-powered-by:
- ASP.NET
status:
Expand All @@ -65,21 +65,21 @@ interactions:
Content-Type:
- application/json
User-Agent:
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.22000-SP0)
method: POST
uri: https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/create?api-version=7.3-preview
response:
body:
string: '{"key":{"kid":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/1f1dcc214e0649298fc9d8431f133d70","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"xuqdP_vk8J3YrTpuVGWdaqKyYur6DxjrNIf8ytP5gbe5FNZ6gWdR3Owy8DhQoR699a9XLLzuqa-h7DasW_n-HXoZ_yRcJq4SHi-FG4PkZdJB9rh54l8dbzFn-8anGdTcVEPqFn9B1xOdf8aSZ1QIyW2io9gpLtpWY9rvQjtK8N332KWLxDHDxgOIq7jbexsa9DDWgKzcA_g37PEwpRYSb4NtJkvk4ztMa_OhEEwL7HIzUJjCQjKZRRGIVZxNWhakMQrdb4qhxQ8PNPmMFcuY9TVJ8hzVCZHQrsristcBcE1IyhvQoHYnCnDX3dD5FLyhPAoLVqmP6Z0_2w68-k-nfQ","e":"AQAB"},"attributes":{"enabled":true,"exp":1640636935,"created":1632860935,"updated":1632860935,"recoveryLevel":"Recoverable+Purgeable","recoverableDays":90}}'
string: '{"key":{"kid":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/c4727665632f40458f317002b39a1504","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2gbZmgfsdB98UZQ1YbmpvHYGNOICfyClDIBjVc5UatdptqMiUQU_1mbSB7ngynjQWFXH7AOnE4XH37lQ1ZQAGSvH6Z0LjYkyLT5tSG_MdJ5TGRqyMT6tEh-46QvPRGLAMbWm6uqAbmc6pX-Qsj2nxBsueH1p7Q9qR-IH0oXVS6v8If2YkwMvBo7Uzf6mtwfquDzXYOS5jwg5rWz7PlUTiQaws4s1Fwlth7Vxr6HFYPpmVBQM327hKgR50kcv6mjXmt0VT27apBOyJykGZlGjuZZLILT5Tffc3AC4qNhSEhKXZA2uqg5f7HB8PERZrexi0fI_AzTLySwtZStzJwBC_Q","e":"AQAB"},"attributes":{"enabled":true,"exp":1641323419,"created":1633547419,"updated":1633547419,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7}}'
headers:
cache-control:
- no-cache
content-length:
- '715'
- '723'
content-type:
- application/json; charset=utf-8
date:
- Tue, 28 Sep 2021 20:28:55 GMT
- Wed, 06 Oct 2021 19:10:19 GMT
expires:
- '-1'
pragma:
Expand All @@ -93,15 +93,15 @@ interactions:
x-ms-keyvault-region:
- westus
x-ms-keyvault-service-version:
- 1.9.79.2
- 1.9.132.3
x-powered-by:
- ASP.NET
status:
code: 200
message: OK
- request:
body: '{"lifetimeActions": [{"trigger": {"timeBeforeExpiry": "P30D"}, "action":
{"type": "Rotate"}}], "attributes": {"expiryTime": "P90D"}}'
body: '{"lifetimeActions": [{"trigger": {"timeAfterCreate": "P2M"}, "action":
{"type": "Rotate"}}], "attributes": {}}'
headers:
Accept:
- application/json
Expand All @@ -110,25 +110,25 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '132'
- '110'
Content-Type:
- application/json
User-Agent:
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy?api-version=7.3-preview
response:
body:
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeBeforeExpiry":"P30D"},"action":{"type":"Rotate"}},{"trigger":{"timeBeforeExpiry":"P30D"},"action":{"type":"Notify"}}],"attributes":{"expiryTime":"P90D","created":1632795088,"updated":1632795088}}'
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeAfterCreate":"P2M"},"action":{"type":"Rotate"}}],"attributes":{"created":1633547268,"updated":1633547419}}'
headers:
cache-control:
- no-cache
content-length:
- '327'
- '237'
content-type:
- application/json; charset=utf-8
date:
- Tue, 28 Sep 2021 20:28:55 GMT
- Wed, 06 Oct 2021 19:10:19 GMT
expires:
- '-1'
pragma:
Expand All @@ -142,7 +142,7 @@ interactions:
x-ms-keyvault-region:
- westus
x-ms-keyvault-service-version:
- 1.9.79.2
- 1.9.132.3
x-powered-by:
- ASP.NET
status:
Expand All @@ -158,21 +158,21 @@ interactions:
Connection:
- keep-alive
User-Agent:
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy?api-version=7.3-preview
response:
body:
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeBeforeExpiry":"P30D"},"action":{"type":"Rotate"}},{"trigger":{"timeBeforeExpiry":"P30D"},"action":{"type":"Notify"}}],"attributes":{"expiryTime":"P90D","created":1632795088,"updated":1632795088}}'
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeAfterCreate":"P2M"},"action":{"type":"Rotate"}}],"attributes":{"created":1633547268,"updated":1633547419}}'
headers:
cache-control:
- no-cache
content-length:
- '327'
- '237'
content-type:
- application/json; charset=utf-8
date:
- Tue, 28 Sep 2021 20:28:55 GMT
- Wed, 06 Oct 2021 19:10:19 GMT
expires:
- '-1'
pragma:
Expand All @@ -186,15 +186,15 @@ interactions:
x-ms-keyvault-region:
- westus
x-ms-keyvault-service-version:
- 1.9.79.2
- 1.9.132.3
x-powered-by:
- ASP.NET
status:
code: 200
message: OK
- request:
body: '{"lifetimeActions": [{"trigger": {"timeAfterCreate": "P2M"}, "action":
{"type": "Notify"}}], "attributes": {}}'
body: '{"lifetimeActions": [{"trigger": {"timeBeforeExpiry": "P30D"}, "action":
{"type": "Notify"}}], "attributes": {"expiryTime": "P90D"}}'
headers:
Accept:
- application/json
Expand All @@ -203,25 +203,25 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '110'
- '132'
Content-Type:
- application/json
User-Agent:
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy?api-version=7.3-preview
response:
body:
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeAfterCreate":"P2M"},"action":{"type":"Notify"}}],"attributes":{"created":1632795088,"updated":1632860936}}'
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeBeforeExpiry":"P30D"},"action":{"type":"Notify"}}],"attributes":{"expiryTime":"P90D","created":1633547268,"updated":1633547419}}'
headers:
cache-control:
- no-cache
content-length:
- '238'
- '259'
content-type:
- application/json; charset=utf-8
date:
- Tue, 28 Sep 2021 20:28:55 GMT
- Wed, 06 Oct 2021 19:10:19 GMT
expires:
- '-1'
pragma:
Expand All @@ -235,7 +235,7 @@ interactions:
x-ms-keyvault-region:
- westus
x-ms-keyvault-service-version:
- 1.9.79.2
- 1.9.132.3
x-powered-by:
- ASP.NET
status:
Expand All @@ -251,21 +251,21 @@ interactions:
Connection:
- keep-alive
User-Agent:
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-keyvault-keys/4.5.0b4 Python/3.9.0 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy?api-version=7.3-preview
response:
body:
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeAfterCreate":"P2M"},"action":{"type":"Notify"}}],"attributes":{"created":1632795088,"updated":1632860936}}'
string: '{"id":"https://vaultname.vault.azure.net/keys/livekvtestrotation-keybd0f17af/rotationpolicy","lifetimeActions":[{"trigger":{"timeBeforeExpiry":"P30D"},"action":{"type":"Notify"}}],"attributes":{"expiryTime":"P90D","created":1633547268,"updated":1633547419}}'
headers:
cache-control:
- no-cache
content-length:
- '238'
- '259'
content-type:
- application/json; charset=utf-8
date:
- Tue, 28 Sep 2021 20:28:56 GMT
- Wed, 06 Oct 2021 19:10:19 GMT
expires:
- '-1'
pragma:
Expand All @@ -279,7 +279,7 @@ interactions:
x-ms-keyvault-region:
- westus
x-ms-keyvault-service-version:
- 1.9.79.2
- 1.9.132.3
x-powered-by:
- ASP.NET
status:
Expand Down
Loading

0 comments on commit 2a7a465

Please sign in to comment.