mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-01 18:19:08 +00:00
update search source connector schame
This commit is contained in:
parent
131d362f1e
commit
4f8b610ad1
1 changed files with 20 additions and 0 deletions
|
@ -143,6 +143,26 @@ class SearchSourceConnectorBase(BaseModel):
|
||||||
if not config.get("JIRA_BASE_URL"):
|
if not config.get("JIRA_BASE_URL"):
|
||||||
raise ValueError("JIRA_BASE_URL cannot be empty")
|
raise ValueError("JIRA_BASE_URL cannot be empty")
|
||||||
|
|
||||||
|
elif connector_type == SearchSourceConnectorType.CONFLUENCE_CONNECTOR:
|
||||||
|
# For CONFLUENCE_CONNECTOR, only allow specific keys
|
||||||
|
allowed_keys = ["CONFLUENCE_BASE_URL", "CONFLUENCE_EMAIL", "CONFLUENCE_API_TOKEN"]
|
||||||
|
if set(config.keys()) != set(allowed_keys):
|
||||||
|
raise ValueError(
|
||||||
|
f"For CONFLUENCE_CONNECTOR connector type, config must only contain these keys: {allowed_keys}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Ensure the email is not empty
|
||||||
|
if not config.get("CONFLUENCE_EMAIL"):
|
||||||
|
raise ValueError("CONFLUENCE_EMAIL cannot be empty")
|
||||||
|
|
||||||
|
# Ensure the API token is not empty
|
||||||
|
if not config.get("CONFLUENCE_API_TOKEN"):
|
||||||
|
raise ValueError("CONFLUENCE_API_TOKEN cannot be empty")
|
||||||
|
|
||||||
|
# Ensure the base URL is not empty
|
||||||
|
if not config.get("CONFLUENCE_BASE_URL"):
|
||||||
|
raise ValueError("CONFLUENCE_BASE_URL cannot be empty")
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue