修复轮 1:邮件 GET 改归 ops,不撑大两端共用读路由名单

全仓测试 route-access.test.ts 钉着一份有意枚举、随 Keycloak spec 审过的名单:哪些读路由被两端共用。
之前把邮件 7 条 GET 标成 design|ops,名单从八条长到十四条。裁决改路由、不改名单:邮箱那一屏落在
运营中心,设计端没有消费方;入站正文装的是客户来往内容,ADR-012 已把「设计端能读客户主数据」记为
一处有意承担的代价,不再无故加宽。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TM4kUBvekALu9qqmp7D3wr
This commit is contained in:
xcs
2026-08-26 01:36:12 +08:00
co-authored by Claude Fable 5
parent 43bacffd90
commit c5cb779390
2 changed files with 13 additions and 13 deletions
@@ -1,6 +1,6 @@
/**
* 邮件路由的归属:15 条全部进契约,注册表建得起来(字面 / 参数模版互不撞),
* 读标两端、写归运营中心(设计稿 §7.2)。
* 读写都归运营中心(设计稿 §7.2 + 2026-08-26 裁决:设计端没有消费方,不再无故加宽)。
*/
import { describe, expect, it } from 'vitest';
import * as contracts from '@contracts';
@@ -17,10 +17,9 @@ describe('邮件路由契约', () => {
}
});
it('读标两端,写归 ops', () => {
it('读写都归 ops', () => {
for (const route of MAIL_ROUTES) {
if (route.method === 'GET') expect(route.access).toEqual(['design', 'ops']);
else expect(route.access).toBe('ops');
expect(route.access).toBe('ops');
}
});
@@ -28,6 +27,6 @@ describe('邮件路由契约', () => {
const registry = buildRouteRegistry(routesOf(Object.values(contracts)));
expect(registry.lookup('POST', '/api/gov/mail/accounts/probe')).toBe('ops');
expect(registry.lookup('POST', '/api/gov/mail/accounts/acc-1/probe')).toBe('ops');
expect(registry.lookup('GET', '/api/gov/mail/inbound/m-1/attachments/0')).toEqual(['design', 'ops']);
expect(registry.lookup('GET', '/api/gov/mail/inbound/m-1/attachments/0')).toBe('ops');
});
});