Skip to content
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

Align the casing of LifetimeActionsType with the service. #24475

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand All @@ -37,15 +37,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2195,20 +2195,25 @@
"type": "string",
"description": "The type of the action.",
"enum": [
"Rotate",
"rotate",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k in one case u are adding Rotate while keeping rotate, in the other case you are replacing notify with Notify. why the difference?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkmanda @adarce was there a reason the old rotate value was left in? This is causing us issues consuming as we don't expect valid enum values to vary only by case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkmanda Key Vault returned "Notify", not "notify", so that was replaced. Managed HSM doesn't support notify, so there's no camelCase member.

@danielrbradley what are you using to consume? If autorest, it should work. Because Managed HSM and Key Vault share a swagger, adding both Key Vault's "Rotate" and Managed HSM's "rotate" was deemed the least worse option because this behavior has been in the services for around a year. Changing the behavior - which Key Vault did to match the swagger - was a breaking change and was reverted. Its unfortunate, but the service behavior change was much worse. Perhaps you could preprocess the swagger to remove one of the "rotate" values and make sure your enum parsing is case-insensitive for key rotation policy.

"notify"
"Notify"
],
"x-ms-enum": {
"name": "ActionType",
"modelAsString": false,
"values": [
{
"value": "Rotate",
"description": "Rotate the key based on the key policy. Key Vault only. Managed HSM uses camelCase 'rotate' instead."
},
{
"value": "rotate",
"description": "Rotate the key based on the key policy."
"description": "Rotate the key based on the key policy. Managed HSM only. Key Vault uses PascalCase 'Rotate' instead."
},
{
"value": "notify",
"description": "Trigger event grid events. For preview, the notification time is not configurable and it is default to 30 days before expiry."
"value": "Notify",
"description": "Trigger Event Grid events. Defaults to 30 days before expiry. Key Vault only."
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand All @@ -37,15 +37,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2223,20 +2223,25 @@
"type": "string",
"description": "The type of the action.",
"enum": [
"Rotate",
"rotate",
"notify"
"Notify"
],
"x-ms-enum": {
"name": "ActionType",
"modelAsString": false,
"values": [
{
"value": "Rotate",
"description": "Rotate the key based on the key policy. Key Vault only. Managed HSM uses camelCase 'rotate' instead."
},
{
"value": "rotate",
"description": "Rotate the key based on the key policy."
"description": "Rotate the key based on the key policy. Managed HSM only. Key Vault uses PascalCase 'Rotate' instead."
},
{
"value": "notify",
"description": "Trigger event grid events. For preview, the notification time is not configurable and it is default to 30 days before expiry."
"value": "Notify",
"description": "Trigger Event Grid events. Defaults to 30 days before expiry. Key Vault only."
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand All @@ -37,15 +37,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2201,20 +2201,25 @@
"type": "string",
"description": "The type of the action.",
"enum": [
"Rotate",
"rotate",
"notify"
"Notify"
],
"x-ms-enum": {
"name": "KeyRotationPolicyAction",
"name": "ActionType",
"modelAsString": false,
"values": [
{
"value": "Rotate",
"description": "Rotate the key based on the key policy. Key Vault only. Managed HSM uses camelCase 'rotate' instead."
},
{
"value": "rotate",
"description": "Rotate the key based on the key policy."
"description": "Rotate the key based on the key policy. Managed HSM only. Key Vault uses PascalCase 'Rotate' instead."
},
{
"value": "notify",
"description": "Trigger event grid events. For preview, the notification time is not configurable and it is default to 30 days before expiry."
"value": "Notify",
"description": "Trigger Event Grid events. Defaults to 30 days before expiry. Key Vault only."
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand All @@ -37,15 +37,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2196,20 +2196,25 @@
"type": "string",
"description": "The type of the action.",
"enum": [
"Rotate",
"rotate",
"notify"
"Notify"
],
"x-ms-enum": {
"name": "ActionType",
"modelAsString": false,
"values": [
{
"value": "Rotate",
"description": "Rotate the key based on the key policy. Key Vault only. Managed HSM uses camelCase 'rotate' instead."
},
{
"value": "rotate",
"description": "Rotate the key based on the key policy."
"description": "Rotate the key based on the key policy. Managed HSM only. Key Vault uses PascalCase 'Rotate' instead."
},
{
"value": "notify",
"description": "Trigger event grid events. For preview, the notification time is not configurable and it is default to 30 days before expiry."
"value": "Notify",
"description": "Trigger Event Grid events. Defaults to 30 days before expiry. Key Vault only."
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand All @@ -37,15 +37,15 @@
"timeAfterCreate": "P90D"
},
"action": {
"type": "rotate"
"type": "Rotate"
}
},
{
"trigger": {
"timeBeforeExpiry": "P30D"
},
"action": {
"type": "notify"
"type": "Notify"
}
}
],
Expand Down
Loading