Skip to content

Commit e16945f

Browse files
authored
Merge pull request #4699 from dragav/feature/deprecatepurgedisable
KeyVault: deprecating the PurgeDisabled flag from secret and key attributes
2 parents ad4b8f3 + 8f72a2b commit e16945f

File tree

4 files changed

+5
-25
lines changed

4 files changed

+5
-25
lines changed

src/ResourceManager/KeyVault/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Deprecating the PurgeDisabled flag from Key, Secret and Certificate attributes, respectively.
22+
* The flag is being superseded by the RecoveryLevel attribute.
2123

2224
## Version 3.4.0
2325
* New/updated Cmdlets to support soft-delete for KeyVault certificates

src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyAttributes.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ internal KeyAttributes(bool? enabled, DateTime? expires, DateTime? notBefore, st
3535
this.KeyType = keyType;
3636
this.KeyOps = keyOps;
3737
this.Tags = tags;
38-
this.PurgeDisabled = false;
3938
}
4039

4140
internal KeyAttributes(bool? enabled, DateTime? expires, DateTime? notBefore, string keyType,
@@ -50,7 +49,6 @@ internal KeyAttributes(bool? enabled, DateTime? expires, DateTime? notBefore, st
5049
this.Updated = updated;
5150
this.RecoveryLevel = deletionRecoveryLevel;
5251
this.Tags = (tags == null) ? null : tags.ConvertToHashtable();
53-
this.PurgeDisabled = false;
5452
}
5553

5654
public bool? Enabled { get; set; }
@@ -67,12 +65,7 @@ internal KeyAttributes(bool? enabled, DateTime? expires, DateTime? notBefore, st
6765

6866
public DateTime? Updated { get; private set; }
6967

70-
/// <summary>
71-
/// Obsolete flag indicating that the key is protected against purge.
72-
/// </summary>
73-
/// <remarks>
74-
/// Deprecated, will be removed in the next PowerShell release.
75-
/// </remarks>
68+
[Obsolete("The PurgeDisabled property is being deprecated and will be removed in a future release. Please use the RecoveryLevel property instead.")]
7669
public bool PurgeDisabled { get; private set; }
7770

7871
public string RecoveryLevel { get; private set; }

src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyIdentityItem.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ internal KeyIdentityItem(Azure.KeyVault.Models.KeyItem keyItem, VaultUriHelper v
3838
Updated = keyItem.Attributes.Updated;
3939
RecoveryLevel = keyItem.Attributes.RecoveryLevel;
4040
Tags = (keyItem.Tags == null) ? null : keyItem.Tags.ConvertToHashtable();
41-
42-
43-
// the PurgeDisabled field was deprecated, but is kept in the
44-
// PSH SDK until the first breaking-change release.
45-
PurgeDisabled = false;
4641
}
4742

4843
internal KeyIdentityItem(KeyBundle keyBundle)
@@ -61,10 +56,6 @@ internal KeyIdentityItem(KeyBundle keyBundle)
6156
Updated = keyBundle.Attributes.Updated;
6257
RecoveryLevel = keyBundle.Attributes.RecoveryLevel;
6358
Tags = keyBundle.Attributes.Tags;
64-
65-
// the PurgeDisabled field was deprecated, but is kept in the
66-
// PSH SDK until the first breaking-change release.
67-
PurgeDisabled = false;
6859
}
6960

7061
public bool? Enabled { get; set; }
@@ -77,6 +68,7 @@ internal KeyIdentityItem(KeyBundle keyBundle)
7768

7869
public DateTime? Updated { get; private set; }
7970

71+
[Obsolete( "The PurgeDisabled property is being deprecated and will be removed in a future release. Please use the RecoveryLevel property instead." )]
8072
public bool PurgeDisabled { get; private set; }
8173

8274
public string RecoveryLevel { get; private set; }

src/ResourceManager/KeyVault/Commands.KeyVault/Models/SecretAttributes.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ internal SecretAttributes(bool? enabled, DateTime? expires, DateTime? notBefore,
3333
this.NotBefore = notBefore;
3434
this.ContentType = contentType;
3535
this.Tags = tags;
36-
this.PurgeDisabled = false;
3736
}
3837

3938
internal SecretAttributes(bool? enabled, DateTime? expires, DateTime? notBefore,
@@ -47,7 +46,6 @@ internal SecretAttributes(bool? enabled, DateTime? expires, DateTime? notBefore,
4746
this.ContentType = contentType;
4847
this.RecoveryLevel = deletionRecoveryLevel;
4948
this.Tags = (tags == null) ? null : tags.ConvertToHashtable();
50-
this.PurgeDisabled = false;
5149
}
5250

5351
public bool? Enabled { get; set; }
@@ -64,12 +62,7 @@ internal SecretAttributes(bool? enabled, DateTime? expires, DateTime? notBefore,
6462

6563
public Hashtable Tags { get; set; }
6664

67-
/// <summary>
68-
/// Obsolete flag indicating that the secret is protected against purge.
69-
/// </summary>
70-
/// <remarks>
71-
/// Deprecated, will be removed in the next PowerShell release.
72-
/// </remarks>
65+
[Obsolete( "The PurgeDisabled property is being deprecated and will be removed in a future release. Please use the RecoveryLevel property instead." )]
7366
public bool PurgeDisabled { get; private set; }
7467

7568
public string RecoveryLevel { get; private set; }

0 commit comments

Comments
 (0)