From 161d9c7b91062f59b8eedcb7e0fe452813e3f280 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Wed, 30 Jul 2025 21:33:38 +0200 Subject: [PATCH] update seach source connector schema --- .../app/schemas/search_source_connector.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/surfsense_backend/app/schemas/search_source_connector.py b/surfsense_backend/app/schemas/search_source_connector.py index a49d332..28d5425 100644 --- a/surfsense_backend/app/schemas/search_source_connector.py +++ b/surfsense_backend/app/schemas/search_source_connector.py @@ -167,6 +167,18 @@ class SearchSourceConnectorBase(BaseModel): if not config.get("CONFLUENCE_BASE_URL"): raise ValueError("CONFLUENCE_BASE_URL cannot be empty") + elif connector_type == SearchSourceConnectorType.CLICKUP_CONNECTOR: + # For CLICKUP_CONNECTOR, only allow CLICKUP_API_TOKEN + allowed_keys = ["CLICKUP_API_TOKEN"] + if set(config.keys()) != set(allowed_keys): + raise ValueError( + f"For CLICKUP_CONNECTOR connector type, config must only contain these keys: {allowed_keys}" + ) + + # Ensure the API token is not empty + if not config.get("CLICKUP_API_TOKEN"): + raise ValueError("CLICKUP_API_TOKEN cannot be empty") + return config