-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[KeyVault] BREAKING CHANGE: Support soft-delete feature for managed-HSM. keyvault delete --hsm-name will perform soft delete on a MHSM.
#17834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
435a1ad
Merge branch 'release' into dev
houk-ms f0be844
Merge remote-tracking branch 'origin/dev' into dev
houk-ms 0b9d92c
Merge remote-tracking branch 'origin/dev' into dev
houk-ms 5b775d0
Merge remote-tracking branch 'origin/dev' into dev
houk-ms 22fffd0
Merge remote-tracking branch 'origin/dev' into dev
houk-ms c1205ff
Merge remote-tracking branch 'origin/dev' into dev
houk-ms 000d07e
Merge remote-tracking branch 'origin/dev' into dev
houk-ms 96553de
Merge remote-tracking branch 'origin/dev' into dev
houk-ms f9ad8d5
Merge remote-tracking branch 'origin/dev' into dev
houk-ms 82d13fd
Merge remote-tracking branch 'origin' into dev
houk-ms 1e11f81
Merge remote-tracking branch 'origin/dev' into dev
houk-ms dfec710
draft
houk-ms 918db2b
Merge remote-tracking branch 'origin/dev' into mhsm-ga
houk-ms 70ad92f
Merge remote-tracking branch 'origin/dev' into mhsm-ga
houk-ms a513e74
support keyvault soft-delete feature
houk-ms 41b45f7
merge dev
houk-ms 6dfaf09
update test
houk-ms 959dc4d
Merge remote-tracking branch 'origin/dev' into mhsm-ga
houk-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -289,8 +289,8 @@ def validate_deleted_vault_or_hsm_name(cmd, ns): | |
| vault_name = getattr(ns, 'vault_name', None) | ||
| hsm_name = getattr(ns, 'hsm_name', None) | ||
|
|
||
| if hsm_name: | ||
| raise InvalidArgumentValueError('Operation "purge" has not been supported for HSM.') | ||
| if hsm_name and 'keyvault recover' in cmd.name: | ||
| raise InvalidArgumentValueError('Operation "recover" has not been supported for HSM.') | ||
|
|
||
| if not vault_name and not hsm_name: | ||
| raise CLIError('Please specify --vault-name or --hsm-name.') | ||
|
|
@@ -312,25 +312,26 @@ def validate_deleted_vault_or_hsm_name(cmd, ns): | |
| if vault_name: | ||
| id_comps = parse_resource_id(resource.properties.vault_id) | ||
| else: | ||
| id_comps = parse_resource_id(resource.properties.id) | ||
| id_comps = parse_resource_id(resource.id) | ||
|
|
||
| # otherwise, iterate through deleted vaults to find one with a matching name | ||
| else: | ||
| for v in client.list_deleted(): | ||
| if vault_name: | ||
| id_comps = parse_resource_id(v.properties.vault_id) | ||
| else: | ||
| id_comps = parse_resource_id(v.properties.id) | ||
| id_comps = parse_resource_id(v.id) | ||
| if id_comps['name'].lower() == resource_name.lower(): | ||
| resource = v | ||
| ns.location = resource.properties.location | ||
| ns.location = resource.properties.location if vault_name \ | ||
| else resource.additional_properties.get('location') | ||
| break | ||
|
|
||
| # if the vault was not found, throw an error | ||
| if not resource: | ||
| raise CLIError('No deleted Vault or HSM was found with name ' + resource_name) | ||
|
|
||
| if 'keyvault purge' not in cmd.name: | ||
| if 'keyvault purge' not in cmd.name and 'keyvault show-deleted' not in cmd.name: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these two comands won't need |
||
| setattr(ns, 'resource_group_name', getattr(ns, 'resource_group_name', None) or id_comps['resource_group']) | ||
|
|
||
| # resource_group_name must match the resource group of the deleted vault | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.