diff --git a/homeassistant/auth/jwt_wrapper.py b/homeassistant/auth/jwt_wrapper.py index 546e4afdcfa6..c681df665571 100644 --- a/homeassistant/auth/jwt_wrapper.py +++ b/homeassistant/auth/jwt_wrapper.py @@ -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( diff --git a/homeassistant/helpers/config_entry_oauth2_flow.py b/homeassistant/helpers/config_entry_oauth2_flow.py index 072fed4220bf..fe4e5473092d 100644 --- a/homeassistant/helpers/config_entry_oauth2_flow.py +++ b/homeassistant/helpers/config_entry_oauth2_flow.py @@ -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 diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index ae2b0fef90b1..de886306e5a6 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -1,4 +1,4 @@ -PyJWT==2.6.0 +PyJWT==2.7.0 PyNaCl==1.5.0 PyTurboJPEG==1.6.7 aiodiscover==1.4.16 diff --git a/pyproject.toml b/pyproject.toml index 11d0f910067d..6da5817c4bc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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+ diff --git a/requirements.txt b/requirements.txt index 5931440dccb3..7efb44738afe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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