Skip to content

Commit a60854c

Browse files
committed
SupportsGetToken -> TokenCredential
1 parent 6d11b61 commit a60854c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

sdk/keyvault/azure-security-keyvault/azure/security/keyvault/_internal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if TYPE_CHECKING:
99
# pylint:disable=unused-import
1010
from typing import Any, Mapping, Optional
11-
from azure.core.credentials import SupportsGetToken
11+
from azure.core.credentials import TokenCredential
1212
from azure.core.pipeline.transport import HttpTransport
1313

1414
try:
@@ -55,23 +55,23 @@ class _KeyVaultClientBase(object):
5555
"""
5656
:param credential: A credential or credential provider which can be used to authenticate to the vault,
5757
a ValueError will be raised if the entity is not provided
58-
:type credential: azure.core.credentials.SupportsGetToken
58+
:type credential: azure.core.credentials.TokenCredential
5959
:param str vault_url: The url of the vault to which the client will connect,
6060
a ValueError will be raised if the entity is not provided
6161
:param ~azure.core.configuration.Configuration config: The configuration for the KeyClient
6262
"""
6363

6464
@staticmethod
6565
def create_config(credential, api_version=None, **kwargs):
66-
# type: (SupportsGetToken, Optional[str], Mapping[str, Any]) -> Configuration
66+
# type: (TokenCredential, Optional[str], Mapping[str, Any]) -> Configuration
6767
if api_version is None:
6868
api_version = KeyVaultClient.DEFAULT_API_VERSION
6969
config = KeyVaultClient.get_configuration_class(api_version, aio=False)(credential, **kwargs)
7070
config.authentication_policy = BearerTokenCredentialPolicy(credential, scopes=KEY_VAULT_SCOPES)
7171
return config
7272

7373
def __init__(self, vault_url, credential, config=None, transport=None, api_version=None, **kwargs):
74-
# type: (str, SupportsGetToken, Configuration, Optional[HttpTransport], Optional[str], **Any) -> None
74+
# type: (str, TokenCredential, Configuration, Optional[HttpTransport], Optional[str], **Any) -> None
7575
if not credential:
7676
raise ValueError("credential should be a credential object from azure-identity")
7777
if not vault_url:

sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/_internal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from typing import Any, Callable, Mapping, Optional, TYPE_CHECKING
77
if TYPE_CHECKING:
88
try:
9-
from azure.core.credentials import SupportsGetToken
9+
from azure.core.credentials import TokenCredential
1010
except ImportError:
11-
# SupportsGetToken is a typing_extensions.Protocol; we don't depend on that package
11+
# TokenCredential is a typing_extensions.Protocol; we don't depend on that package
1212
pass
1313

1414
from azure.core.async_paging import AsyncPagedMixin
@@ -52,7 +52,7 @@ class _AsyncKeyVaultClientBase:
5252

5353
@staticmethod
5454
def create_config(
55-
credential: "SupportsGetToken", api_version: str = None, **kwargs: Mapping[str, Any]
55+
credential: "TokenCredential", api_version: str = None, **kwargs: Mapping[str, Any]
5656
) -> Configuration:
5757
if api_version is None:
5858
api_version = KeyVaultClient.DEFAULT_API_VERSION
@@ -63,7 +63,7 @@ def create_config(
6363
def __init__(
6464
self,
6565
vault_url: str,
66-
credential: "SupportsGetToken",
66+
credential: "TokenCredential",
6767
config: Configuration = None,
6868
transport: HttpTransport = None,
6969
api_version: str = None,

sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/vault_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from typing import Any, Optional, TYPE_CHECKING
77
if TYPE_CHECKING:
88
try:
9-
from azure.core.credentials import SupportsGetToken
9+
from azure.core.credentials import TokenCredential
1010
except ImportError:
11-
# SupportsGetToken is a typing_extensions.Protocol; we don't depend on that package
11+
# TokenCredential is a typing_extensions.Protocol; we don't depend on that package
1212
pass
1313

1414
from azure.core import Configuration
@@ -23,7 +23,7 @@ class VaultClient(_AsyncKeyVaultClientBase):
2323
def __init__(
2424
self,
2525
vault_url: str,
26-
credential: "SupportsGetToken",
26+
credential: "TokenCredential",
2727
config: Configuration = None,
2828
transport: HttpTransport = None,
2929
api_version: str = None,

sdk/keyvault/azure-security-keyvault/azure/security/keyvault/vault_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if TYPE_CHECKING:
1212
# pylint:disable=unused-import
1313
from azure.core import Configuration
14-
from azure.core.credentials import SupportsGetToken
14+
from azure.core.credentials import TokenCredential
1515
from azure.core.pipeline.transport import HttpTransport
1616
from typing import Any, Mapping, Optional
1717

@@ -22,7 +22,7 @@
2222

2323
class VaultClient(_KeyVaultClientBase):
2424
def __init__(self, vault_url, credential, config=None, transport=None, api_version=None, **kwargs):
25-
# type: (str, SupportsGetToken, Configuration, Optional[HttpTransport], Optional[str], **Any) -> None
25+
# type: (str, TokenCredential, Configuration, Optional[HttpTransport], Optional[str], **Any) -> None
2626
super(VaultClient, self).__init__(
2727
vault_url, credential, config=config, transport=transport, api_version=api_version, **kwargs
2828
)

0 commit comments

Comments
 (0)