Commit fa368e3
committed
feat: emit relative acl:agent in pod creation
Phase 2 of JavaScriptSolidServer#427 (JavaScriptSolidServer#430). Builds on JavaScriptSolidServer#429 (relative accessTo/default).
The owner WebID lives at <pod>/profile/card.jsonld#me. Each .acl now
references it relative to that .acl's container — './profile/card.jsonld#me'
from the pod root, '../profile/card.jsonld#me' from an immediate child
folder, './card.jsonld#me' from /profile/.acl. The parser already
resolves relative agent URIs against the .acl URL (PR JavaScriptSolidServer#65 / JavaScriptSolidServer#64), so
this is a writer-side change only. Existing absolute-agent ACLs on
disk continue to authorize correctly.
Together with JavaScriptSolidServer#429 the on-disk pod is now host-portable: an operator
can `mv` a pod directory to a different domain without rewriting any
ACL files. Same-host owner read/write keeps working — covered by
existing pod creation / ACL access tests.
The `webId` parameter on createPodStructure / createRootPodStructure
remains the absolute WebID URI: it is still the global identifier
published in the profile document and consumed by OIDC, federation,
typeIndex generation, etc. Only the in-ACL references become relative.
Cross-host *owner write* (token issued by host A, request to host B)
still mismatches because the token's `webid` claim is fixed at auth
time; that's Phase 4 and needs its own design.
Tests:
- 4 unit tests (one per affected generator) verify a relative agent
string is preserved verbatim.
- 2 round-trip tests parse the same on-wire ACL under different host
URLs and assert the agent resolves to the requesting host, including
the parent-relative '../profile/card.jsonld#me' from a child folder.
793/793 tests pass.1 parent 8dd60c1 commit fa368e3
4 files changed
Lines changed: 104 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
201 | 211 | | |
202 | 212 | | |
203 | | - | |
| 213 | + | |
204 | 214 | | |
205 | 215 | | |
206 | | - | |
| 216 | + | |
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
212 | | - | |
| 222 | + | |
| 223 | + | |
213 | 224 | | |
214 | 225 | | |
215 | | - | |
| 226 | + | |
216 | 227 | | |
217 | 228 | | |
218 | | - | |
| 229 | + | |
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
222 | | - | |
| 233 | + | |
223 | 234 | | |
224 | 235 | | |
225 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
972 | 978 | | |
973 | 979 | | |
974 | | - | |
| 980 | + | |
975 | 981 | | |
976 | 982 | | |
977 | | - | |
| 983 | + | |
978 | 984 | | |
979 | 985 | | |
980 | 986 | | |
981 | | - | |
| 987 | + | |
982 | 988 | | |
983 | 989 | | |
984 | | - | |
| 990 | + | |
985 | 991 | | |
986 | 992 | | |
987 | | - | |
| 993 | + | |
988 | 994 | | |
989 | 995 | | |
990 | | - | |
| 996 | + | |
991 | 997 | | |
992 | 998 | | |
993 | 999 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| |||
290 | 292 | | |
291 | 293 | | |
292 | 294 | | |
293 | | - | |
294 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| |||
323 | 327 | | |
324 | 328 | | |
325 | 329 | | |
326 | | - | |
327 | | - | |
| 330 | + | |
| 331 | + | |
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| |||
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
366 | | - | |
367 | | - | |
| 370 | + | |
| 371 | + | |
368 | 372 | | |
369 | 373 | | |
370 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 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 | + | |
299 | 354 | | |
300 | 355 | | |
301 | 356 | | |
| |||
0 commit comments