Skip to content

fix: publicTypeIndex.jsonld should be publicly readable - #298

Merged
melvincarvalho merged 3 commits into
gh-pagesfrom
issue-297-publictypeindex-acl
Apr 22, 2026
Merged

fix: publicTypeIndex.jsonld should be publicly readable#298
melvincarvalho merged 3 commits into
gh-pagesfrom
issue-297-publictypeindex-acl

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Summary

  • Write settings/publicTypeIndex.jsonld.acl during pod creation with public read + owner full control
  • Overrides the private default inherited from /settings/.acl
  • Applies to both container-based pods and single-user root-level pods

Background

Solid apps rely on publicTypeIndex to discover what types of resources a user has (data browsers, contact apps, friend lists, etc.). Currently it inherits the owner-only ACL from /settings/ and is unreachable.

Closes #297

Test plan

  • All 407 tests pass

Write a resource-specific ACL at settings/publicTypeIndex.jsonld.acl
granting public read (and owner full control) during pod creation.
This overrides the private default inherited from /settings/.

Without this, apps cannot discover a user's public type index, breaking
interop with the wider Solid ecosystem.

Closes #297

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Solid interoperability by ensuring each pod’s settings/publicTypeIndex.jsonld is publicly readable (while keeping /settings/ private by default), by writing a resource-specific ACL during pod creation for both container-based pods and single-user root-level pods.

Changes:

  • Write /settings/publicTypeIndex.jsonld.acl during pod creation to override inherited private defaults from /settings/.acl.
  • Apply the same fix to both container-based pod creation and single-user root-pod initialization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/server.js Adds creation of a resource-specific ACL for settings/publicTypeIndex.jsonld in single-user root-pod initialization.
src/handlers/container.js Adds creation of a resource-specific ACL for settings/publicTypeIndex.jsonld in container-based pod creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server.js
Comment on lines +625 to +627
// publicTypeIndex: public read, overrides the private default inherited from /settings/
const publicTypeIndexAcl = generateOwnerAcl(`${podUri}settings/publicTypeIndex.jsonld`, webId, false);
await storage.write('/settings/publicTypeIndex.jsonld.acl', serializeAcl(publicTypeIndexAcl));
Comment thread src/handlers/container.js
Comment on lines +204 to +206
// publicTypeIndex: public read, overrides the private default inherited from /settings/
const publicTypeIndexAcl = generateOwnerAcl(`${podUri}settings/publicTypeIndex.jsonld`, webId, false);
await storage.write(`${podPath}settings/publicTypeIndex.jsonld.acl`, serializeAcl(publicTypeIndexAcl));
Comment thread src/handlers/container.js
Comment on lines +204 to +206
// publicTypeIndex: public read, overrides the private default inherited from /settings/
const publicTypeIndexAcl = generateOwnerAcl(`${podUri}settings/publicTypeIndex.jsonld`, webId, false);
await storage.write(`${podPath}settings/publicTypeIndex.jsonld.acl`, serializeAcl(publicTypeIndexAcl));
Comment thread src/server.js
Comment on lines +625 to +627
// publicTypeIndex: public read, overrides the private default inherited from /settings/
const publicTypeIndexAcl = generateOwnerAcl(`${podUri}settings/publicTypeIndex.jsonld`, webId, false);
await storage.write('/settings/publicTypeIndex.jsonld.acl', serializeAcl(publicTypeIndexAcl));
- Test asserts publicTypeIndex is public-read and privateTypeIndex/prefs stay private
- getContentType() now handles .acl/.meta as extensions (e.g. foo.jsonld.acl)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Solid interoperability by ensuring settings/publicTypeIndex.jsonld is publicly readable (while keeping the rest of /settings/ private) by writing a resource-specific ACL during pod creation.

Changes:

  • Write settings/publicTypeIndex.jsonld.acl during pod creation (multi-pod and single-user root-pod) to override /settings/.acl inheritance.
  • Extend getContentType() to recognize *.acl / *.meta as JSON-LD when used as file extensions (e.g. publicTypeIndex.jsonld.acl).
  • Add a pod lifecycle test asserting publicTypeIndex is publicly readable while privateTypeIndex/prefs remain private.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/pod.test.js Adds coverage that publicTypeIndex is readable without auth while other /settings/ resources remain private.
src/utils/url.js Adds extension-based content-type mapping for *.acl / *.meta to support resource-specific ACL/meta sidecars.
src/server.js In single-user root-pod seeding, writes a resource-specific ACL for publicTypeIndex.jsonld.
src/handlers/container.js In multi-pod creation, writes a resource-specific ACL for publicTypeIndex.jsonld.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server.js
Comment on lines +625 to +627
// publicTypeIndex: public read, overrides the private default inherited from /settings/
const publicTypeIndexAcl = generateOwnerAcl(`${podUri}settings/publicTypeIndex.jsonld`, webId, false);
await storage.write('/settings/publicTypeIndex.jsonld.acl', serializeAcl(publicTypeIndexAcl));
Comment thread src/utils/url.js
Comment on lines +241 to +243
// Solid ACL/meta as extensions (e.g. publicTypeIndex.jsonld.acl)
'.acl': 'application/ld+json',
'.meta': 'application/ld+json'
…cTypeIndex

- url.test.js: asserts *.acl and *.meta as extensions → application/ld+json
- idp.test.js: single-user root-pod (singleUserName: '/') verifies
  publicTypeIndex is public-read and privateTypeIndex/prefs stay private

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures Solid pods expose settings/publicTypeIndex.jsonld as publicly readable by writing a resource-specific ACL during pod creation, avoiding the owner-only inheritance from /settings/.acl and restoring Solid ecosystem interoperability (issue #297).

Changes:

  • Write settings/publicTypeIndex.jsonld.acl during pod creation (both container-based pods and single-user root pod).
  • Teach getContentType() to recognize *.acl / *.meta extensions as RDF (application/ld+json), aligning with existing dotfile handling.
  • Add regression tests covering content-type detection and public/private type index access behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/url.test.js Adds regression tests for *.acl / *.meta extension content-type handling.
test/pod.test.js Verifies publicTypeIndex is public-read while privateTypeIndex and other settings stay private.
test/idp.test.js Covers single-user root-pod behavior for type index ACLs.
src/utils/url.js Maps .acl / .meta extensions to application/ld+json (in addition to dotfile handling).
src/server.js Writes /settings/publicTypeIndex.jsonld.acl in root-pod creation to override /settings/.acl default.
src/handlers/container.js Writes {pod}/settings/publicTypeIndex.jsonld.acl in standard pod creation to override /settings/.acl default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@melvincarvalho
melvincarvalho merged commit 1d16ab1 into gh-pages Apr 22, 2026
4 checks passed
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.

publicTypeIndex.jsonld should be publicly readable, not owner-only

2 participants