Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit 51e591b

Browse files
authored
Merge pull request #247 from AzureAD/release-1.2.6
Release 1.2.6
2 parents e9a471e + 9c5bb85 commit 51e591b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

adal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# pylint: disable=wrong-import-position
2929

30-
__version__ = '1.2.5'
30+
__version__ = '1.2.6'
3131

3232
import logging
3333

adal/self_signed_jwt.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def _sign_jwt(header, payload, certificate):
5757
return encoded_jwt
5858

5959
def _encode_jwt(payload, certificate, header):
60-
return jwt.encode(payload, certificate, algorithm='RS256', headers=header).decode()
60+
encoded = jwt.encode(payload, certificate, algorithm='RS256', headers=header)
61+
try:
62+
return encoded.decode() # PyJWT 1.x returns bytes; historically we convert it to string
63+
except AttributeError:
64+
return encoded # PyJWT 2 will return string
6165

6266
def _raise_on_invalid_jwt_signature(encoded_jwt):
6367
segments = encoded_jwt.split('.')

requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ requests==2.20.0
22
PyJWT==1.7.0
33
#need 2.x for Python3 support
44
python-dateutil==2.1.0
5+
56
#1.1.0 is the first that can be installed on windows
6-
cryptography==2.3.1
7+
# Yet we decide to remove this from requirements.txt,
8+
# because ADAL does not have a direct dependency on it.
9+
#cryptography==3.2
10+
711
#for testing
812
httpretty==0.8.14
913
pylint==1.5.4

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
],
7777
packages=['adal'],
7878
install_requires=[
79-
'PyJWT>=1.0.0',
80-
'requests>=2.0.0',
81-
'python-dateutil>=2.1.0',
79+
'PyJWT>=1.0.0,<3',
80+
'requests>=2.0.0,<3',
81+
'python-dateutil>=2.1.0,<3',
8282
'cryptography>=1.1.0'
8383
]
8484
)

0 commit comments

Comments
 (0)