-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[SQL] Add managed hsm regex match to SQL #15109
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
Changes from 1 commit
39cf0f8
fbe751c
10cc707
afde317
fe0d930
3b49015
145c073
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -536,23 +536,11 @@ def _get_server_key_name_from_uri(uri): | |
| ''' | ||
| import re | ||
|
|
||
| match = re.match(r'https://(.)+\.(managedhsm.azure.net| | ||
| managedhsm-preview.azure.net| | ||
| vault.azure.net| | ||
| vault-int.azure-int.net| | ||
| vault.azure.cn| | ||
| managedhsm.azure.cn| | ||
| vault.usgovcloudapi.net| | ||
| managedhsm.usgovcloudapi.net| | ||
| vault.microsoftazure.de| | ||
| managedhsm.microsoftazure.de| | ||
| vault.cloudapi.eaglex.ic.gov| | ||
| vault.cloudapi.microsoft.scloud)(:443)?\/keys/[^\/]+\/[0-9a-zA-Z]+$', uri) | ||
| match = re.match(r'https://(.)+\.(managedhsm.azure.net|managedhsm-preview.azure.net|vault.azure.net|vault-int.azure-int.net|vault.azure.cn|managedhsm.azure.cn|vault.usgovcloudapi.net|managedhsm.usgovcloudapi.net|vault.microsoftazure.de|managedhsm.microsoftazure.de|vault.cloudapi.eaglex.ic.gov|vault.cloudapi.microsoft.scloud)(:443)?\/keys/[^\/]+\/[0-9a-zA-Z]+$', uri) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you support Azure Stack cloud? It seems with your current regex, only some known could are supported. If there are new cloud supported, you will need to change the regex here, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. currently we do not support Azure stack. |
||
|
|
||
| if match is None: | ||
| raise CLIError('The provided uri is invalid. Please provide a valid Azure Key Vault key id. For example: ' | ||
| '"https://YourVaultName.vault.azure.net/keys/YourKeyName/123" or | ||
| "https://ManagedHsmRegion.ManagedHsmName.managedhsm.azure.net/keys/YourKeyName/123"') | ||
| '"https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901" or "https://YourManagedHsmRegion.YourManagedHsmName.managedhsm.azure.net/keys/YourKeyName/01234567890123456789012345678901"') | ||
|
|
||
| vault = uri.split('.')[0].split('/')[-1] | ||
| key = uri.split('/')[-2] | ||
|
|
||
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.
please add comment to clarify what you do for regex.