This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Change: 收紧审计接口的主体访问边界
|
||||
|
||||
## Why
|
||||
|
||||
平台 `/api/admin/audit/*` 接口仅允许超级管理员和平台账号访问。当前部分业务入口未传递当前账号类型,可能让代理或企业用户构造平台资源时间线目标;平台审计页面和调查抽屉也缺少统一的前端请求拦截。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 平台审计中心、平台资源时间线、资金链路、请求链路、风险和 Integration 等 `/api/admin/audit/*` 调用只允许超级管理员或平台账号发起。
|
||||
- 代理账号仅通过代理主体活动接口查看其支持资源;企业账号仅通过企业主体活动接口查看卡和设备资源。
|
||||
- 业务入口基于当前登录账号类型选择对应权限与调查目标,账号、店铺等不受主体活动支持的资源不向代理或企业显示平台审计入口。
|
||||
- 在共享调查加载层增加防御性校验,越权目标不发起网络请求并提示不可用。
|
||||
- 保持审计能力严格只读:所有相关前端 API 保持 GET,不新增修改、删除、导出、恢复、重试、补偿或风险处置操作。
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected specs: `audit-chain-frontend-integration`
|
||||
- Affected code: `src/components/business/audit/`, `src/utils/business/auditNavigation.ts`, audit routes/views, and business pages with audit-entry buttons including account, shop, asset, order, refund and wallet views.
|
||||
@@ -0,0 +1,26 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: 审计接口按当前主体隔离
|
||||
|
||||
前端 SHALL 仅允许超级管理员和平台账号调用 `/api/admin/audit/*` 平台审计接口。代理账号 MUST 仅调用其支持资源的代理主体活动接口;企业账号 MUST 仅调用卡和设备资源的企业主体活动接口。共享调查加载层 MUST 在请求前拒绝不匹配当前主体的调查目标。
|
||||
|
||||
#### Scenario: 代理或企业用户访问业务审计入口
|
||||
|
||||
- **WHEN** 代理或企业用户打开业务列表、详情或资源信息
|
||||
- **THEN** 前端仅显示当前主体支持的活动入口
|
||||
- **AND** 前端不请求任何 `/api/admin/audit/*` 接口
|
||||
|
||||
#### Scenario: 平台用户访问审计调查
|
||||
|
||||
- **WHEN** 超级管理员或平台账号打开平台审计、资源时间线、资金链路、请求链路、风险或 Integration 调查
|
||||
- **THEN** 前端使用对应的 `/api/admin/audit/*` GET 接口
|
||||
|
||||
### Requirement: 审计调查仅提供只读能力
|
||||
|
||||
审计调查前端 SHALL 仅使用 GET 请求读取平台审计或主体活动数据,且 MUST NOT 提供修改、删除、导出、恢复、重试、补偿或风险处置操作。
|
||||
|
||||
#### Scenario: 用户查看审计或主体活动记录
|
||||
|
||||
- **WHEN** 用户查询任一审计或主体活动视图
|
||||
- **THEN** 页面只展示只读数据和受控跳转
|
||||
- **AND** 页面不展示或调用任何写入、导出、恢复、重试、补偿或风险处置操作
|
||||
@@ -0,0 +1,16 @@
|
||||
## 1. Shared Access Rules
|
||||
|
||||
- [x] 1.1 Add shared current-user access checks for platform audit and subject activity APIs.
|
||||
- [x] 1.2 Guard the shared investigation loader so it does not request a platform audit API for agent or enterprise users.
|
||||
|
||||
## 2. Entry Points and Pages
|
||||
|
||||
- [x] 2.1 Update business audit entry points to pass current user type and use only supported subject activity targets for agents and enterprises.
|
||||
- [x] 2.2 Hide or block platform audit routes and actions for agent and enterprise users.
|
||||
- [x] 2.3 Keep finance, risk, Integration and link-timeline entries platform-only.
|
||||
|
||||
## 3. Read-only Verification
|
||||
|
||||
- [x] 3.1 Verify all audit and subject-activity methods used by the UI are GET-only.
|
||||
- [x] 3.2 Verify platform, agent and enterprise users cannot trigger the wrong API family.
|
||||
- [x] 3.3 Run lint and type checks for changed files.
|
||||
Reference in New Issue
Block a user