From 5a180f64f702dd6d35daa03241ebc1718fe927f7 Mon Sep 17 00:00:00 2001 From: Adam Sachs Date: Wed, 7 Dec 2022 21:03:37 -0500 Subject: [PATCH] 1999 connectors connection test endpoints can clog up the whole server (#2000) --- src/fides/api/ops/api/v1/endpoints/connection_endpoints.py | 4 ++-- src/fides/api/ops/service/connectors/fides/fides_client.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fides/api/ops/api/v1/endpoints/connection_endpoints.py b/src/fides/api/ops/api/v1/endpoints/connection_endpoints.py index d8724e8e15..9ac5d66812 100644 --- a/src/fides/api/ops/api/v1/endpoints/connection_endpoints.py +++ b/src/fides/api/ops/api/v1/endpoints/connection_endpoints.py @@ -357,7 +357,7 @@ def connection_status( dependencies=[Security(verify_oauth_client, scopes=[CONNECTION_CREATE_OR_UPDATE])], response_model=TestStatusMessage, ) -async def put_connection_config_secrets( +def put_connection_config_secrets( connection_key: FidesOpsKey, *, db: Session = Depends(deps.get_db), @@ -392,7 +392,7 @@ async def put_connection_config_secrets( dependencies=[Security(verify_oauth_client, scopes=[CONNECTION_READ])], response_model=TestStatusMessage, ) -async def test_connection_config_secrets( +def test_connection_config_secrets( connection_key: FidesOpsKey, *, db: Session = Depends(deps.get_db), diff --git a/src/fides/api/ops/service/connectors/fides/fides_client.py b/src/fides/api/ops/service/connectors/fides/fides_client.py index e4e6166217..da3fd2b506 100644 --- a/src/fides/api/ops/service/connectors/fides/fides_client.py +++ b/src/fides/api/ops/service/connectors/fides/fides_client.py @@ -177,7 +177,7 @@ def request_status(self, privacy_request_id: str = None) -> List[Dict[str, Any]] if privacy_request_id else None, ) - response = self.session.send(request) + response = self.session.send(request, timeout=5) if not response.ok: log.error( f"Error retrieving status of privacy request [{privacy_request_id}] on remote Fides {self.uri}",