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

Commit

Permalink
Merge pull request #247 from AzureAD/release-1.2.6
Browse files Browse the repository at this point in the history
Release 1.2.6
  • Loading branch information
rayluo authored Jan 22, 2021
2 parents e9a471e + 9c5bb85 commit 51e591b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion adal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# pylint: disable=wrong-import-position

__version__ = '1.2.5'
__version__ = '1.2.6'

import logging

Expand Down
6 changes: 5 additions & 1 deletion adal/self_signed_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def _sign_jwt(header, payload, certificate):
return encoded_jwt

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

def _raise_on_invalid_jwt_signature(encoded_jwt):
segments = encoded_jwt.split('.')
Expand Down
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ requests==2.20.0
PyJWT==1.7.0
#need 2.x for Python3 support
python-dateutil==2.1.0

#1.1.0 is the first that can be installed on windows
cryptography==2.3.1
# Yet we decide to remove this from requirements.txt,
# because ADAL does not have a direct dependency on it.
#cryptography==3.2

#for testing
httpretty==0.8.14
pylint==1.5.4
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
],
packages=['adal'],
install_requires=[
'PyJWT>=1.0.0',
'requests>=2.0.0',
'python-dateutil>=2.1.0',
'PyJWT>=1.0.0,<3',
'requests>=2.0.0,<3',
'python-dateutil>=2.1.0,<3',
'cryptography>=1.1.0'
]
)

0 comments on commit 51e591b

Please sign in to comment.