docs: ship the RLS template where downstream can actually read it
The CHANGELOG pointed at research-wiki for the RLS template and its three traps, but setuptools has no MANIFEST.in here: the sdist carries src/polygateway and the README only. A downstream pip install could not reach any of it. The template and the traps now live in the README section on multi-tenancy, and the CHANGELOG points there. ARCHITECTURE.md is the single source of truth for architecture, and this change had added nothing to it. Section 5.2 gains an entry in the same shape as the issue #4 overlay one, and 7.8's field list gains tenant_id and meta -- plus reasoning_tokens, which issue #6 had already left out, so the port's field-count chain reads 18 to 20 to 21 to 22 to 24 with no gaps.
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@
|
||||
|
||||
不自动启用的首要理由是 **default-deny**: 启用 RLS 而无匹配 policy = 零行可写,且**静默不报错**。三个下游里只有一个是多租户,库若自动启用,其余部署升级后遥测**全量写失败**,再叠加遥测的静默降级铁律,就是无声全局丢数据——恰是本 issue 所担心的"不可逆"的最坏形态。其余理由: policy 必须绑定角色而库只拿到一条连接串;`CREATE POLICY` / `ALTER TABLE` 要求表属主,而按最佳实践部署时库的运行时角色恰好不是属主;SQLite 根本没有 RLS,承诺 RLS 会让两个后端语义不对等。
|
||||
|
||||
RLS 模板与三个陷阱(表属主默认豁免 RLS 需 `FORCE`;租户上下文必须在**显式事务内** `set_config(..., true)`,asyncpg 默认 autocommit 下单发 `SET LOCAL` 会当场失效而 PG 只发 warning;只写 `USING` 不写 `WITH CHECK` 时租户 A 能插入标着 B 的行)见 `research-wiki/designs/2026-08-17-issue11-caller-dimensions-design.md` §4.5。
|
||||
RLS 模板与三个陷阱(表属主默认豁免 RLS 需 `FORCE`;租户上下文必须在**显式事务内** `set_config(..., true)`,asyncpg 默认 autocommit 下单发 `SET LOCAL` 会当场失效而 PG 只发 warning;只写 `USING` 不写 `WITH CHECK` 时租户 A 能插入标着 B 的行)见 README「多租户与自定义维度」一节——那份模板随包分发,`research-wiki/` 不在 sdist 内。
|
||||
|
||||
## 1.2.0(2026-08-16)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user