gateway: dedicated error type for denylists

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

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

  • #855 @PsychoPunkSage による — マージされずにクローズ

評価

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

調査の方向性

gateway/errors.go の 211-216 行から始めて、現在の string ベースの denylist エラー処理を調査します。専用の blocked エラー型をどのようにラップするか、また 410/451 レスポンスの選択をエラーツール側と gateway のどちらに置くかを定義します。完了条件は、これらのケースで string チェックが不要になり、ステータスの挙動が決定されていることです。

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

説明

dif/medium kind/enhancement P2 topic/gateway

Right now we don't use proper error types to convey that some content requested by a gateway was blocked. Instead we have this string based checking tied to nopfs

https://github.com/ipfs/boxo/blob/b101ba0858150cd6a34b6cb68eefd28c411bd58c/gateway/errors.go#L211-L216

@MichaelMure recently let me know that:

  1. Infura also does some string based error checking for their errors
  2. They return 451 when rather than just 410

So it seems to me like this should be bundled into boxo tooling.

  1. Have an error type indicating that it's a blocked error (which other tools like nopfs or others can wrap)
  2. Given that 451 and 410 both seem plausible either that should be configurable by the error tooling, or at the gateway level
    • At the moment I don't know anyone mixing 410s + 451s but that may not always be the case

@MichaelMure let me know if there's any context I missed.

cc @lidel

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

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

ipfs/boxo のほかの issue

ipfs/boxo の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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