| 123456789101112131415161718192021222324252627 | from flask_login import current_userfrom flask_restful import Resourcefrom werkzeug.exceptions import Forbiddenfrom controllers.console import apifrom controllers.console.setup import setup_requiredfrom controllers.console.wraps import account_initialization_requiredfrom libs.login import login_requiredfrom services.plugin.plugin_debugging_service import PluginDebuggingServiceclass PluginDebuggingKeyApi(Resource):    @setup_required    @login_required    @account_initialization_required    def get(self):        user = current_user        if not user.is_admin_or_owner:            raise Forbidden()                tenant_id = user.current_tenant_id        return {            "key": PluginDebuggingService.get_plugin_debugging_key(tenant_id)        }api.add_resource(PluginDebuggingKeyApi, "/workspaces/current/plugin/debugging-key")
 |