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