Skip to content

Conversation

@melvincarvalho
Copy link
Contributor

Summary

Adds test coverage for acl:AuthenticatedAgent functionality, addressing issue #58.

Changes

  • Added integration test in test/auth.test.js that validates acl:AuthenticatedAgent behavior
  • Test creates a resource with a custom ACL using acl:AuthenticatedAgent
  • Verifies three critical scenarios:
    1. ❌ Anonymous/unauthenticated users are denied access (401)
    2. ✅ Resource owner has access (200)
    3. Any authenticated user has access (200) - key distinction

Test Approach

The test:

  1. Creates two test pods (authuser1 and authuser2)
  2. Creates a resource under authuser1/authenticated-only/test.txt
  3. Applies a custom ACL with acl:AuthenticatedAgent to the parent container
  4. Validates access control for all three user types

Why This Matters

This test validates the key semantic difference between:

Access Type Anonymous Owner Other Authenticated
foaf:Agent (public)
Specific agent (private)
acl:AuthenticatedAgent

The implementation already works correctly (exists in src/wac/parser.js and src/wac/checker.js), but this test ensures the behavior is validated and won't regress.

Related

Add test to verify that acl:AuthenticatedAgent works correctly:
- Denies anonymous/unauthenticated access
- Allows the resource owner
- Allows ANY authenticated user (key distinction from private ACLs)

Fixes #58
The ACL needs to include owner with Control permission to manage the ACL
and preserve their Write access. Without this, the custom ACL would
override the inherited permissions completely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test coverage for acl:AuthenticatedAgent

1 participant