-
Notifications
You must be signed in to change notification settings - Fork 97
Added enableSoftDelete, DeletedVault, and Purge to method group #432
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
Changes from 7 commits
8b01f9b
840bc67
6b777b9
e3cedf9
ffb3d8c
8ee4d5b
665b61d
5f55bb3
531c670
a4dca55
929fb8b
dcd32d0
b4cdc48
bec4326
e547233
b739852
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package com.microsoft.azure.management.keyvault; | ||
|
|
||
| import com.microsoft.azure.management.apigeneration.Fluent; | ||
| import com.microsoft.azure.management.keyvault.implementation.CheckNameAvailabilityResultInner; | ||
| import com.microsoft.azure.management.resources.fluentcore.model.HasInner; | ||
|
|
||
| /** | ||
| * The CheckNameAvailability operation response wrapper. | ||
| * | ||
| */ | ||
| @Fluent(ContainerName = "/Microsoft.Azure.Management.Fluent.KeyVault") | ||
| public interface CheckNameAvailabilityResult extends | ||
| HasInner<CheckNameAvailabilityResultInner>{ | ||
|
|
||
| /** | ||
| * Get the nameAvailable value. | ||
| * | ||
| * @return the nameAvailable value | ||
| */ | ||
| public Boolean nameAvailable(); | ||
|
|
||
| /** | ||
| * Get the reason value. | ||
| * | ||
| * @return the reason value | ||
| */ | ||
| public Reason reason(); | ||
|
|
||
| /** | ||
| * Get the message value. | ||
| * | ||
| * @return the message value | ||
| */ | ||
| public String message(); | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.microsoft.azure.management.keyvault; | ||
|
|
||
| import com.microsoft.azure.management.apigeneration.Fluent; | ||
| import com.microsoft.azure.management.keyvault.implementation.DeletedVaultInner; | ||
| import com.microsoft.azure.management.resources.fluentcore.arm.models.HasId; | ||
| import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; | ||
| import com.microsoft.azure.management.resources.fluentcore.model.HasInner; | ||
|
|
||
| /** | ||
| * An immutable client-side representation of an Azure Key Vault. | ||
| */ | ||
| @Fluent(ContainerName = "/Microsoft.Azure.Management.Fluent.KeyVault") | ||
| public interface DeletedVault extends | ||
| HasInner<DeletedVaultInner>, | ||
| HasName, | ||
| HasId { | ||
|
|
||
|
Contributor
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. @tiffanyachen In Fluent we try to avoid exposing the users to the *Inner classes (or any other class that is part of the "implementation" folder except for the *Manager). In this particular case we can "promote" the DeletedVaultProperties properties as methods of this interface rather than having the user navigate through two levels of indirection in order to reach them (one being the .inner()). Would you be able to add the corresponding methods please? The exact mapping is: |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,24 @@ public interface Vault extends | |
| * retrieve secrets from the key vault. | ||
| */ | ||
| boolean enabledForTemplateDeployment(); | ||
|
|
||
| /** | ||
| * @return whether soft delete is enabled for this key vault. | ||
| */ | ||
| boolean softDeleteEnabled(); | ||
|
Member
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. To be consistent with naming pattern of other existing properties returning bool
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. @schaabs and I discussed this a bit and decided to go with this pattern to make it consistent with our other languages.
Contributor
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. @tiffanyachen in this case you need to be consistent with the rest of the Java SDK naming patterns for this service and not other languages. There's a good reason and lots of review discussions before we chose the naming we use today. So unless you want to change all the other method names and introduce your own new naming pattern, then work around the backward compatibility breaks resulted from these change, then my recommendation is to stay with @anuchandy feedback. 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. @anuchandy @milismsft In the case of the first three fields, enableForDeployment, enabledForDiskEncryption, and enabledForTemplateDeployment, they are named this way because the user is enabling the vault to be accesed FOR arm deployments, disk encryption, and template deployment. In the case of softDeleteEnabled and purgeProtectionEnabled the user is enabling the features soft delete and purge protection on the vault.
Contributor
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. @schaabs I don't understand how is soft delete any different then the others... It looks like it is required for instance when setting up SQL TDE (see customer report Azure/azure-libraries-for-net#315).
Contributor
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. Also the "with" methods could be renamed as "withSoftDelete()" and "withPurgeProtection()" IF these properties are indeed vault only properties. |
||
|
|
||
| /** | ||
| * @return whether purge protection is enabled for this key vault. | ||
| * Purge protection can only be enabled if soft delete is enabled. | ||
| */ | ||
| boolean purgeProtectionEnabled(); | ||
|
|
||
| /** | ||
| * Get the createMode value. | ||
| * | ||
| * @return the createMode value | ||
| */ | ||
| public CreateMode createMode(); | ||
|
|
||
| /************************************************************** | ||
| * Fluent interfaces to provision a Vault | ||
|
|
@@ -183,6 +201,20 @@ interface WithConfigurations { | |
| * @return the next stage of key vault definition | ||
| */ | ||
| WithCreate withTemplateDeploymentEnabled(); | ||
|
|
||
| /** | ||
| * Enable soft delete for the key vault. | ||
| * | ||
| * @return the next stage of key vault definition | ||
| */ | ||
| WithCreate withSoftDeleteEnabled(); | ||
|
|
||
| /** | ||
| * Enable purge protection for the key vault; valid only if soft delete is also enabled. | ||
| * | ||
| * @return the next stage of key vault definition. | ||
| */ | ||
| WithCreate withPurgeProtectionEnabled(); | ||
|
|
||
| /** | ||
| * Disable Azure Virtual Machines to retrieve certificates stored as secrets from the key vault. | ||
|
|
@@ -204,6 +236,13 @@ interface WithConfigurations { | |
| * @return the next stage of key vault definition | ||
| */ | ||
| WithCreate withTemplateDeploymentDisabled(); | ||
|
|
||
| /** | ||
| * Set the createMode value. | ||
| * | ||
| * @return the next stage of key vault definition | ||
| */ | ||
| WithCreate withCreateMode(CreateMode createMode); | ||
|
Contributor
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. @tiffanyachen Could CreateMode.RECOVER be used with an existing Key Vault resource that has not been deleted? What impact other settings prior to reaching this method during the create flow will have when this value is set?
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. This can only be used for recovering a deleted vault with soft delete enabled; in any other case it'll result in an error.
Contributor
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. @tiffanyachen If this is the case then we will have to rework a bit the "Create()" flow. What's the maximum properties in the JSON body that can be passed to the create op when CreateMode.RECOVER is specified? |
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -285,6 +324,20 @@ interface WithConfigurations { | |
| * @return the key vault update stage | ||
| */ | ||
| Update withTemplateDeploymentEnabled(); | ||
|
|
||
| /** | ||
| * Enable soft delete for the key vault. | ||
| * | ||
| * @return the next stage of key vault definition | ||
| */ | ||
| Update withSoftDeleteEnabled(); | ||
|
Member
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. Is it possible to disable soft delete once enabled? if so we may need
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. SoftDelete and PurgeProtection can't be disabled. |
||
|
|
||
| /** | ||
| * Enable purge protection for the key vault; valid only if soft delete is also enabled. | ||
| * | ||
| * @return the next stage of key vault definition. | ||
| */ | ||
| Update withPurgeProtectionEnabled(); | ||
|
|
||
| /** | ||
| * Disable Azure Virtual Machines to retrieve certificates stored as secrets from the key vault. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.microsoft.azure.management.keyvault; | ||
| import com.microsoft.azure.management.apigeneration.Fluent; | ||
| import com.microsoft.azure.management.keyvault.implementation.VaultAccessPolicyParametersInner; | ||
| import com.microsoft.azure.management.resources.fluentcore.model.HasInner; | ||
|
|
||
| /** | ||
| * Parameters for updating the access policy in a vault. | ||
| */ | ||
| @Fluent(ContainerName = "/Microsoft.Azure.Management.Fluent.KeyVault") | ||
| public interface VaultAccessPolicyParameters extends | ||
| HasInner<VaultAccessPolicyParametersInner>{ | ||
|
|
||
|
Contributor
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. @tiffanyachen similar comments I made about the DeletedVault interface; we should "promote" the properties from VaultAccessPolicyPropertiesInner class as methods of this interface. Also the interface should extend HasId(), HasName() and expose type() and location(). |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect to see here some methods such as isAvailable(), unavailabilityReason() and unavailabilityMessage()...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in latest commit