1. 新增 api 绑定客户凭证进行权限校验

This commit is contained in:
chenbowen
2025-12-09 16:24:17 +08:00
parent 91c0cbc5d7
commit 29e0c7da14
30 changed files with 415 additions and 112 deletions

View File

@@ -1625,7 +1625,7 @@ INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (100, '用户管理', 'system:user:list', 2, 1, 1, 'user', 'ep:avatar', 'system/user/index', 'SystemUser', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2025-03-15 21:30:41', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (101, '角色管理', '', 2, 2, 1, 'role', 'ep:user', 'system/role/index', 'SystemRole', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-05-01 18:35:29', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (102, '菜单管理', '', 2, 3, 1, 'menu', 'ep:menu', 'system/menu/index', 'SystemMenu', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:03:50', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (103, '部门管理', '', 2, 4, 1, 'dept', 'fa:address-card', 'system/dept/index', 'SystemDept', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:28', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (103, '组织管理', '', 2, 4, 1, 'dept', 'fa:address-card', 'system/dept/index', 'SystemDept', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:28', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (104, '岗位管理', '', 2, 5, 1, 'post', 'fa:address-book-o', 'system/post/index', 'SystemPost', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:06:39', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (105, '字典管理', '', 2, 6, 1, 'dict', 'ep:collection', 'system/dict/index', 'SystemDictType', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-02-29 01:07:12', '0');
INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted) VALUES (106, '配置管理', '', 2, 8, 2, 'config', 'fa:connectdevelop', 'infra/config/index', 'InfraConfig', 0, '1', '1', '1', 'admin', '2021-01-05 17:03:48', '1', '2024-04-23 00:02:45', '0');

View File

@@ -0,0 +1,45 @@
/*
* Databus API 凭证绑定与访问日志补充字段DM8
* Generated on 2025-12-09
*/
-- ----------------------------
-- Table structure for databus_api_definition_credential
-- ----------------------------
CREATE TABLE databus_api_definition_credential (
id BIGINT NOT NULL PRIMARY KEY,
tenant_id BIGINT NOT NULL DEFAULT 0,
api_id BIGINT NOT NULL,
credential_id BIGINT NOT NULL,
app_id VARCHAR(128),
creator VARCHAR(64) DEFAULT '' NOT NULL,
create_time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
updater VARCHAR(64) DEFAULT '' NOT NULL,
update_time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
deleted BIT DEFAULT '0' NOT NULL
);
CREATE UNIQUE INDEX uk_databus_api_definition_credential ON databus_api_definition_credential (api_id, credential_id, deleted);
CREATE INDEX idx_databus_api_definition_credential_api ON databus_api_definition_credential (api_id);
CREATE INDEX idx_databus_api_definition_credential_cred ON databus_api_definition_credential (credential_id);
COMMENT ON TABLE databus_api_definition_credential IS 'Databus API 凭证绑定表';
COMMENT ON COLUMN databus_api_definition_credential.id IS '主键 ID';
COMMENT ON COLUMN databus_api_definition_credential.tenant_id IS '租户编号';
COMMENT ON COLUMN databus_api_definition_credential.api_id IS 'API 定义 ID';
COMMENT ON COLUMN databus_api_definition_credential.credential_id IS '凭证 ID';
COMMENT ON COLUMN databus_api_definition_credential.app_id IS '凭证应用标识冗余';
COMMENT ON COLUMN databus_api_definition_credential.creator IS '创建者';
COMMENT ON COLUMN databus_api_definition_credential.create_time IS '创建时间';
COMMENT ON COLUMN databus_api_definition_credential.updater IS '更新者';
COMMENT ON COLUMN databus_api_definition_credential.update_time IS '更新时间';
COMMENT ON COLUMN databus_api_definition_credential.deleted IS '逻辑删除标记';
-- ----------------------------
-- Alter databus_api_access_log add credential columns
-- ----------------------------
ALTER TABLE databus_api_access_log ADD credential_app_id VARCHAR(128);
COMMENT ON COLUMN databus_api_access_log.credential_app_id IS '调用凭证应用标识';
ALTER TABLE databus_api_access_log ADD credential_id BIGINT;
COMMENT ON COLUMN databus_api_access_log.credential_id IS '调用凭证 ID';