resolve relative symlinks server side on gateway

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
領域
backend

調査の方向性

このIssueではファイルもテストも指定されていません。まず、UnixFS symlinkのgatewayエントリポイントと、既存のパス解決フローを見つけてください。相対リンクがDAG内で字句的に解決され、連鎖したリンクが少なくとも深さ32まで機能し、無効なトラバーサルまたは過剰な深さでエラーが発生すれば完了です。

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

説明

need/triage

When a unixfs symlink is hit, if the mode is file (not block or car), gateway should emulate nginx and apache, that means resolve the symlink server side and return whatever file is being pointed to.

This proposal only targets relative symlinks (I have no idea what should happen with absolute ones).

To resolve it mean, take the current base path (the path of the folder containing the symlink).
Add the symlink path, do a lexical simplification (remove a/.. and . entries), and repeat the usual gateway process at that point.

Gateway MUST error if the lexical simplification errors (such as by a symlink having more .. than how deep it is in the dag).

Gateway MUST support recursively doing that (symlinks pointing to other symlinks). It MUST support a depth of at least 32, and SHOULD raise an error if number gets too big.

For example take this tree:

CID
+ a
| +- symlink (../b/example)
+ b
  +- example

Loading CID/a/symlink the gateway would need to send the content of CID/b/example.
Because
First it resolve /a/symlink see that it's a symlink applies the content to the base path /a/../b/example
And then do a lexical simplification /b/example and then send this path content.

主要言語
HTML
スター
1.2k
フォーク
250
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

ipfs/specs のほかの issue

ipfs/specs の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

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

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