Skip to content

Commit

Permalink
Fixed the AccessToken type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Treasure committed Feb 8, 2021
1 parent d86e3fa commit 2d13e26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ def __init__(self, account_id, account_domain, credential, **kwargs):

@distributed_trace
def get_token(self, **kwargs):
# type: (Any) -> AccessToken
# type: (Any) -> azure.core.credentials.AccessToken
"""
Retrieve a token from the STS service for the specified account identifier asynchronously.
:return: Instance of azure.core.credentials.AccessToken - token and expiry date of it
:rtype: ~azure.core.credentials.AccessToken
"""
token_request_options = TokenRequestOptions()
token_request_options.client_request_id = _generate_cv_base()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Union

from azure.core.credentials import AccessToken, AzureKeyCredential
from azure.core.credentials import AzureKeyCredential
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy

Expand All @@ -25,6 +25,7 @@
from ..utils import _convert_to_access_token, _generate_cv_base

if TYPE_CHECKING:
from azure.core.credentials import AccessToken
from azure.core.credentials_async import AsyncTokenCredential


Expand Down Expand Up @@ -84,9 +85,11 @@ def __init__(self,
**kwargs)

@distributed_trace_async
async def get_token(self, **kwargs) -> AccessToken:
async def get_token(self, **kwargs) -> "AccessToken":
"""
Retrieve a token from the STS service for the specified account identifier asynchronously.
:return: Instance of azure.core.credentials.AccessToken - token and expiry date of it
:rtype: :class:`azure.core.credentials.AccessToken`
"""
token_request_options = TokenRequestOptions()
token_request_options.client_request_id=_generate_cv_base()
Expand Down

0 comments on commit 2d13e26

Please sign in to comment.