dify/api/services/auth/api_key_auth_factory.py
Bowen Liang 17fd773a30
chore(api/services): apply ruff reformatting (#7599)
Co-authored-by: -LAN- <laipz8200@outlook.com>
2024-08-26 13:43:57 +08:00

13 lines
370 B
Python

from services.auth.firecrawl import FirecrawlAuth
class ApiKeyAuthFactory:
def __init__(self, provider: str, credentials: dict):
if provider == "firecrawl":
self.auth = FirecrawlAuth(credentials)
else:
raise ValueError("Invalid provider")
def validate_credentials(self):
return self.auth.validate_credentials()