feat: support tool level permission control in ui (#2133)

This commit is contained in:
Yingjie He
2025-04-11 12:19:08 -07:00
committed by GitHub
parent cb32160a49
commit df7f2b8ab9
14 changed files with 1387 additions and 113 deletions
+64 -1
View File
@@ -39,7 +39,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Tool"
"$ref": "#/components/schemas/ToolInfo"
}
}
}
@@ -196,6 +196,39 @@
}
}
},
"/config/permissions": {
"post": {
"tags": [
"super::routes::config_management"
],
"operationId": "upsert_permissions",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertPermissionsQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Permission update completed",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request"
}
}
}
},
"/config/providers": {
"get": {
"tags": [
@@ -783,6 +816,22 @@
}
}
},
"ToolPermission": {
"type": "object",
"required": [
"tool_name",
"permission"
],
"properties": {
"permission": {
"$ref": "#/components/schemas/PermissionLevel"
},
"tool_name": {
"type": "string",
"description": "Unique identifier and name of the tool, format <extension_name>__<tool_name>"
}
}
},
"UpsertConfigQuery": {
"type": "object",
"required": [
@@ -799,6 +848,20 @@
},
"value": {}
}
},
"UpsertPermissionsQuery": {
"type": "object",
"required": [
"tool_permissions"
],
"properties": {
"tool_permissions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolPermission"
}
}
}
}
}
}