-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[key vault] Regenerate keys #12101
Merged
Merged
[key vault] Regenerate keys #12101
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
93ea6e7
move generated code out of shared folder
iscai-msft e73478a
generate with autorest v3 (except v7.2-preview)
iscai-msft bd75efe
fix wiring with new generated code
iscai-msft 6585bef
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft 23200f5
only call and import AioHttpTransport if user did not supply a transport
iscai-msft 93da956
correct user agent
iscai-msft 74088ed
fix duplicate platform info in user agent
iscai-msft b224136
fix pylint
iscai-msft 40a8430
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft c4589a0
switch references of user agent to sdk moniker in wrapped code
iscai-msft bf3ee1c
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft a5d7e00
Revert "Merge branch 'master' of https://github.com/Azure/azure-sdk-f…
iscai-msft 3ac2aea
generate with unflattened code
iscai-msft c3a2d16
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft 6308a6a
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft f5c3231
regenerate to get exposed http_logging_policy
iscai-msft de9431b
add allowed header names to http logging policy
iscai-msft 8bf6550
add tests for http logging policy
iscai-msft d7ec446
update dependency on azure core
iscai-msft 576ba50
remove 7.2-preview from generation
iscai-msft 00dfbc9
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft a848b77
checkout erroneous changes to customvision
iscai-msft c00855b
move generated code out of shared folder
iscai-msft a6e88db
generate with autorest v3 (except v7.2-preview)
iscai-msft 40a2356
fix wiring with new generated code
iscai-msft 7211aad
only call and import AioHttpTransport if user did not supply a transport
iscai-msft bb1f553
correct user agent
iscai-msft af2108b
fix duplicate platform info in user agent
iscai-msft 4ce0926
fix pylint
iscai-msft 3bc569f
switch references of user agent to sdk moniker in wrapped code
iscai-msft 7479cf7
Revert "Merge branch 'master' of https://github.com/Azure/azure-sdk-f…
iscai-msft 70d0019
generate with unflattened code
iscai-msft d13f077
regenerate to get exposed http_logging_policy
iscai-msft 0fb7376
add allowed header names to http logging policy
iscai-msft a295cb8
add tests for http logging policy
iscai-msft 7585f56
update dependency on azure core
iscai-msft eb86479
remove 7.2-preview from generation
iscai-msft 6bf4cc7
checkout erroneous changes to customvision
iscai-msft d0e2e56
Merge branch 'regenerate_keys' of https://github.com/iscai-msft/azure…
iscai-msft 7a9386d
revert erroneous changes to master
iscai-msft f1c3c72
fix more erroneous changes
iscai-msft 3478f0a
update changelog
iscai-msft 5fd90da
fix changelog
iscai-msft e1f08b2
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft 44af22f
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft d1a8d77
regenerate
iscai-msft ce6604b
update api versions
iscai-msft e7eec68
re-record
iscai-msft 6520b29
test you can pass custom hook policy to client
iscai-msft 2485750
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
iscai-msft f125090
import JsonWebKey from generated v7.1
iscai-msft 4a6f5de
add check for whether user passed in their own pipeline before import…
iscai-msft f69a065
add RequestIdPolicy to changelog
iscai-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
16 changes: 7 additions & 9 deletions
16
.../keys/_shared/_generated/v7_0/__init__.py → ...zure/keyvault/keys/_generated/__init__.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._key_vault_client import KeyVaultClient | ||
__all__ = ['KeyVaultClient'] | ||
|
||
from .version import VERSION | ||
|
||
__version__ = VERSION | ||
|
||
try: | ||
from ._patch import patch_sdk # type: ignore | ||
patch_sdk() | ||
except ImportError: | ||
pass |
This file contains 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
157 changes: 157 additions & 0 deletions
157
sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_key_vault_client.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.core import PipelineClient | ||
from msrest import Serializer, Deserializer | ||
|
||
from azure.profiles import KnownProfiles, ProfileDefinition | ||
from azure.profiles.multiapiclient import MultiApiClientMixin | ||
from ._configuration import KeyVaultClientConfiguration | ||
from ._operations_mixin import KeyVaultClientOperationsMixin | ||
class _SDKClient(object): | ||
def __init__(self, *args, **kwargs): | ||
"""This is a fake class to support current implemetation of MultiApiClientMixin." | ||
Will be removed in final version of multiapi azure-core based client | ||
""" | ||
pass | ||
|
||
class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKClient): | ||
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service. | ||
|
||
This ready contains multiple API versions, to help you deal with all of the Azure clouds | ||
(Azure Stack, Azure Government, Azure China, etc.). | ||
By default, it uses the latest API version available on public Azure. | ||
For production, you should stick to a particular api-version and/or profile. | ||
The profile sets a mapping between an operation group and its API version. | ||
The api-version parameter sets the default API version if the operation | ||
group is not described in the profile. | ||
:param str api_version: API version to use if no profile is provided, or if | ||
missing in profile. | ||
:param profile: A profile definition, from KnownProfiles to dict. | ||
:type profile: azure.profiles.KnownProfiles | ||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. | ||
""" | ||
|
||
DEFAULT_API_VERSION = '7.1' | ||
_PROFILE_TAG = "azure.keyvault.KeyVaultClient" | ||
LATEST_PROFILE = ProfileDefinition({ | ||
_PROFILE_TAG: { | ||
None: DEFAULT_API_VERSION, | ||
'backup_certificate': '7.0', | ||
'backup_secret': '7.0', | ||
'backup_storage_account': '7.0', | ||
'create_certificate': '7.0', | ||
'delete_certificate': '7.0', | ||
'delete_certificate_contacts': '7.0', | ||
'delete_certificate_issuer': '7.0', | ||
'delete_certificate_operation': '7.0', | ||
'delete_sas_definition': '7.0', | ||
'delete_secret': '7.0', | ||
'delete_storage_account': '7.0', | ||
'get_certificate': '7.0', | ||
'get_certificate_contacts': '7.0', | ||
'get_certificate_issuer': '7.0', | ||
'get_certificate_issuers': '7.0', | ||
'get_certificate_operation': '7.0', | ||
'get_certificate_policy': '7.0', | ||
'get_certificate_versions': '7.0', | ||
'get_certificates': '7.0', | ||
'get_deleted_certificate': '7.0', | ||
'get_deleted_certificates': '7.0', | ||
'get_deleted_sas_definition': '7.0', | ||
'get_deleted_sas_definitions': '7.0', | ||
'get_deleted_secret': '7.0', | ||
'get_deleted_secrets': '7.0', | ||
'get_deleted_storage_account': '7.0', | ||
'get_deleted_storage_accounts': '7.0', | ||
'get_sas_definition': '7.0', | ||
'get_sas_definitions': '7.0', | ||
'get_secret': '7.0', | ||
'get_secret_versions': '7.0', | ||
'get_secrets': '7.0', | ||
'get_storage_account': '7.0', | ||
'get_storage_accounts': '7.0', | ||
'import_certificate': '7.0', | ||
'merge_certificate': '7.0', | ||
'purge_deleted_certificate': '7.0', | ||
'purge_deleted_secret': '7.0', | ||
'purge_deleted_storage_account': '7.0', | ||
'recover_deleted_certificate': '7.0', | ||
'recover_deleted_sas_definition': '7.0', | ||
'recover_deleted_secret': '7.0', | ||
'recover_deleted_storage_account': '7.0', | ||
'regenerate_storage_account_key': '7.0', | ||
'restore_certificate': '7.0', | ||
'restore_secret': '7.0', | ||
'restore_storage_account': '7.0', | ||
'set_certificate_contacts': '7.0', | ||
'set_certificate_issuer': '7.0', | ||
'set_sas_definition': '7.0', | ||
'set_secret': '7.0', | ||
'set_storage_account': '7.0', | ||
'update_certificate': '7.0', | ||
'update_certificate_issuer': '7.0', | ||
'update_certificate_operation': '7.0', | ||
'update_certificate_policy': '7.0', | ||
'update_sas_definition': '7.0', | ||
'update_secret': '7.0', | ||
'update_storage_account': '7.0', | ||
}}, | ||
_PROFILE_TAG + " latest" | ||
) | ||
|
||
def __init__( | ||
self, | ||
api_version=None, | ||
profile=KnownProfiles.default, | ||
**kwargs # type: Any | ||
): | ||
if api_version == '2016-10-01' or api_version == '7.0' or api_version == '7.1': | ||
base_url = '{vaultBaseUrl}' | ||
else: | ||
raise NotImplementedError("APIVersion {} is not available".format(api_version)) | ||
self._config = KeyVaultClientConfiguration(**kwargs) | ||
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
super(KeyVaultClient, self).__init__( | ||
api_version=api_version, | ||
profile=profile | ||
) | ||
|
||
@classmethod | ||
def _models_dict(cls, api_version): | ||
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} | ||
|
||
@classmethod | ||
def models(cls, api_version=DEFAULT_API_VERSION): | ||
"""Module depends on the API version: | ||
|
||
* 2016-10-01: :mod:`v2016_10_01.models<azure.keyvault.v2016_10_01.models>` | ||
* 7.0: :mod:`v7_0.models<azure.keyvault.v7_0.models>` | ||
* 7.1: :mod:`v7_1.models<azure.keyvault.v7_1.models>` | ||
""" | ||
if api_version == '2016-10-01': | ||
from .v2016_10_01 import models | ||
return models | ||
elif api_version == '7.0': | ||
from .v7_0 import models | ||
return models | ||
elif api_version == '7.1': | ||
from .v7_1 import models | ||
return models | ||
raise NotImplementedError("APIVersion {} is not available".format(api_version)) | ||
|
||
def close(self): | ||
self._client.close() | ||
def __enter__(self): | ||
self._client.__enter__() | ||
return self | ||
def __exit__(self, *exc_details): | ||
self._client.__exit__(*exc_details) |
Oops, something went wrong.
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.
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.
Should this be 7.1?
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.
No. The tagging done here is saying that
backup_certificate
is only available in version 7.0. The reason for this is, in 7.0 we have the keys, secrets, and certificate mixin operations all generated, but for 7.1 (thanks to @heaths work), we only generate the keys for the key client.