|
|
|
|
@ -84,7 +84,7 @@ class DatasourceProviderService:
|
|
|
|
|
credential_form_schemas = datasource_provider.declaration.credentials_schema
|
|
|
|
|
secret_input_form_variables = []
|
|
|
|
|
for credential_form_schema in credential_form_schemas:
|
|
|
|
|
if credential_form_schema.type == FormType.SECRET_INPUT:
|
|
|
|
|
if credential_form_schema.type.value == FormType.SECRET_INPUT.value:
|
|
|
|
|
secret_input_form_variables.append(credential_form_schema.name)
|
|
|
|
|
|
|
|
|
|
return secret_input_form_variables
|
|
|
|
|
@ -131,6 +131,33 @@ class DatasourceProviderService:
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return copy_credentials_list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_all_datasource_credentials(self, tenant_id: str) -> list[dict]:
|
|
|
|
|
"""
|
|
|
|
|
get datasource credentials.
|
|
|
|
|
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
# get all plugin providers
|
|
|
|
|
manager = PluginDatasourceManager()
|
|
|
|
|
datasources = manager.fetch_installed_datasource_providers(tenant_id)
|
|
|
|
|
datasource_credentials = []
|
|
|
|
|
for datasource in datasources:
|
|
|
|
|
credentials = self.get_datasource_credentials(tenant_id=tenant_id,
|
|
|
|
|
provider=datasource.provider,
|
|
|
|
|
plugin_id=datasource.plugin_id)
|
|
|
|
|
datasource_credentials.append({
|
|
|
|
|
"provider": datasource.provider,
|
|
|
|
|
"plugin_id": datasource.plugin_id,
|
|
|
|
|
"plugin_unique_identifier": datasource.plugin_unique_identifier,
|
|
|
|
|
"icon": datasource.declaration.identity.icon,
|
|
|
|
|
"name": datasource.declaration.identity.name,
|
|
|
|
|
"description": datasource.declaration.identity.description.model_dump(),
|
|
|
|
|
"author": datasource.declaration.identity.author,
|
|
|
|
|
"credentials": credentials,
|
|
|
|
|
})
|
|
|
|
|
return datasource_credentials
|
|
|
|
|
|
|
|
|
|
def get_real_datasource_credentials(self, tenant_id: str, provider: str, plugin_id: str) -> list[dict]:
|
|
|
|
|
"""
|
|
|
|
|
|