|
|
|
|
@ -91,7 +91,6 @@ class DatasourceProviderService:
|
|
|
|
|
|
|
|
|
|
return secret_input_form_variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_datasource_credentials(self, tenant_id: str, provider: str, plugin_id: str) -> list[dict]:
|
|
|
|
|
"""
|
|
|
|
|
get datasource credentials.
|
|
|
|
|
@ -102,9 +101,11 @@ class DatasourceProviderService:
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
# Get all provider configurations of the current workspace
|
|
|
|
|
datasource_providers: list[DatasourceProvider] = db.session.query(DatasourceProvider).filter_by(tenant_id=tenant_id,
|
|
|
|
|
provider=provider,
|
|
|
|
|
plugin_id=plugin_id).all()
|
|
|
|
|
datasource_providers: list[DatasourceProvider] = db.session.query(DatasourceProvider).filter(
|
|
|
|
|
DatasourceProvider.tenant_id == tenant_id,
|
|
|
|
|
DatasourceProvider.provider == provider,
|
|
|
|
|
DatasourceProvider.plugin_id == plugin_id
|
|
|
|
|
).all()
|
|
|
|
|
if not datasource_providers:
|
|
|
|
|
return []
|
|
|
|
|
copy_credentials_list = []
|
|
|
|
|
@ -127,7 +128,6 @@ class DatasourceProviderService:
|
|
|
|
|
|
|
|
|
|
return copy_credentials_list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def remove_datasource_credentials(self,
|
|
|
|
|
tenant_id: str,
|
|
|
|
|
provider: str,
|
|
|
|
|
@ -146,4 +146,3 @@ class DatasourceProviderService:
|
|
|
|
|
if datasource_provider:
|
|
|
|
|
db.session.delete(datasource_provider)
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
|