Skip to content

Commit dbd9437

Browse files
authored
Updates for v1.2.1 (#81)
* Update jwt token update_token method to the latest azure-identity api * Update expire_at implementation * Update expire_at of jwt token according to azure-identity api * remove unused import * Fix pylint error
1 parent 2f60b23 commit dbd9437

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Release History
44
===============
55

6+
1.2.1 (2019-06-20)
7+
++++++++++++++++++
8+
9+
- Updated the implementation of `update_token()` in `JWTTokenAuth` and `JWTTokenAsync` (issue #80).
10+
11+
612
1.2.0 (2019-04-16)
713
++++++++++++++++++
814

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def get_latest_windows_sdk():
149149
platform_libs_path = os.path.join(lib_path, latest_libs_dir, "um", 'x64' if is_x64 else 'x86')
150150
if not os.path.isdir(platform_libs_path):
151151
print("Warning - build may fail: Windows SDK v{} libraries {} not found at path {}.".format(
152-
latest_sdk_version, latest_libs_dir, sdk_platform_libs_pathpath))
152+
latest_sdk_version, latest_libs_dir, platform_libs_path))
153153
else:
154154
print("Adding Windows SDK v{} libraries {} to search path, installed at {}".format(
155155
latest_sdk_version, latest_libs_dir, platform_libs_path))

uamqp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
pass # Async not supported.
3434

3535

36-
__version__ = "1.2.0"
36+
__version__ = "1.2.1"
3737

3838

3939
_logger = logging.getLogger(__name__)

uamqp/authentication/cbs_auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,5 +418,6 @@ def __init__(self, audience, uri,
418418
self.set_io(self.hostname, port, http_proxy, transport_type)
419419

420420
def update_token(self):
421-
self.expires_at = time.time() + self.expires_in.seconds
422-
self.token = self._encode(self.get_token())
421+
access_token = self.get_token()
422+
self.expires_at = access_token.expires_on
423+
self.token = self._encode(access_token.token)

uamqp/authentication/cbs_auth_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import asyncio
1010
import datetime
1111
import logging
12-
import time
1312

1413
from uamqp import c_uamqp, compat, constants, errors
1514
from uamqp.utils import get_running_loop
@@ -279,5 +278,6 @@ def __init__(self, audience, uri,
279278
self.set_io(self.hostname, port, http_proxy, transport_type)
280279

281280
async def update_token(self):
282-
self.expires_at = time.time() + self.expires_in.seconds
283-
self.token = self._encode(await self.get_token())
281+
access_token = await self.get_token()
282+
self.expires_at = access_token.expires_on
283+
self.token = self._encode(access_token.token)

0 commit comments

Comments
 (0)