Skip to content

Commit 60039fe

Browse files
committed
Update dependencies and fix Python 2 compatibility
Fixes GuestIssuer jwt_token.decode('utf-8') redundant? #162 for webexteamssdk v1.
1 parent 272daed commit 60039fe

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""webexteamssdk setup module."""
33

4-
54
import os
65
from codecs import open
76

@@ -46,11 +45,14 @@
4645
"Topic :: Communications :: Chat",
4746
]
4847

48+
# TODO: Review the the dependencies when releasing WebexPythonSDK v2
49+
# PyJWT should be updated to ^2.8.0. Keeping it at 1.7.1 to maintain python v2
50+
# compatibility for now.
4951
INSTALLATION_REQUIREMENTS = [
5052
"future",
5153
"requests>=2.4.2",
5254
"requests-toolbelt",
53-
"PyJWT",
55+
"PyJWT==1.7.1",
5456
]
5557

5658

webexteamssdk/api/guest_issuer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ def create(self, sub, name, iss, exp, secret):
115115
key = base64.b64decode(secret)
116116
jwt_token = jwt.encode(payload, key, algorithm="HS256")
117117

118-
headers = {"Authorization": "Bearer " + jwt_token}
118+
# TODO: Remove `.decode("utf-8")` when Python 2 is no longer supported
119+
# v1.7.1 is the last release of PyJWT that supports Python 2, and it
120+
# returns a byte string for the JWT token.
121+
headers = {"Authorization": "Bearer " + jwt_token.decode("utf-8")}
119122

120123
json_data = self._session.post(
121124
API_ENDPOINT + "/" + "login", headers=headers

0 commit comments

Comments
 (0)