Restrict local API to loopback clients
This commit is contained in:
@@ -9,4 +9,8 @@ from app import auth, database
|
||||
def authenticated_client(app: FastAPI) -> TestClient:
|
||||
database.ensure_user(database.LOCAL_USER_ID)
|
||||
token, _ = auth.issue_session(database.LOCAL_USER_ID)
|
||||
return TestClient(app, headers={"Authorization": f"Bearer {token}"})
|
||||
return TestClient(
|
||||
app,
|
||||
headers={"Authorization": f"Bearer {token}"},
|
||||
client=("127.0.0.1", 8000),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user