mirror of
https://github.com/home-assistant/core
synced 2024-10-04 18:52:36 +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.
|
# 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(
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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+
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue