Open source video conferencing app powered by LiveKit. Built with Django and React.
🚨(backend) fix InsecureKeyLengthWarning in test suite
lebaudantoined915b93caa51
diff --git a/.github/workflows/meet.yml b/.github/workflows/meet.ymlindex 78894582..37405f74 100644--- a/.github/workflows/meet.yml+++ b/.github/workflows/meet.yml@@ -223,8 +223,6 @@ jobs:DB_PORT: 5432REDIS_URL: redis://localhost:6379/1STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage- LIVEKIT_API_SECRET: secret- LIVEKIT_API_KEY: devkeyAWS_S3_ENDPOINT_URL: http://localhost:9000AWS_S3_ACCESS_KEY_ID: meetAWS_S3_SECRET_ACCESS_KEY: passworddiff --git a/src/backend/core/tests/rooms/test_api_rooms_subtitle.py b/src/backend/core/tests/rooms/test_api_rooms_subtitle.pyindex 9178692f..b75d324a 100644--- a/src/backend/core/tests/rooms/test_api_rooms_subtitle.py+++ b/src/backend/core/tests/rooms/test_api_rooms_subtitle.py@@ -205,7 +205,7 @@ def test_start_subtitle_wrong_signature(settings, mock_livekit_token):"""Test that tokens signed with incorrect signature are rejected."""settings.ROOM_SUBTITLE_ENABLED = True- settings.LIVEKIT_CONFIGURATION["api_secret"] = "wrong-secret"+ settings.LIVEKIT_CONFIGURATION["api_secret"] = "wrong-secret-padded-to-32-bytes!!"room = RoomFactory()client = APIClient()diff --git a/src/backend/core/tests/rooms/test_api_rooms_webhook.py b/src/backend/core/tests/rooms/test_api_rooms_webhook.pyindex 356dedb5..63beac85 100644--- a/src/backend/core/tests/rooms/test_api_rooms_webhook.py+++ b/src/backend/core/tests/rooms/test_api_rooms_webhook.py@@ -47,7 +47,7 @@ def mock_livekit_config(settings):"""Mock LiveKit configuration."""settings.LIVEKIT_CONFIGURATION = {"api_key": "test_api_key",- "api_secret": "test_api_secret",+ "api_secret": "test_api_secret_padded_to_32bytes!","url": "https://test-livekit.example.com/",}return settings.LIVEKIT_CONFIGURATIONdiff --git a/src/backend/core/tests/test_external_api_rooms.py b/src/backend/core/tests/test_external_api_rooms.pyindex 424bce0c..abb419f5 100644--- a/src/backend/core/tests/test_external_api_rooms.py+++ b/src/backend/core/tests/test_external_api_rooms.py@@ -713,7 +713,7 @@ def test_api_rooms_token_invalid_signature(mock_rs_authenticate, settings):}token = jwt.encode(payload,- "invalid-private-key",+ "invalid-private-key-padded-to-32b!",algorithm=settings.APPLICATION_JWT_ALG,)diff --git a/src/backend/meet/settings.py b/src/backend/meet/settings.pyindex fa689dfa..760038bd 100755--- a/src/backend/meet/settings.py+++ b/src/backend/meet/settings.py@@ -981,7 +981,13 @@ class Test(Base):USE_SWAGGER = TrueEXTERNAL_API_ENABLED = True- APPLICATION_JWT_SECRET_KEY = "devKey" # noqa:S105+ LIVEKIT_CONFIGURATION = {+ "api_key": "devkey-padded-for-minimum-len!-livekit",+ "api_secret": "secret-key-padded-for-minimum-len!-livekit",+ "url": "http://127.0.0.1.nip.io:7880",+ }++ APPLICATION_JWT_SECRET_KEY = "secret-key-padded-for-minimum-len!-application" # noqa:S105APPLICATION_JWT_AUDIENCE = "Test inc."CELERY_TASK_ALWAYS_EAGER = True