Repository navigation
Advertise the resource's own ACL in the Link rel="acl" header - #70
Open
chefboyrdave21 wants to merge 1 commit into
Open
chefboyrdave21 wants to merge 1 commit into
chefboyrdave21 wants to merge 1 commit into
Conversation
addWACHeaders() added `Link: <.acl>; rel="acl"` to every response. A client resolves that reference against the resource URI, so for /foo/bar.ttl it points at /foo/.acl, the ACL of the container, instead of /foo/bar.ttl.acl. Clients that change access to a single resource write to the advertised ACL. Inrupt's solid-client (universalAccess.setAgentAccess) does exactly that: it builds a new ACL with only the requested rule and saves it to the advertised URL. With the old header that replaced the rules for the whole container, so the owner lost access to everything in it. Advertise `<name.acl>` for a resource and `<.acl>` for a container, as WAC's ACL resource discovery requires. The ACL resource does not have to exist yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
WAC::addWACHeaders()addsLink: <.acl>; rel="acl"to every response. Clients resolve that reference against the resource URI, so for/foo/bar.ttlit points at/foo/.acl, the ACL of the container, not/foo/bar.ttl.acl.Clients that change the access to one resource write to the advertised ACL. Inrupt's solid-client (
universalAccess.setAgentAccess) builds a new ACL with only the requested rule and saves it to the advertised URL. With the current header that replaces the rules of the whole container, and the owner loses access to everything in it. This is the lockout reported in pdsinterop/solid-nextcloud#225.Fix
Advertise
<name.acl>for a resource and<.acl>for a container, as WAC's ACL resource discovery requires (the ACL resource does not have to exist yet). The logic is in a small publicgetAclLinkTarget()so it can be tested on its own.Tests
New
tests/unit/WACTest.php(14 cases: root and nested containers, resources at the root and nested, a percent-encoded name, ACL resources themselves), including that the advertised reference resolves to the resource's own ACL. On PHP 8.4 all of them pass. The existingDPOPTesterrors and failure (5 errors, 1 failure) are the same onmainwithout this change.On PHP 8.5 the first test that loads
WACerrors because of the deprecatedcase "PATCH";; that is fixed in a separate small PR.Verification
In solid-nextcloud on Nextcloud 35 (with the server URI fix from pdsinterop/solid-nextcloud#228):
HEAD /…/private/note.ttlnow givesLink: <note.ttl.acl>; rel="acl".setAgentAccess(note.ttl, bob, {read: true})writesnote.ttl.aclwith the owner's inherited rules plus bob's, and the owner keeps access. Before: it wroteprivate/.aclwith only bob's rule and the owner got 403 on the whole container.🤖 Generated with Claude Code