File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
sdk/identity/azure-identity
azure/identity/_credentials Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11# Release History
22
3- ## 1.4.0b5 (Unreleased)
3+ ## 1.4.0b5 (2020-06-12)
4+ - Prevent an error on importing ` AzureCliCredential ` on Windows caused by a bug
5+ in old versions of Python 3.6 (this bug was fixed in Python 3.6.5).
6+ ([ #12014 ] ( https://github.com/Azure/azure-sdk-for-python/issues/12014 ) )
47- ` SharedTokenCacheCredential.get_token ` raises ` ValueError ` instead of
58 ` ClientAuthenticationError ` when called with no scopes.
69 ([ #11553 ] ( https://github.com/Azure/azure-sdk-for-python/issues/11553 ) )
Original file line number Diff line number Diff line change 2626COMMAND_LINE = "az account get-access-token --output json --resource {}"
2727NOT_LOGGED_IN = "Please run 'az login' to set up an account"
2828
29- # CLI's "expiresOn" is naive, so we use this naive datetime for the epoch to calculate expires_on in UTC
30- EPOCH = datetime .fromtimestamp (0 )
31-
3229
3330class AzureCliCredential (object ):
3431 """Authenticates by requesting a token from the Azure CLI.
@@ -74,8 +71,8 @@ def parse_token(output):
7471 token = json .loads (output )
7572 parsed_expires_on = datetime .strptime (token ["expiresOn" ], "%Y-%m-%d %H:%M:%S.%f" )
7673
77- # calculate seconds since the epoch; parsed_expires_on and EPOCH are naive
78- expires_on = (parsed_expires_on - EPOCH ).total_seconds ()
74+ # calculate seconds since the epoch; parsed_expires_on is naive
75+ expires_on = (parsed_expires_on - datetime . fromtimestamp ( 0 ) ).total_seconds ()
7976
8077 return AccessToken (token ["accessToken" ], int (expires_on ))
8178 except (KeyError , ValueError ):
You can’t perform that action at this time.
0 commit comments