1
0
mirror of https://github.com/home-assistant/core synced 2024-07-05 17:29:15 +00:00

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

View File

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

View File

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

View File

@ -39,7 +39,7 @@ dependencies = [
"ifaddr==0.1.7",
"jinja2==3.1.2",
"lru-dict==1.1.8",
"PyJWT==2.6.0",
"PyJWT==2.7.0",
# PyJWT has loose dependency. We want the latest one.
"cryptography==40.0.2",
# 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
jinja2==3.1.2
lru-dict==1.1.8
PyJWT==2.6.0
PyJWT==2.7.0
cryptography==40.0.2
pyOpenSSL==23.1.0
orjson==3.8.12