[Keyvault] aes key size support#33522
Open
MaddyMicrosoft wants to merge 3 commits into
Open
Conversation
Pulls in KeyProperties.key_size so CLI can surface key_size for AES (oct/oct-HSM) and RSA keys in a follow-up change.
️✔️AzureCLI-FullTest
|
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
Collaborator
|
Keyvault |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Key Vault key output transformers so az keyvault key show and az keyvault key list surface AES key size (keySize) in CLI output, and adds unit tests to validate the new behavior across key types (including deleted keys).
Changes:
- Update Key Vault key transformers to include
keySizein both show and list transformed outputs. - Add unit tests covering AES/AES-HSM, RSA, deleted keys, list output, and passthrough behavior.
- Bump the
azure-keyvault-keysdependency version pin.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/setup.py | Updates the pinned azure-keyvault-keys dependency version used by the CLI package. |
| src/azure-cli/requirements.py3.windows.txt | Updates Windows pinned dependency for azure-keyvault-keys. |
| src/azure-cli/requirements.py3.Linux.txt | Updates Linux pinned dependency for azure-keyvault-keys. |
| src/azure-cli/requirements.py3.Darwin.txt | Updates macOS pinned dependency for azure-keyvault-keys. |
| src/azure-cli/azure/cli/command_modules/keyvault/_transformers.py | Surfaces keySize in transformed outputs for key show/list (including deleted key handling). |
| src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_transformers.py | Adds transformer-focused unit tests to cover keySize behavior and edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+9
| from azure.keyvault.keys import JsonWebKey, KeyProperties, KeyVaultKey | ||
| from azure.keyvault.keys._models import DeletedKey |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related command
az keyvault key showaz keyvault key listDescription
Add AES key size support to Key Vault key output by surfacing
keySizein the transformed results foraz keyvault key showandaz keyvault key list.This PR:
azure-keyvault-keysfrom4.11.0to4.12.0b1so AES key size is available from the SDKkeySizeto key output intransform_key_outputkeySizeto list output intransform_key_list_outputEffect:
keySizeasNonewhen not provided by the SDKkeySizeTesting Guide
Run the new transformer unit tests:
python -m pytest src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_transformers.pyValidate command output manually with AES keys:
az keyvault key show --vault-name <vault-name> --name <aes-key-name>attributes.keySizeis present, for example128or256az keyvault key list --vault-name <vault-name>keySizeaz keyvault key show --vault-name <vault-name> --name <rsa-key-name>attributes.keySizeis present and remainsnull/Nonewhen the SDK does not provide a valueIf available, also validate deleted key output:
az keyvault key show-deleted --vault-name <vault-name> --name <deleted-aes-key-name>attributes.keySizeis includedHistory Notes
[Key Vault]
az keyvault key show/list: Add AES key size to outputThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.