From eead9ef83299f8a9d399bb884e896771c219d816 Mon Sep 17 00:00:00 2001 From: rkritika1508 Date: Wed, 18 Feb 2026 16:31:29 +0530 Subject: [PATCH 1/3] updated --- backend/app/api/deps.py | 2 +- backend/app/tests/test_deps_multitenant.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/api/deps.py b/backend/app/api/deps.py index 8426bee..72190f2 100644 --- a/backend/app/api/deps.py +++ b/backend/app/api/deps.py @@ -75,7 +75,7 @@ def _fetch_tenant_from_backend(token: str) -> TenantContext: try: response = httpx.get( f"{settings.KAAPI_AUTH_URL}/apikeys/verify", - headers={"X-API-KEY": f"ApiKey {token}"}, + headers={"X-API-KEY": token}, timeout=settings.KAAPI_AUTH_TIMEOUT, ) except httpx.RequestError: diff --git a/backend/app/tests/test_deps_multitenant.py b/backend/app/tests/test_deps_multitenant.py index 2c76880..20fa466 100644 --- a/backend/app/tests/test_deps_multitenant.py +++ b/backend/app/tests/test_deps_multitenant.py @@ -42,7 +42,7 @@ def fake_get(url, headers, timeout): assert isinstance(context, TenantContext) assert (context.organization_id, context.project_id) == (10, 20) assert captured["url"] == VERIFY_URL - assert captured["headers"]["X-API-KEY"] == "ApiKey abc123" + assert captured["headers"]["X-API-KEY"] == "abc123" assert captured["timeout"] == 5 @@ -139,7 +139,7 @@ def fake_get(url, headers, timeout): assert context.organization_id == 1 assert context.project_id == 1 assert captured["url"] == "http://localhost:8000/api/v1/apikeys/verify" - assert captured["headers"]["X-API-KEY"] == "ApiKey No3x47A5" + assert captured["headers"]["X-API-KEY"] == "No3x47A5" assert captured["timeout"] == 5 From 8ac1706ae6410eb020931247f0daeaa6dd52d52c Mon Sep 17 00:00:00 2001 From: rkritika1508 Date: Wed, 18 Feb 2026 17:05:30 +0530 Subject: [PATCH 2/3] removed --- backend/app/tests/test_deps_multitenant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/tests/test_deps_multitenant.py b/backend/app/tests/test_deps_multitenant.py index 20fa466..2c76880 100644 --- a/backend/app/tests/test_deps_multitenant.py +++ b/backend/app/tests/test_deps_multitenant.py @@ -42,7 +42,7 @@ def fake_get(url, headers, timeout): assert isinstance(context, TenantContext) assert (context.organization_id, context.project_id) == (10, 20) assert captured["url"] == VERIFY_URL - assert captured["headers"]["X-API-KEY"] == "abc123" + assert captured["headers"]["X-API-KEY"] == "ApiKey abc123" assert captured["timeout"] == 5 @@ -139,7 +139,7 @@ def fake_get(url, headers, timeout): assert context.organization_id == 1 assert context.project_id == 1 assert captured["url"] == "http://localhost:8000/api/v1/apikeys/verify" - assert captured["headers"]["X-API-KEY"] == "No3x47A5" + assert captured["headers"]["X-API-KEY"] == "ApiKey No3x47A5" assert captured["timeout"] == 5 From b75688861df20b4eff97b5e51a5ea39e98b0abe4 Mon Sep 17 00:00:00 2001 From: rkritika1508 Date: Wed, 18 Feb 2026 17:22:19 +0530 Subject: [PATCH 3/3] fixed --- backend/app/tests/test_deps_multitenant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/tests/test_deps_multitenant.py b/backend/app/tests/test_deps_multitenant.py index 2c76880..0f60d59 100644 --- a/backend/app/tests/test_deps_multitenant.py +++ b/backend/app/tests/test_deps_multitenant.py @@ -37,7 +37,7 @@ def fake_get(url, headers, timeout): monkeypatch.setattr(httpx, "get", fake_get) - context = validate_multitenant_key("abc123") + context = validate_multitenant_key("ApiKey abc123") assert isinstance(context, TenantContext) assert (context.organization_id, context.project_id) == (10, 20) @@ -133,7 +133,7 @@ def fake_get(url, headers, timeout): monkeypatch.setattr(httpx, "get", fake_get) - context = validate_multitenant_key("No3x47A5") + context = validate_multitenant_key("ApiKey No3x47A5") assert isinstance(context, TenantContext) assert context.organization_id == 1