javascript-solid-server 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -138,10 +138,11 @@ export async function createPodStructure(name, webId, baseUrl) {
138
138
  await storage.createContainer(`${podPath}public/`);
139
139
  await storage.createContainer(`${podPath}private/`);
140
140
  await storage.createContainer(`${podPath}settings/`);
141
+ await storage.createContainer(`${podPath}profile/`);
141
142
 
142
- // Generate and write WebID profile as index.html at pod root
143
+ // Generate and write WebID profile at /profile/card (standard Solid location)
143
144
  const profileHtml = generateProfile({ webId, name, podUri, issuer });
144
- await storage.write(`${podPath}index.html`, profileHtml);
145
+ await storage.write(`${podPath}profile/card`, profileHtml);
145
146
 
146
147
  // Generate and write preferences
147
148
  const prefs = generatePreferences({ webId, podUri });
@@ -175,6 +176,11 @@ export async function createPodStructure(name, webId, baseUrl) {
175
176
  const publicAcl = generatePublicFolderAcl(`${podUri}public/`, webId);
176
177
  await storage.write(`${podPath}public/.acl`, serializeAcl(publicAcl));
177
178
 
179
+ // Profile folder: owner full, public read (with inheritance)
180
+ // Profile documents must be publicly readable for WebID verification
181
+ const profileAcl = generatePublicFolderAcl(`${podUri}profile/`, webId);
182
+ await storage.write(`${podPath}profile/.acl`, serializeAcl(profileAcl));
183
+
178
184
  return { podPath, podUri };
179
185
  }
180
186
 
@@ -224,22 +230,22 @@ export async function handleCreatePod(request, reply) {
224
230
  }
225
231
 
226
232
  // Build URIs
227
- // WebID is at pod root: /alice/#me (path mode) or alice.example.com/#me (subdomain mode)
233
+ // WebID follows standard Solid convention: /alice/profile/card#me
228
234
  const subdomainsEnabled = request.subdomainsEnabled;
229
235
  const baseDomain = request.baseDomain;
230
236
 
231
237
  let baseUri, podUri, webId;
232
238
  if (subdomainsEnabled && baseDomain) {
233
- // Subdomain mode: alice.example.com/
239
+ // Subdomain mode: alice.example.com/profile/card#me
234
240
  const podHost = `${name}.${baseDomain}`;
235
241
  baseUri = `${request.protocol}://${baseDomain}`;
236
242
  podUri = `${request.protocol}://${podHost}/`;
237
- webId = `${podUri}#me`;
243
+ webId = `${podUri}profile/card#me`;
238
244
  } else {
239
- // Path mode: example.com/alice/
245
+ // Path mode: example.com/alice/profile/card#me
240
246
  baseUri = `${request.protocol}://${request.hostname}`;
241
247
  podUri = `${baseUri}${podPath}`;
242
- webId = `${podUri}#me`;
248
+ webId = `${podUri}profile/card#me`;
243
249
  }
244
250
 
245
251
  // Issuer needs trailing slash for CTH compatibility
@@ -354,10 +354,10 @@ export async function handleRegisterPost(request, reply, issuer) {
354
354
  }
355
355
 
356
356
  try {
357
- // Build URLs
357
+ // Build URLs - WebID follows standard Solid convention: /profile/card#me
358
358
  const baseUrl = issuer.endsWith('/') ? issuer.slice(0, -1) : issuer;
359
359
  const podUri = `${baseUrl}/${username}/`;
360
- const webId = `${podUri}#me`;
360
+ const webId = `${podUri}profile/card#me`;
361
361
 
362
362
  // Check if pod already exists
363
363
  const podPath = `${username}/`;
@@ -149,8 +149,9 @@ export async function createProvider(issuer) {
149
149
  scopes: ['openid', 'webid', 'profile', 'email', 'offline_access'],
150
150
 
151
151
  // Claims configuration
152
+ // Always include webid with openid scope for Solid-OIDC compliance
152
153
  claims: {
153
- openid: ['sub'],
154
+ openid: ['sub', 'webid'],
154
155
  webid: ['webid'],
155
156
  profile: ['name'],
156
157
  email: ['email', 'email_verified'],