Repository navigation
Commit 3660b96
authored
* fix(mcp): write_acl sets accessTo to the resource URL, not './' — fixes owner lockout (#575)
buildAclDoc hardcoded `acl:accessTo: './'`, which resolves against the
.acl document's own URL. For a container ACL that lands on the container
(correct), but for a resource ACL (<resource>.acl) it resolves to the
parent container. checkAuthorizations() requires an exact accessTo match,
so the resource was left with zero authorizations — denying everyone,
including the owner who just granted themselves Control.
- buildAclDoc now takes the explicit absolute target URL (as parser.js
already does everywhere) and emits acl:default only for containers.
- Harden the lockout safety net: a controlling authorization must also
*apply to the target* (accessTo/default covers it), so a mismatched
accessTo is refused instead of silently locking the owner out.
- Add a resource-level write_acl/read_acl regression test; the existing
round-trip test only exercised a container path, which is why this
slipped through.
Closes #575. Reported by @NilsBM.
* write_acl: use relative target IRI (host-portable) instead of absolute URL
Copilot review: writing an absolute accessTo bakes the current origin into
stored ACLs, breaking host-portability (#428). Emit the correct *relative*
target instead: './' for a container, './<basename>' for a resource. It
still resolves to the right resource (the parser resolves it against the
.acl URL at check time, fixing #575) while keeping pods movable across
origins. The lockout safety check keeps using the absolute targetUrl, which
parseAcl produces by resolving the relative ref.
* write_acl: correct the accessTo-resolution comment (Copilot review)
The relative accessTo is resolved against the ACL base URL (parser.js
getBaseUrl(), i.e. the parent container directory), not the .acl
document's own URL. Comment-only; the targetRef logic is unchanged.
* write_acl: distinguish the two lockout-refusal causes (Copilot review)
The appliesToTarget gate gave the refusal a second trigger (Control
granted but accessTo/default doesn't cover the target). Split the message
so the caller knows whether to fix the agent WebIDs (not granted Control)
or the accessTo target (granted but doesn't apply here).
1 parent 45d34bd commit 3660b96
2 files changed
Lines changed: 96 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
309 | 319 | | |
310 | 320 | | |
311 | 321 | | |
| |||
316 | 326 | | |
317 | 327 | | |
318 | 328 | | |
319 | | - | |
320 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
321 | 333 | | |
322 | 334 | | |
323 | 335 | | |
| |||
340 | 352 | | |
341 | 353 | | |
342 | 354 | | |
343 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
344 | 365 | | |
345 | 366 | | |
346 | 367 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
353 | 376 | | |
354 | 377 | | |
355 | | - | |
| 378 | + | |
| 379 | + | |
356 | 380 | | |
357 | 381 | | |
358 | 382 | | |
359 | 383 | | |
360 | 384 | | |
361 | | - | |
362 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
363 | 399 | | |
364 | 400 | | |
365 | 401 | | |
366 | 402 | | |
367 | 403 | | |
368 | 404 | | |
369 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
370 | 414 | | |
371 | 415 | | |
372 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
325 | 362 | | |
326 | 363 | | |
327 | 364 | | |
| |||
0 commit comments