Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor: use select for API key auth lookups (#34146)
Maa-Lee | odeilic5eae67ac92e
diff --git a/api/services/auth/api_key_auth_service.py b/api/services/auth/api_key_auth_service.pyindex 56aaf407eeb..3282dcfb113 100644--- a/api/services/auth/api_key_auth_service.py+++ b/api/services/auth/api_key_auth_service.py@@ -35,15 +35,13 @@ class ApiKeyAuthService:@staticmethoddef get_auth_credentials(tenant_id: str, category: str, provider: str):- data_source_api_key_bindings = (- db.session.query(DataSourceApiKeyAuthBinding)- .where(+ data_source_api_key_bindings = db.session.scalar(+ select(DataSourceApiKeyAuthBinding).where(DataSourceApiKeyAuthBinding.tenant_id == tenant_id,DataSourceApiKeyAuthBinding.category == category,DataSourceApiKeyAuthBinding.provider == provider,DataSourceApiKeyAuthBinding.disabled.is_(False),)- .first())if not data_source_api_key_bindings:return None@@ -54,10 +52,11 @@ class ApiKeyAuthService:@staticmethoddef delete_provider_auth(tenant_id: str, binding_id: str):- data_source_api_key_binding = (- db.session.query(DataSourceApiKeyAuthBinding)- .where(DataSourceApiKeyAuthBinding.tenant_id == tenant_id, DataSourceApiKeyAuthBinding.id == binding_id)- .first()+ data_source_api_key_binding = db.session.scalar(+ select(DataSourceApiKeyAuthBinding).where(+ DataSourceApiKeyAuthBinding.tenant_id == tenant_id,+ DataSourceApiKeyAuthBinding.id == binding_id,+ ))if data_source_api_key_binding:db.session.delete(data_source_api_key_binding)