Repository navigation
Commit 92a4eca
authored
fix(managed-agent): Declare the tenant filter's 403 on the task read routes (#12966)
* fix(managed-agent): Declare the tenant filter's 403 on the task read routes
The tenant filter answers 403 actor_scope_mismatch on every /v1/agents
and WebShell route when an authenticated actor does not belong to the
tenant. The Session, lifecycle, operation and Turn routes declare it, but
the task list, detail and event routes did not, and the task contract
note said that the read routes declare no 403. Declare it on the six task
read routes of both surfaces, say in the shared Forbidden response that
it covers this code, and move the contract to v1.21.0. The contract test
probes the 403 on the four served task routes.
The note also records the A9 decision: the Legacy paused and pausing
states map to waiting, and TaskState gains no state.
Part of #12847.
* fix(managed-agent): Pin the planned task routes' 403 and the filter prefix
The contract test probes the 403 only on mapped routes, so nothing
checked the declarations on the planned task event routes. A new check
in PlannedTaskContractTest requires the 403 on the planned task event
and cancel routes of both surfaces.
The tenant filter matches the /v1/agents/ prefix with its trailing slash,
so the collection path POST /v1/agents skips it. Say /v1/agents/ in the
Forbidden description and the v1.21 note, as the design note does.
* docs(managed-agent): Name both 403 triggers and the filter's 400
The tenant filter answers 403 actor_scope_mismatch for an actor from
another tenant and for an actor with an invalid ID; the Forbidden
description named only the first. The task contract note now names
both, lists the filter's 400 invalid_tenant beside it, and records the
sixth PlannedTaskContractTest test in sections 5 and 6.1 parent ab097b9 commit 92a4eca
6 files changed
Lines changed: 86 additions & 16 deletions
File tree
- docs/design
- packages
- sdk-java/managed-agent-server/src
- main/resources/openapi
- test/java/com/alibaba/qwen/code/managedagent
- web-shell/client/components/managed/generated
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
| 273 | + | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| 285 | + | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
289 | 292 | | |
290 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
291 | 299 | | |
292 | 300 | | |
293 | 301 | | |
| |||
318 | 326 | | |
319 | 327 | | |
320 | 328 | | |
321 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
| |||
327 | 337 | | |
328 | 338 | | |
329 | 339 | | |
330 | | - | |
| 340 | + | |
| 341 | + | |
331 | 342 | | |
332 | 343 | | |
333 | 344 | | |
| |||
368 | 379 | | |
369 | 380 | | |
370 | 381 | | |
371 | | - | |
372 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
373 | 387 | | |
374 | 388 | | |
375 | 389 | | |
| |||
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| 218 | + | |
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
| |||
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
243 | | - | |
| 247 | + | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
249 | 254 | | |
250 | | - | |
| 255 | + | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
| |||
275 | 280 | | |
276 | 281 | | |
277 | 282 | | |
278 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
279 | 286 | | |
280 | 287 | | |
281 | 288 | | |
| |||
0 commit comments