You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 585f99d
Browse filesBrowse the repository at this point in the historyBrowse files
feat(admin): import Agent Gateway HTTP tools from OpenAPI (#7923) (#8297)
* feat(admin): import Agent Gateway HTTP tools from OpenAPI
Add Admin preview and publication for Agent Gateway mcp.httpTools plans
generated from an explicitly selected OpenAPI 3.0.x subset.
- add /agent-gateway/openapi/preview and /apply with plugin-edit and exact
namespace checks; preview is read-only, apply locks the target rule,
revalidates the revision and publishes only selected items
- generate bounded GET/POST plans from literal paths, query parameters and
flat JSON bodies; reject unsupported schemas, media types, parameters and
OpenAPI 3.1 with per-operation diagnostics
- verify mapped divide/springCloud routes and reconcile allowedTools,
result filters and per-source ownership
- persist Admin-only provenance in agent_gateway_import and add
RuleMapper.selectByIdForUpdate
- widen rule.handle and operation_record_log.context for MySQL/OceanBase,
widen H2 rule.handle to CLOB, and bind Oracle CLOB columns through
OracleClobStringTypeHandler
- document the contract in docs/agent-gateway-openapi-import.md
* resolve conflict
* fix(admin): enforce the Agent Gateway tool budget before import publication
Apply now computes the merged httpTools set from the current rule plus the
selected additions, updates and removals, and rejects a selection above the
runtime limit of 16 with a specific diagnostic before any provenance or rule
write.
---------
Co-authored-by: juicew <[email protected]>
Copy file name to clipboardExpand all lines: db/init/mysql/schema.sql
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,7 @@ DROP TABLE IF EXISTS `operation_record_log`;
318
318
CREATETABLE `operation_record_log` (
319
319
`id`bigint(0) NOT NULL AUTO_INCREMENT COMMENT 'id',
320
320
`color`varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'log color',
321
-
`context`text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'log context',
321
+
`context`mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'log context',
322
322
`operator`varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'operator [user or app]]',
323
323
`operation_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'operation time',
324
324
`operation_type`varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'update' COMMENT 'operation type:create/update/delete/register...',
@@ -1748,7 +1748,7 @@ CREATE TABLE `rule` (
1748
1748
`match_restful`tinyint(0) NOT NULL COMMENT 'whether to match restful(0 cache, 1 not cache)',
1749
1749
`namespace_id`varchar(50) NOT NULL COMMENT 'namespace id',
1750
1750
`sort_code`int(0) NOT NULL COMMENT 'sort',
1751
-
`handle`text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'processing logic (here for different plug-ins, there will be different fields to identify different processes, all data in JSON format is stored)',
1751
+
`handle`mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'processing logic (here for different plug-ins, there will be different fields to identify different processes, all data in JSON format is stored)',
1752
1752
`date_created`timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
1753
1753
`date_updated`timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ONUPDATECURRENT_TIMESTAMP(3) COMMENT 'update time',
Copy file name to clipboardExpand all lines: db/upgrade/2.7.2-upgrade-2.7.3-mysql.sql
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,22 @@ CREATE UNIQUE INDEX uk_instance_info_identity ON instance_info (namespace_id, in
50
50
-- Stop Admin writers and back up mock_request_record before the one-time migration.
51
51
ALTERTABLE mock_request_record MODIFY COLUMN header TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the request param in header';
52
52
53
+
-- Agent Gateway OpenAPI import ownership: Admin-only provenance, never synchronized to gateways.
54
+
-- Stop Admin writers and back up rule before this one-time migration: handle expands to MEDIUMTEXT.
55
+
CREATETABLE `agent_gateway_import` (
56
+
`id`varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'primary key id',
57
+
`rule_id`varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'target agent gateway rule id',
58
+
`namespace_id`varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'namespace id',
59
+
`manifest` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'per-source import ownership manifest',
60
+
`date_created`timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
61
+
`date_updated`timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ONUPDATECURRENT_TIMESTAMP(3) COMMENT 'update time',
Copy file name to clipboardExpand all lines: db/upgrade/2.7.2-upgrade-2.7.3-ob.sql
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,22 @@ CREATE UNIQUE INDEX uk_instance_info_identity ON instance_info (namespace_id, in
50
50
-- Stop Admin writers and back up mock_request_record before the one-time migration.
51
51
ALTERTABLE mock_request_record MODIFY COLUMN header TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the request param in header';
52
52
53
+
-- Agent Gateway OpenAPI import ownership: Admin-only provenance, never synchronized to gateways.
54
+
-- Stop Admin writers and back up rule before this one-time migration: handle expands to MEDIUMTEXT.
55
+
CREATETABLEagent_gateway_import (
56
+
id varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'primary key id',
57
+
rule_id varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'target agent gateway rule id',
58
+
namespace_id varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'namespace id',
59
+
manifest mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'per-source import ownership manifest',
60
+
date_created timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
61
+
date_updated timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ONUPDATECURRENT_TIMESTAMP(3) COMMENT 'update time',
0 commit comments