Use a long enough JWT signing key in the Elmax tests (#179826)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Paulus Schoutsen
2026-08-22 10:16:02 -05:00
committed by GitHub
co-authored by Claude
parent d315c85a3d
commit 3befdedc5b
+3 -1
View File
@@ -27,6 +27,8 @@ from . import (
from tests.common import load_fixture
TOKEN_SIGNING_KEY = "elmax-test-token-signing-key-0123"
MOCK_DIRECT_BASE_URI = (
f"{'https' if MOCK_DIRECT_SSL else 'http'}://{MOCK_DIRECT_HOST}:{MOCK_DIRECT_PORT}"
)
@@ -82,7 +84,7 @@ def httpx_mock_direct_fixture(base_uri: str) -> Generator[respx.MockRouter]:
expiration = datetime.now() + timedelta(hours=1) # pylint: disable=home-assistant-enforce-naive-now
decoded_jwt["payload"]["exp"] = int(expiration.timestamp())
jws_string = jwt.encode(
payload=decoded_jwt["payload"], algorithm="HS256", key="test"
payload=decoded_jwt["payload"], algorithm="HS256", key=TOKEN_SIGNING_KEY
)
login_json["token"] = f"JWT {jws_string}"
login_route.return_value = Response(200, json=login_json)