This commit is contained in:
@@ -494,9 +494,9 @@ class ApiHandler(BaseHTTPRequestHandler):
|
||||
if row:
|
||||
try: old = json.loads(decrypt_provider_secret(row["credentials_ciphertext"])) if row["credentials_ciphertext"] else {}
|
||||
except Exception: old = {}
|
||||
for name in ("nous_api_key", "firecrawl_api_key"):
|
||||
for name in ("nous_api_key", "step_api_key", "firecrawl_api_key"):
|
||||
if name not in credentials and name in old: credentials[name] = old[name]
|
||||
if config["enabled"] and ("nous_api_key" not in credentials or (not config["firecrawl_base_url"].startswith("http://searxng") and "firecrawl_api_key" not in credentials)):
|
||||
if config["enabled"] and (("nous_api_key" not in credentials and "step_api_key" not in credentials) or (not config["firecrawl_base_url"].startswith("http://searxng") and "firecrawl_api_key" not in credentials)):
|
||||
return self.send_json(400, {"error": "provider_credentials_required"})
|
||||
ciphertext = encrypt_provider_secret(json.dumps(credentials, sort_keys=True)) if credentials else ""
|
||||
fingerprint = hashlib.sha256(json.dumps(credentials, sort_keys=True).encode()).hexdigest() if credentials else ""
|
||||
|
||||
Reference in New Issue
Block a user