Restrict local API to loopback clients

This commit is contained in:
Hamza Ayed
2026-10-03 14:35:31 +03:00
parent d57efbdca3
commit c1c4ba2ecf
6 changed files with 45 additions and 5 deletions
+6 -2
View File
@@ -186,10 +186,14 @@ class KnowledgeIndexTests(unittest.TestCase):
owner_token, _ = auth.issue_session(owner_id)
other_token, _ = auth.issue_session(other_id)
owner_client = TestClient(
app, headers={"Authorization": f"Bearer {owner_token}"}
app,
headers={"Authorization": f"Bearer {owner_token}"},
client=("127.0.0.1", 8000),
)
other_client = TestClient(
app, headers={"Authorization": f"Bearer {other_token}"}
app,
headers={"Authorization": f"Bearer {other_token}"},
client=("127.0.0.1", 8000),
)
with patch.dict(
os.environ,