Skip to content

Commit

Permalink
Update auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
simorenoh committed Mar 24, 2022
1 parent 37a27e0 commit 721bbc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk/cosmos/azure-cosmos/azure/cosmos/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from azure.core.exceptions import ServiceRequestError
from azure.core.credentials import AccessToken
from azure.core.pipeline import PipelineRequest, PipelineResponse
from azure.core.pipeline.policies import HTTPPolicy
from . import http_constants

TokenCredential = ClassVar
Expand Down Expand Up @@ -203,7 +204,7 @@ def _need_new_token(self):
return not self._token or self._token.expires_on - time.time() < 300


class CosmosBearerTokenCredentialPolicy(_CosmosBearerTokenCredentialPolicyBase):
class CosmosBearerTokenCredentialPolicy(_CosmosBearerTokenCredentialPolicyBase, HTTPPolicy):
"""Adds a Cosmos bearer token Authorization header to requests.
:param credential: The credential.
Expand Down

0 comments on commit 721bbc7

Please sign in to comment.