-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[keyvault] add parse id feature for certs #13321
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
Conversation
sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_parse_id.py
Outdated
Show resolved
Hide resolved
sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_parse_id.py
Outdated
Show resolved
Hide resolved
sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_parse_id.py
Outdated
Show resolved
Hide resolved
|
@iscai-msft I'll review this after my PR gets approved and merged. Sorry for the delay! |
|
@iscai-msft On TypeScript we will be using: |
…into expose_parse_vault_id * 'master' of https://github.com/Azure/azure-sdk-for-python: (37 commits) [text analytics] add versionadded sphinx documentation (Azure#13450) [text analytics] add bing_id property to LinkedEntity class (Azure#13446) fix typing for paging methods (Azure#13410) [text analytics] add domain_filter param (Azure#13451) fix issue Azure#11658 for is_valid_resource_id (Azure#11709) added create_table_if_not_exists method to table service client (Azure#13385) [ServiceBus] Test and failure improvements (Azure#13345) Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275) Switch retry (Azure#13264) [ServiceBus] ServiceBusClient close spawned children (Azure#13077) fixing version issue by not overwriting the version with the semantic… (Azure#13411) clean up reference and tests (Azure#13412) Consistent returns (Azure#13245) [text analytics] return None for offset and length for v3.0 (Azure#13382) edit all authentication files and add a test (Azure#13355) Add managed_identity_client_id argument to DefaultAzureCredential (Azure#13218) [text analytics] add string-index-type support (Azure#13378) [text analytics] fix error response if pii entities is called from v3.0 client (Azure#13383) Send spec (Azure#13143) Anomaly Detector 3.0.0b2 release (Azure#13351) ...
|
@sadasant I'm going to keep the class shared across the different libraries (I can't think of a reason for users to instantiate their own class, so shouldn't run into namespace collisions). I'll make the method specific to each library though, i.e. for certs I'll do |
| from _shared.test_case import KeyVaultTestCase | ||
|
|
||
|
|
||
| class TestParseId(KeyVaultTestCase): |
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.
These tests can be module-level methods.
| def test_parse_certificate_id_with_version(self): | ||
| # [START parse_key_vault_certificate_id] | ||
| source_id = "https://keyvault-name.vault.azure.net/certificates/certificate-name/version" | ||
| parsed_certificate_id = parse_key_vault_certificate_id(source_id) |
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.
Parsing a literal seems odd in the snippet showing people how to use the method. This is what I imagine people would usually want to do:
cert = client.get_certificate("...")
parsed_id = parse_key_vault_certificate_id(cert.id)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.
I like that!
sadasant
left a comment
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.
Looks good to me 🌞
…into expose_parse_vault_id * 'master' of https://github.com/Azure/azure-sdk-for-python: (39 commits) [keyvault] fix include_pending param and 2016-10-01 compatibility (Azure#13161) don't want to exclude mgmt. auto-increments are fine here (Azure#13549) add test for opinion in diff sentence (Azure#13524) Change prerelease versioning (Azure#13500) [text analytics] add --pre suffix to pip install (Azure#13523) update changelog (Azure#13369) update release date for Sep (Azure#13370) update release date for Sep (Azure#13371) Sync eng/common directory with azure-sdk-tools repository for Tools PR 946 (Azure#13533) 404 python erroring sanitize_setup. should not be (Azure#13532) Live pipeline issues (Azure#13526) [ServiceBus] Clean up README prior to P6 with doc-owner recommendations. (Azure#13511) Make doc-owner recommended revisions to eventhub readme and samples. (Azure#13518) Fix storage file datalake readme and samples issues (Azure#12512) [EventGrid] Receive Functions (Azure#13428) Tableitem metadata (Azure#13445) modify bing id docstring to mention Bing Entity Search more (Azure#13509) [text analytics] link opinion mining in the readme (Azure#13493) If match headers (Azure#13315) fix authorization header on asyncio requests containing url-encoded chars (Azure#13346) ...
mccoyp
left a comment
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.
Looks good! I'll just bump Charles's comment about tests
|
This was superseded by #14518 (thanks @iscai-msft!) |
fixes #13006
I currently have the
idproperty asoriginal_idbecause for python we're not supposed to have properties / parameters titledid. Down to change this though (I see there's back and forth on @sadasant 's PR to maybe name thissource_idtoo.