mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Bump PyJWT to 2.7.0 (#93128)
This commit is contained in:
parent
99265a983a
commit
32b70ea133
@ -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(
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
PyJWT==2.6.0
|
||||
PyJWT==2.7.0
|
||||
PyNaCl==1.5.0
|
||||
PyTurboJPEG==1.6.7
|
||||
aiodiscover==1.4.16
|
||||
|
@ -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+
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user