Skip to content

Commit

Permalink
Merge pull request #2335 from ff137/chore/upgrade-pyjwt-dependency
Browse files Browse the repository at this point in the history
⬆️ upgrade `pyjwt` to latest; introduce leeway to `jwt.decode`
  • Loading branch information
swcurran authored Jul 24, 2023
2 parents cb88963 + 9f66f09 commit 81f6281
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aries_cloudagent/multitenant/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ async def create_auth_token(
def get_wallet_details_from_token(self, token: str) -> Tuple[str, str]:
"""Get the wallet_id and wallet_key from provided token."""
jwt_secret = self._profile.context.settings.get("multitenant.jwt_secret")
token_body = jwt.decode(token, jwt_secret, algorithms=["HS256"])
token_body = jwt.decode(token, jwt_secret, algorithms=["HS256"], leeway=1)
wallet_id = token_body.get("wallet_id")
wallet_key = token_body.get("wallet_key")
return wallet_id, wallet_key
Expand Down Expand Up @@ -360,7 +360,7 @@ async def get_profile_for_token(
jwt_secret = self._profile.context.settings.get("multitenant.jwt_secret")
extra_settings = {}

token_body = jwt.decode(token, jwt_secret, algorithms=["HS256"])
token_body = jwt.decode(token, jwt_secret, algorithms=["HS256"], leeway=1)

wallet_id = token_body.get("wallet_id")
wallet_key = token_body.get("wallet_key")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ packaging~=23.1
portalocker~=2.7.0
prompt_toolkit~=2.0.9
pydid~=0.3.6
pyjwt~=2.4.0
pyjwt~=2.8.0
pyld~=2.0.3
pynacl~=1.5.0
python-dateutil~=2.8.1
Expand Down

0 comments on commit 81f6281

Please sign in to comment.