Skip to content

ACL relative URIs not resolving correctly #24

@melvincarvalho

Description

@melvincarvalho

Description

Relative URIs in ACL files (e.g., <./resource> or <./>) are not being resolved relative to the ACL file's location. This requires using absolute URLs in ACL files, which is non-standard.

Expected Behavior

Per the Solid WAC spec, relative URIs in ACL files should resolve relative to the ACL document's URL. For example, in /credit/.acl:

<#public>
    a acl:Authorization ;
    acl:accessTo <./> ;  # Should resolve to /credit/
    acl:default <./> ;
    acl:mode acl:Read .

Actual Behavior

Relative URIs don't match. Only absolute URLs work:

{
  "acl:accessTo": {"@id": "http://melvincarvalho.com/credit/week.json"}
}

Location

The issue appears to be in src/wac/checker.js in the urlMatches function, which does a simple string comparison without resolving relative URIs first.

Suggested Fix

Before comparing URLs in urlMatches(), resolve relative URIs against the ACL document's base URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions