You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ACL relative URI resolution: ./#me not matching authenticated WebID #64
When using a relative URI like ./#me or /#me in an ACL file to reference the owner's WebID, it doesn't seem to match the authenticated user's WebID during authorization checks.
Steps to Reproduce
Set up JSS with WebID at https://example.com/#me
Authenticate as https://example.com/#me
Try to PUT a resource
Expected Behavior
./#me in /.acl should resolve to https://example.com/#me and match the authenticated user, granting write access.
Actual Behavior
Returns 403 Forbidden. The wac-allow header shows user="read" (from public ACL) instead of including write permissions.
This may be a URI resolution issue where the relative reference isn't being resolved against the ACL document's base URI before comparing with the authenticated WebID.
Found the bug in src/wac/parser.js. In parseAuthorization(), accessTo and default URIs are resolved against the base URL, but agents were not being resolved:
// These were resolved:auth.accessTo=parseUriArray(...).map(uri=>resolveUri(uri,baseUrl));auth.default=parseUriArray(...).map(uri=>resolveUri(uri,baseUrl));// But agents were NOT resolved:auth.agents=parseUriArray(node['acl:agent']||node['agent']);// Bug\!
Fix
One-line fix - resolve agent URIs against the ACL URL:
// Parse agents (WebIDs can be relative too) - resolve against ACL URLauth.agents=parseUriArray(node['acl:agent']||node['agent']).map(uri=>resolveUri(uri,aclUrl));
Note: We resolve against aclUrl (not baseUrl) because ./#me in /.acl should resolve to https://example.com/#me.
Status
Fix applied to melvincarvalho.com - can create a PR if this looks good.
@melvincarvalho
Are you sure that your .jsonld is correct.
Why not use "acl:agent": { "@id": "/#me" }, without . this is what I would have in text/turtle
You raise a good point. The . in ./#me is meant to make it relative to the current document (so ./ resolves to the ACL file's directory), but you're right that /#me would be more consistent with the Turtle convention.
I'll double-check the JSON-LD context handling and update if needed. Appreciate the review!
Activity
melvincarvalho commentedon Jan 7, 2026
Root Cause
Found the bug in
src/wac/parser.js. InparseAuthorization(),accessToanddefaultURIs are resolved against the base URL, butagentswere not being resolved:Fix
One-line fix - resolve agent URIs against the ACL URL:
Note: We resolve against
aclUrl(notbaseUrl) because./#mein/.aclshould resolve tohttps://example.com/#me.Status
Fix applied to melvincarvalho.com - can create a PR if this looks good.
Fix relative URI resolution for acl:agent
bourgeoa commentedon Jan 7, 2026
@melvincarvalho
Are you sure that your .jsonld is correct.
Why not use
"acl:agent": { "@id": "/#me" },without.this is what I would have intext/turtlemelvincarvalho commentedon Jan 7, 2026
Thanks for taking a look! 🙏
You raise a good point. The
.in./#meis meant to make it relative to the current document (so./resolves to the ACL file's directory), but you're right that/#mewould be more consistent with the Turtle convention.I'll double-check the JSON-LD context handling and update if needed. Appreciate the review!