Bump PyJWT to 2.7.0 (#93128)

This commit is contained in:
J. Nick Koston 2023-05-16 03:26:04 -05:00 committed by GitHub
parent 99265a983a
commit 32b70ea133
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -93,7 +93,7 @@ class _PyJWTWithVerify(PyJWT):
# nothing slips through. # nothing slips through.
assert "exp" in payload, "exp claim is required" assert "exp" in payload, "exp claim is required"
assert "iat" in payload, "iat claim is required" assert "iat" in payload, "iat claim is required"
self._validate_claims( # type: ignore[no-untyped-call] self._validate_claims(
payload=payload, payload=payload,
options=merged_options, options=merged_options,
issuer=issuer, issuer=issuer,
@ -102,7 +102,7 @@ class _PyJWTWithVerify(PyJWT):
return payload return payload
_jwt = _PyJWTWithVerify() # type: ignore[no-untyped-call] _jwt = _PyJWTWithVerify()
verify_and_decode = _jwt.verify_and_decode verify_and_decode = _jwt.verify_and_decode
unverified_hs256_token_decode = lru_cache(maxsize=JWT_TOKEN_CACHE_SIZE)( unverified_hs256_token_decode = lru_cache(maxsize=JWT_TOKEN_CACHE_SIZE)(
partial( partial(

View file

@ -542,7 +542,7 @@ def _encode_jwt(hass: HomeAssistant, data: dict) -> str:
@callback @callback
def _decode_jwt(hass: HomeAssistant, encoded: str) -> dict | None: def _decode_jwt(hass: HomeAssistant, encoded: str) -> dict[str, Any] | None:
"""JWT encode data.""" """JWT encode data."""
secret: str | None = hass.data.get(DATA_JWT_SECRET) secret: str | None = hass.data.get(DATA_JWT_SECRET)
@ -550,6 +550,6 @@ def _decode_jwt(hass: HomeAssistant, encoded: str) -> dict | None:
return None return None
try: try:
return jwt.decode(encoded, secret, algorithms=["HS256"]) return jwt.decode(encoded, secret, algorithms=["HS256"]) # type: ignore[no-any-return]
except jwt.InvalidTokenError: except jwt.InvalidTokenError:
return None return None

View file

@ -1,4 +1,4 @@
PyJWT==2.6.0 PyJWT==2.7.0
PyNaCl==1.5.0 PyNaCl==1.5.0
PyTurboJPEG==1.6.7 PyTurboJPEG==1.6.7
aiodiscover==1.4.16 aiodiscover==1.4.16

View file

@ -39,7 +39,7 @@ dependencies = [
"ifaddr==0.1.7", "ifaddr==0.1.7",
"jinja2==3.1.2", "jinja2==3.1.2",
"lru-dict==1.1.8", "lru-dict==1.1.8",
"PyJWT==2.6.0", "PyJWT==2.7.0",
# PyJWT has loose dependency. We want the latest one. # PyJWT has loose dependency. We want the latest one.
"cryptography==40.0.2", "cryptography==40.0.2",
# pyOpenSSL 23.1.0 is required to work with cryptography 39+ # pyOpenSSL 23.1.0 is required to work with cryptography 39+

View file

@ -15,7 +15,7 @@ home-assistant-bluetooth==1.10.0
ifaddr==0.1.7 ifaddr==0.1.7
jinja2==3.1.2 jinja2==3.1.2
lru-dict==1.1.8 lru-dict==1.1.8
PyJWT==2.6.0 PyJWT==2.7.0
cryptography==40.0.2 cryptography==40.0.2
pyOpenSSL==23.1.0 pyOpenSSL==23.1.0
orjson==3.8.12 orjson==3.8.12