-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{Keyvault} az keyvault security-domain
: Migrate security domain to use track2 SDK
#30252
Conversation
️✔️AzureCLI-FullTest
|
Hi @evelyn-ys, |
️✔️AzureCLI-BreakingChangeTest
|
Migrate security domain to use track2 SDK |
@@ -299,7 +300,6 @@ def default_api_version(self): | |||
ResourceType.DATA_KEYVAULT_CERTIFICATES: None, | |||
ResourceType.DATA_KEYVAULT_KEYS: None, | |||
ResourceType.DATA_KEYVAULT_SECRETS: None, | |||
ResourceType.DATA_KEYVAULT: '2016-10-01', |
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.
Is Azure Stack still supported?
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.
security-domain
is never supported in Azure Stack. But key
/secret
/certificate
are supported so we have DATA_KEYVAULT_KEYS
/DATA_KEYVAULT_SECRETS
/DATA_KEYVAULT_CERTIFICATES
definition in azure stack
ret = { | ||
'status': getattr(result, 'status', None), | ||
'statusDetails': getattr(result, 'status_details', None) | ||
} |
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.
Why not rely on knack's serialization?
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.
Because SDK use a strange ModelBase which can't be serialized by knack
@@ -202,8 +182,10 @@ def data_plane_azure_keyvault_administration_access_control_client(cli_ctx, comm | |||
|
|||
vault_url, credential, version = _prepare_data_plane_azure_keyvault_client( | |||
cli_ctx, command_args, ResourceType.DATA_KEYVAULT_ADMINISTRATION_ACCESS_CONTROL) | |||
client_kwargs = prepare_client_kwargs_track2(cli_ctx) | |||
client_kwargs.pop('http_logging_policy') |
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.
Is this because this SDK doesn't support http_logging_policy
?
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.
Keyvault data plane SDKs have fixed http_logging_policy
and don't accept customization
c.extra('hsm_name', hsm_url_type, required=False, | ||
help='Name of the HSM. Can be omitted if --id is specified.') |
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.
If hsm_name
is now an "extra" argument, how can it be used to create the SDK client?
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.
It's now accepted when creating client in client_factory.py
instead of calling sdk in custom.py
sd_jwk['x5c'] = [Utils.security_domain_b64_url_encode_for_x5c(public_bytes)] # only one cert, not a chain | ||
sd_jwk['x5t'] = Utils.security_domain_b64_url_encode(hashlib.sha1(public_bytes).digest()) | ||
sd_jwk['x5t#S256'] = Utils.security_domain_b64_url_encode(hashlib.sha256(public_bytes).digest()) | ||
sd_jwk['key_ops'] = ['verify', 'encrypt', 'wrapKey'] |
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.
Does Track 2 SDK now require dict
instead of an SDK object?
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.
Track2 SDK can accept both model object and dict. I don't want to import many models from SDK so here use simple dict
Related command
az keyvault security-domain
Description
Pending SDK release Azure/azure-sdk-for-python#37929
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a
: Make some customer-facing breaking change[Component Name 2]
az command b
: Add some customer-facing featureThis 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.