fix: publicTypeIndex.jsonld should be publicly readable - #298
Conversation
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
There was a problem hiding this comment.
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.aclduring 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.
| // 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)); |
| // 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)); |
| // 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)); |
| // 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)
There was a problem hiding this comment.
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.aclduring pod creation (multi-pod and single-user root-pod) to override/settings/.aclinheritance. - Extend
getContentType()to recognize*.acl/*.metaas JSON-LD when used as file extensions (e.g.publicTypeIndex.jsonld.acl). - Add a pod lifecycle test asserting
publicTypeIndexis publicly readable whileprivateTypeIndex/prefsremain 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.
| // 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)); |
| // 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
There was a problem hiding this comment.
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.aclduring pod creation (both container-based pods and single-user root pod). - Teach
getContentType()to recognize*.acl/*.metaextensions 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.
Summary
settings/publicTypeIndex.jsonld.aclduring pod creation with public read + owner full control/settings/.aclBackground
Solid apps rely on
publicTypeIndexto 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