gateway: dedicated error type for denylists

Aperta
#591 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #855 di @PsychoPunkSage — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Inizia dalle righe 211-216 di gateway/errors.go ed esamina l’attuale gestione degli errori della denylist basata su stringhe. Definisci come debba essere wrappato un tipo di errore blocked dedicato e se la scelta della risposta 410/451 appartenga agli strumenti per gli errori o al gateway; il lavoro è completato quando questi casi non richiedono più controlli sulle stringhe e il comportamento dello status è deciso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
326
Fork
165
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ipfs/boxo

Tutte le issue di ipfs/boxo

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.