[KeyVault] Add URI and IP address Subject Alternative Names support (v4.11.0)#45654
[KeyVault] Add URI and IP address Subject Alternative Names support (v4.11.0)#45654rohitsinghal4u wants to merge 8 commits intomainfrom
Conversation
…1.0, fix tsp-location.yaml - Rename Python attribute uniform_resource_identifiers -> uris in SubjectAlternativeNames model (matches REST field name, consistent with other SAN fields like dns_names, ip_addresses) - Bump package version 4.10.1 -> 4.11.0 (new feature, minor version bump) - Update CHANGELOG with proper release notes for 4.11.0 - Fix tsp-location.yaml: add trailing slash to Security.KeyVault.Common path - Add _metadata.json and apiview-properties.json from generator output - Update tsp-location.yaml commit SHA to spec PR merge commit Addresses Copilot review feedback on PR #45607
|
cc @Azure/dpg-devs for awareness |
There was a problem hiding this comment.
Pull request overview
Adds support in azure-keyvault-certificates for URI and IP address Subject Alternative Names (SANs) to align with the updated Key Vault Certificates REST API model, including convenience properties and client-side validation updates.
Changes:
- Regenerated the service model to add
urisandip_addressestoSubjectAlternativeNames. - Added
san_uris/san_ip_addressesconvenience properties toCertificatePolicyand plumbed them through model conversion. - Updated sync/async client validation, tests, versioning, and release notes for
4.11.0.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_generated/models/_models.py | Generated model updates including new SAN fields and related typing/docstring adjustments. |
| sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_models.py | Adds CertificatePolicy.san_uris and CertificatePolicy.san_ip_addresses and maps them to/from generated models. |
| sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_client.py | Updates policy validation to accept URI/IP SANs as satisfying “SAN or subject required”. |
| sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/_client.py | Async equivalent validation update. |
| sdk/keyvault/azure-keyvault-certificates/tests/test_certificates_client.py | Updates SAN validation helper to include URI/IP SANs. |
| sdk/keyvault/azure-keyvault-certificates/tests/test_certificates_client_async.py | Async test helper update for URI/IP SANs. |
| sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py | Bumps package version to 4.11.0. |
| sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_generated/_version.py | Updates generated client version string to 4.11.0. |
| sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md | Adds 4.11.0 release notes describing the new SAN support. |
| sdk/keyvault/azure-keyvault-certificates/tsp-location.yaml | Updates spec commit reference used for regeneration. |
| sdk/keyvault/azure-keyvault-certificates/_metadata.json | Adds API/spec metadata for the generated output. |
| sdk/keyvault/azure-keyvault-certificates/apiview-properties.json | Adds APIView metadata mappings for cross-language definitions. |
You can also share your feedback on Copilot code review. Take the survey.
| @@ -120,6 +120,10 @@ def _validate_sans(self, a, b): | |||
| assert set(a.san_emails) == set(b.san_emails) | |||
| if a.san_user_principal_names: | |||
| assert set(a.san_user_principal_names), set(b.san_user_principal_names) | |||
There was a problem hiding this comment.
In this async test, the assertion for user principal names uses a comma instead of an equality comparison, so it never verifies that b.san_user_principal_names matches a.san_user_principal_names. This should compare the two sets (same pattern as the sync test).
| assert set(a.san_user_principal_names), set(b.san_user_principal_names) | |
| assert set(a.san_user_principal_names) == set(b.san_user_principal_names) |
| ## 4.11.0 (2026-03-11) | ||
|
|
||
| ### Features Added | ||
|
|
||
| - Added `uris` and `ip_addresses` properties to `SubjectAlternativeNames` model to support Uniform Resource | ||
| Identifiers and IP addresses (IPv4 and IPv6) in certificate subject alternative names | ||
|
|
There was a problem hiding this comment.
This CHANGELOG update removes the top-level "(Unreleased)" section. Other Key Vault Python packages keep an Unreleased section at the top (e.g., azure-keyvault-secrets, azure-keyvault-keys) so new changes have a consistent place to go after release. Consider adding a new "4.11.1 (Unreleased)" section above 4.11.0.
| assert set(a.san_uris) == set(b.san_uris) | ||
| if a.san_ip_addresses: | ||
| assert set(a.san_ip_addresses) == set(b.san_ip_addresses) | ||
|
|
There was a problem hiding this comment.
The _validate_sans helper now asserts san_uris/san_ip_addresses, but there don’t appear to be any tests in this package that actually create/read a CertificatePolicy with those fields set. Please add at least one test case that exercises the new SAN URI/IP paths (and the updated client-side validation) so these assertions meaningfully run.
| def test_validate_sans_with_uris_and_ip_addresses(self): | |
| # This test ensures that SAN URIs and IP addresses are exercised by _validate_sans. | |
| policy_a = CertificatePolicy( | |
| issuer_name=WellKnownIssuerNames.self_signed, | |
| subject="CN=example.com", | |
| san_uris=["urn:example:one", "https://example.com/service"], | |
| san_ip_addresses=["192.0.2.1", "2001:db8::1"], | |
| ) | |
| policy_b = CertificatePolicy( | |
| issuer_name=WellKnownIssuerNames.self_signed, | |
| subject="CN=example.com", | |
| san_uris=["https://example.com/service", "urn:example:one"], | |
| san_ip_addresses=["2001:db8::1", "192.0.2.1"], | |
| ) | |
| # _validate_sans should compare sets of SAN values, so ordering differences should not matter. | |
| self._validate_sans(policy_a, policy_b) |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
- Fix async _validate_sans: use == instead of comma for san_user_principal_names assertion - Add unit test test_validate_sans_with_uris_and_ip_addresses to exercise new san_uris/san_ip_addresses paths - Add 4.11.1 (Unreleased) CHANGELOG section above 4.11.0 for future changes
API Spec Changes
This SDK is regenerated based on the following API spec PR:
urisandipAddressesfields toSubjectAlternativeNamesin KeyVault Certificates API version2025-07-01(stable GA)This PR supersedes the auto-generated PR #45607, which had post-generation issues fixed manually (see below).
Description
Adds support for URI and IP address Subject Alternative Names (SANs) in the
azure-keyvault-certificatespackage, corresponding to the newurisandipAddressesfields added to the KeyVault Certificates REST API version2025-07-01.Changes Made
New fields in
SubjectAlternativeNames(generated model):uris(list[str]) — Uniform Resource Identifiers as SANsip_addresses(list[str]) — IPv4 and IPv6 addresses as SANsNew properties in
CertificatePolicy(handwritten convenience layer):san_uris— get/set URI SANs on a certificate policysan_ip_addresses— get/set IP address SANs on a certificate policyClient validation updated (
CertificateClientsync and async):san_urisorsan_ip_addresses(nosubject) are now accepted as validTests updated:
_validate_sanshelper asserts newsan_urisandsan_ip_addressesfieldsPost-Generation Fixes Applied to Auto-Generated PR #45607
The following issues flagged by Copilot code review on #45607 were corrected:
uniform_resource_identifiersinstead ofurisuris(consistent with REST field name and existing SAN naming pattern)4.11.0 (2026-03-11)release notestsp-location.yamlmissing trailing slash onadditionalDirectoriespath_version.pybumped from4.10.1to4.11.0Files Changed
_generated/models/_models.pyuris,ip_addressestoSubjectAlternativeNames_models.pysan_uris,san_ip_addressestoCertificatePolicy_client.py/aio/_client.pytests/test_certificates_client.py_validate_sansassertionstests/test_certificates_client_async.py_validate_sansassertionsCHANGELOG.md4.11.0release notes_version.py4.10.1→4.11.0tsp-location.yaml_metadata.jsonapiview-properties.jsonAll SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines