Commit 3fe1de3
committed
`/packages` 是最后一个零授权判据的路由域:普查实测一个 guest-principal
调用方对破坏性 discard-drafts、整包 export、GET /packages 枚举面与 publish-drafts
一律 200 并真的调进目标函数。按维护者 2026-08-09 裁定补齐,两 transport 各落一份门,
门都在协议/服务解析之前(拒绝时不写不删,防「先删后拒」,也防 501-vs-200 指纹)。
dispatcher 侧(runtime/domains/packages.ts):
- shouldDenyAnonymous 作为 handlePackagesRequest 第一条语句(全域匿名门,401 在
registry 503 之前);
- requireManageMetadata 门写/破坏性路由(install/enable/disable/publish/
publish-drafts/discard-drafts/commit-revert/rollback/revert/adopt-orphans/
duplicate/manifest-PATCH/DELETE);
- requireReadCapability 门读路由(list/detail/commits/export),引用
OBJECT_SCHEMA_MASK_EXEMPT_CAPABILITIES(studio.access/setup.access),不复制。
REST direct-mount 侧(rest/package-routes.ts refusePackageRequest,经
RestServer.resolvePackageRouteExecutionContext 与其余表面同一身份解析):
- 覆盖 POST /publish、GET /、GET /:id、DELETE /:id 四条;缺 resolver 失败即关(401);
- 该面 DECLARES 的是 wrapped BaseResponseSchema 信封,故 401/403 均经共享 sendError
发出(check:route-envelope 把本模块钉在零手写 body),不是 flat ANONYMOUS_DENY_BODY。
pin:dispatcher 每路由×每档(零能力 403 且目标 spy 未进、读/写 cohort 互不越界、
isSystem 旁路、匿名 401、discard-drafts 直接读库断言草稿未删)在
domains/packages-capability-gate.test.ts;REST 每路由×每档在
package-envelope.conformance.test.ts 的 `packages authz` describe。反向验证:两 transport
禁用门后其拒绝类 pin 全红(方向如预期)。authz-conformance matrix + probe + high-risk
加 anonymous-deny-packages 一行;dogfood showcase(dispatcher 服务 /packages,无 package
服务)加四条匿名 401 + member teeth。
盲区:cloud 仓未挂载(add_repo 两次被拒),调用方普查不覆盖该仓,门可能 403 掉未普查到的
cloud 调用方 —— 落地后需在 cloud 补一次普查。#7020 记录的门能力集≠D4 掩码豁免集对齐方向仍归维护者。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uFVNMmTxLpmfQYiuKM1Yx
1 parent 3fc2e48 commit 3fe1de3
19 files changed
Lines changed: 965 additions & 43 deletions
File tree
- .changeset
- packages
- qa/dogfood/test
- rest/src
- runtime/src
- domains
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
109 | 123 | | |
110 | 124 | | |
111 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
| |||
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
178 | 192 | | |
179 | 193 | | |
180 | 194 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
240 | 281 | | |
241 | 282 | | |
242 | 283 | | |
| |||
248 | 289 | | |
249 | 290 | | |
250 | 291 | | |
| 292 | + | |
| 293 | + | |
251 | 294 | | |
252 | 295 | | |
253 | 296 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
66 | | - | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
| |||
0 commit comments