diff --git a/api/config.py b/api/config.py index a4ec6fcef95731..93de8ed21ac23e 100644 --- a/api/config.py +++ b/api/config.py @@ -49,6 +49,7 @@ 'HOSTED_ANTHROPIC_PAID_ENABLED': 'False', 'HOSTED_MODERATION_ENABLED': 'False', 'HOSTED_MODERATION_PROVIDERS': '', + 'HOSTED_EXPOSE_APP_TEMPLATES': 'False', 'CLEAN_DAY_SETTING': 30, 'UPLOAD_FILE_SIZE_LIMIT': 15, 'UPLOAD_FILE_BATCH_LIMIT': 5, @@ -290,6 +291,8 @@ def __init__(self): self.HOSTED_MODERATION_ENABLED = get_bool_env('HOSTED_MODERATION_ENABLED') self.HOSTED_MODERATION_PROVIDERS = get_env('HOSTED_MODERATION_PROVIDERS') + self.HOSTED_EXPOSE_APP_TEMPLATES = get_bool_env('HOSTED_EXPOSE_APP_TEMPLATES') + self.ETL_TYPE = get_env('ETL_TYPE') self.UNSTRUCTURED_API_URL = get_env('UNSTRUCTURED_API_URL') self.BILLING_ENABLED = get_bool_env('BILLING_ENABLED') diff --git a/api/controllers/console/explore/recommended_app.py b/api/controllers/console/explore/recommended_app.py index 8190f7828dc755..41c1717b0dd9d9 100644 --- a/api/controllers/console/explore/recommended_app.py +++ b/api/controllers/console/explore/recommended_app.py @@ -4,7 +4,9 @@ from constants.languages import languages from controllers.console import api from controllers.console.app.error import AppNotFoundError +from controllers.console.wraps import account_initialization_required from extensions.ext_database import db +from libs.login import login_required from models.model import App, RecommendedApp from services.app_service import AppService @@ -34,6 +36,8 @@ class RecommendedAppListApi(Resource): + @login_required + @account_initialization_required @marshal_with(recommended_app_list_fields) def get(self): # language args @@ -83,6 +87,8 @@ def get(self): class RecommendedAppApi(Resource): + @login_required + @account_initialization_required def get(self, app_id): app_id = str(app_id) diff --git a/api/controllers/console/explore/workflow.py b/api/controllers/console/explore/workflow.py index d56d943eb81103..7c5e211d4788bc 100644 --- a/api/controllers/console/explore/workflow.py +++ b/api/controllers/console/explore/workflow.py @@ -24,7 +24,7 @@ logger = logging.getLogger(__name__) -class WorkflowRunApi(InstalledAppResource): +class InstalledAppWorkflowRunApi(InstalledAppResource): def post(self, installed_app: InstalledApp): """ Run workflow @@ -64,7 +64,7 @@ def post(self, installed_app: InstalledApp): raise InternalServerError() -class WorkflowTaskStopApi(InstalledAppResource): +class InstalledAppWorkflowTaskStopApi(InstalledAppResource): def post(self, installed_app: InstalledApp, task_id: str): """ Stop workflow task @@ -81,5 +81,5 @@ def post(self, installed_app: InstalledApp, task_id: str): } -api.add_resource(WorkflowRunApi, '/installed-apps//workflows/run') -api.add_resource(WorkflowTaskStopApi, '/installed-apps//workflows/tasks//stop') +api.add_resource(InstalledAppWorkflowRunApi, '/installed-apps//workflows/run') +api.add_resource(InstalledAppWorkflowTaskStopApi, '/installed-apps//workflows/tasks//stop')