Skip to content
Prev Previous commit
Next Next commit
Re-add underscores
Signed-off-by: Paul Van Eck <[email protected]>
  • Loading branch information
pvaneck committed Sep 3, 2024
commit 0a1bf09292956164c8647e16407f0b8e11e7bfac
10 changes: 7 additions & 3 deletions sdk/core/azure-core/azure/core/credentials_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from types import TracebackType
from typing import Any, Optional, AsyncContextManager, Type, Union
from typing_extensions import Protocol, runtime_checkable
from .credentials import AccessToken, AccessTokenInfo, TokenRequestOptions
from .credentials import (
AccessToken as _AccessToken,
AccessTokenInfo as _AccessTokenInfo,
TokenRequestOptions as _TokenRequestOptions,
)


@runtime_checkable
Expand All @@ -20,7 +24,7 @@ async def get_token(
tenant_id: Optional[str] = None,
enable_cae: bool = False,
**kwargs: Any,
) -> AccessToken:
) -> _AccessToken:
"""Request an access token for `scopes`.

:param str scopes: The type of access needed.
Expand Down Expand Up @@ -52,7 +56,7 @@ async def __aexit__(
class AsyncSupportsTokenInfo(Protocol, AsyncContextManager["AsyncSupportsTokenInfo"]):
"""Protocol for classes able to provide OAuth access tokens with additional properties."""

async def get_token_info(self, *scopes: str, options: Optional[TokenRequestOptions] = None) -> AccessTokenInfo:
async def get_token_info(self, *scopes: str, options: Optional[_TokenRequestOptions] = None) -> _AccessTokenInfo:
"""Request an access token for `scopes`.

This is an alternative to `get_token` to enable certain scenarios that require additional properties
Expand Down