SolidOS / SolidOS/solid-ui

getPod() assumes subdomain pattern, breaks path-based pods

オープン
#651 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
153
フォーク
46
平均マージ
1日 8時間
マージ済み PR(30日)
7

説明

Problem

The getPod() function in src/utils/headerFooterHelpers.ts assumes pods are at the origin (subdomain pattern), which breaks path-based pod servers.

Current code (line 17-20):

export function getPod (): NamedNode {
  // @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers
  return sym(document.location.origin).site()
}

The TODO comment acknowledges this limitation.

Impact

When using a path-based pod server (e.g., http://server.com/alice/), after login:

  • WebID: http://server.com/alice/profile/card#me
  • getPod() returns: http://server.com/
  • Profile guess becomes: http://server.com/profile/card#me
  • Should be: http://server.com/alice/profile/card#me

This causes 404 errors when mashlib tries to load the user's profile.

Affected Servers

  • Any path-based pod server
  • CSS (Community Solid Server) supports both subdomain and path patterns
  • JSS (JavaScript Solid Server) uses path pattern

Suggested Fix

Derive the pod root from the logged-in user's WebID rather than assuming document.location.origin:

export function getPod (): NamedNode {
  const user = authn.currentUser()
  if (user) {
    // Extract pod root from WebID's pim:storage or by convention
    const storage = getStorage(user)
    if (storage) return storage
  }
  // Fallback to origin-based (subdomain pattern)
  return sym(document.location.origin).site()
}

Or use the pim:storage triple from the user's profile which explicitly declares the pod root.

Environment

  • solid-ui version: latest (via mashlib CDN)
  • Server: JSS (JavaScript Solid Server) with path-based pods

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

src/utils/headerFooterHelpers.ts の getPod() から始め、周辺のユーティリティで authn.currentUser()、WebID データ、storage がどのように利用可能になっているかを確認してください。http://server.com/alice/ のようなパスベースの pod で動作を検証し、サブドメイン pod 用の既存の origin ベースのフォールバックを維持してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
authentication
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。