Skip to content

Commit

Permalink
[Key Vault] Address architect feedback (Azure#23475)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccoyp authored and rakshith91 committed Apr 10, 2022
1 parent eef92c0 commit 7c2dc82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if TYPE_CHECKING:
# pylint:disable=unused-import
from typing import Any, Iterable, Optional, Union
from typing import Any, List, Optional, Union
from azure.core.paging import ItemPaged
from azure.core.polling import LROPoller
from ._models import JsonWebKey
Expand Down Expand Up @@ -701,7 +701,7 @@ def release_key(self, name, target_attestation_token, **kwargs):
:keyword str version: A specific version of the key to release. If unspecified, the latest version is released.
:keyword algorithm: The encryption algorithm to use to protect the released key material.
:paramtype algorithm: ~azure.keyvault.keys.KeyExportEncryptionAlgorithm
:paramtype algorithm: Union[str, ~azure.keyvault.keys.KeyExportEncryptionAlgorithm]
:keyword str nonce: A client-provided nonce for freshness.
:return: The result of the key release.
Expand Down Expand Up @@ -792,7 +792,7 @@ def update_key_rotation_policy(self, key_name, policy, **kwargs):
:keyword lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. This will
override the lifetime actions of the provided ``policy``.
:paramtype lifetime_actions: Iterable[~azure.keyvault.keys.KeyRotationLifetimeAction]
:paramtype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
:keyword str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an
ISO 8601 duration. For example: 90 days is "P90D", 3 months is "P3M", and 48 hours is "PT48H". See
`Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for more information on ISO 8601 durations.
Expand Down
14 changes: 7 additions & 7 deletions sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

if TYPE_CHECKING:
# pylint:disable=unused-import
from typing import Any, Dict, Optional, List
from typing import Any, Dict, List, Optional, Union
from datetime import datetime
from . import _generated_models as _models
from ._enums import KeyOperation, KeyRotationPolicyAction, KeyType
Expand Down Expand Up @@ -319,14 +319,14 @@ class KeyRotationPolicy(object):
:ivar str id: The identifier of the key rotation policy.
:ivar lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key.
:type lifetime_actions: list[~azure.keyvault.keys.KeyRotationLifetimeAction]
:vartype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
:ivar str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an ISO 8601
duration. For example, 90 days is "P90D". See `Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for
more information on ISO 8601 durations.
:ivar created_on: When the policy was created, in UTC
:type created_on: ~datetime.datetime
:vartype created_on: ~datetime.datetime
:ivar updated_on: When the policy was last updated, in UTC
:type updated_on: ~datetime.datetime
:vartype updated_on: ~datetime.datetime
"""

def __init__(self, **kwargs):
Expand Down Expand Up @@ -448,7 +448,7 @@ def key(self):

@property
def key_type(self):
# type: () -> KeyType
# type: () -> Union[str, KeyType]
"""The key's type. See :class:`~azure.keyvault.keys.KeyType` for possible values.
:rtype: ~azure.keyvault.keys.KeyType or str
Expand All @@ -458,10 +458,10 @@ def key_type(self):

@property
def key_operations(self):
# type: () -> List[KeyOperation]
# type: () -> List[Union[str, KeyOperation]]
"""Permitted operations. See :class:`~azure.keyvault.keys.KeyOperation` for possible values.
:rtype: list[~azure.keyvault.keys.KeyOperation or str]
:rtype: List[~azure.keyvault.keys.KeyOperation or str]
"""
# pylint:disable=no-member
return self._key_material.key_ops # type: ignore[attr-defined]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
if TYPE_CHECKING:
# pylint:disable=ungrouped-imports
from azure.core.async_paging import AsyncItemPaged
from typing import Any, Iterable, Optional, Union
from typing import Any, List, Optional, Union
from .. import KeyType


Expand Down Expand Up @@ -686,7 +686,7 @@ async def release_key(self, name: str, target_attestation_token: str, **kwargs:
:keyword str version: A specific version of the key to release. If unspecified, the latest version is released.
:keyword algorithm: The encryption algorithm to use to protect the released key material.
:paramtype algorithm: ~azure.keyvault.keys.KeyExportEncryptionAlgorithm
:paramtype algorithm: Union[str, ~azure.keyvault.keys.KeyExportEncryptionAlgorithm]
:keyword str nonce: A client-provided nonce for freshness.
:return: The result of the key release.
Expand Down Expand Up @@ -775,7 +775,7 @@ async def update_key_rotation_policy(
:keyword lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a key. This will
override the lifetime actions of the provided ``policy``.
:paramtype lifetime_actions: Iterable[~azure.keyvault.keys.KeyRotationLifetimeAction]
:paramtype lifetime_actions: List[~azure.keyvault.keys.KeyRotationLifetimeAction]
:keyword str expires_in: The expiry time of the policy that will be applied on new key versions, defined as an
ISO 8601 duration. For example: 90 days is "P90D", 3 months is "P3M", and 48 hours is "PT48H". See
`Wikipedia <https://wikipedia.org/wiki/ISO_8601#Durations>`_ for more information on ISO 8601 durations.
Expand Down

0 comments on commit 7c2dc82

Please sign in to comment.