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..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