-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gateway: dedicated error type for denylists #591
Comments
Note: the same concerns exist for https://github.com/ipfs/go-ipfs-cmds. If we are not able to also return adequate HTTP status code there, then we'd still have to do string matching. As for 451 vs 410, it's not too important imho. 451 seems more appropriate to me but if kubo goes for 410, I think we'd align to that. |
As for https://github.com/ipfs/go-ipfs-cmds, I think it would be a goal with beneficial side effects: right now, spread into kubo, some errors are just bubbling up and surface as 500s, because there is no way to classify them in a meaningful way for the user/client interface. On the top of my head, there is:
Typically, those kind of errors would be implemented in a proxy, but that remains awkward. As more and more logic get built and integrated into kubo (or on top of boxo), more and more sources of this kind of errors get triggered deep into kubo/boxo, with no way to interpret them besides string matching. We already have errors akin to 451, 504 and 507 in those places. A set of error wrapper, interpreted by the gateway and https://github.com/ipfs/go-ipfs-cmds would help quite a lot. |
just a precaution to ensure 410 takes precedence, until we address ipfs#591
* fix(gateway): ipld.ErrNotFound should result in a 404 In case of blockstore restriction like with --offline or similar restriction, returning a 500 is inappropriate. It's also going back to a previous gateway behavior (at least in kubo v0.22, possibly later). * refactor(gateway): match 410 before 404s just a precaution to ensure 410 takes precedence, until we address #591 * docs: clarify 404 use case --------- Co-authored-by: Marcin Rataj <[email protected]>
* fix(gateway): ipld.ErrNotFound should result in a 404 In case of blockstore restriction like with --offline or similar restriction, returning a 500 is inappropriate. It's also going back to a previous gateway behavior (at least in kubo v0.22, possibly later). * refactor(gateway): match 410 before 404s just a precaution to ensure 410 takes precedence, until we address ipfs#591 * docs: clarify 404 use case --------- Co-authored-by: Marcin Rataj <[email protected]>
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
boxo/gateway/errors.go
Lines 211 to 216 in b101ba0
@MichaelMure recently let me know that:
So it seems to me like this should be bundled into boxo tooling.
@MichaelMure let me know if there's any context I missed.
cc @lidel
The text was updated successfully, but these errors were encountered: