Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'dev' into expires-on
# Conflicts:
#	src/azure-cli-core/azure/cli/core/adal_authentication.py
  • Loading branch information
jiasli committed Nov 19, 2020
commit 0888528e64dffb0dc998856d976040900b8b47c3
13 changes: 13 additions & 0 deletions src/azure-cli-core/azure/cli/core/adal_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ def _try_scopes_to_resource(scopes):
return scopes_to_resource(scopes)


class BasicTokenCredential:
# pylint:disable=too-few-public-methods
"""A Track 2 implementation of msrest.authentication.BasicTokenAuthentication.
This credential shouldn't be used by any command module, expect azure-cli-core.
"""
def __init__(self, access_token):
self.access_token = access_token

def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument
# Because get_token can't refresh the access token, always mark the token as unexpired
return AccessToken(self.access_token, int(time.time() + 3600))


def _timestamp(dt):
# datetime.datetime can't be patched:
# TypeError: can't set attributes of built-in/extension type 'datetime.datetime'
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.