-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(gateway): implement IPIP-402 extensions for gateway CAR requests #303
Conversation
0b2dac0
to
8f39b1a
Compare
Codecov Report
@@ Coverage Diff @@
## main #303 +/- ##
==========================================
- Coverage 50.15% 50.08% -0.08%
==========================================
Files 281 278 -3
Lines 33763 33983 +220
==========================================
+ Hits 16935 17019 +84
- Misses 15046 15173 +127
- Partials 1782 1791 +9
|
a400896
to
42f28cb
Compare
42f28cb
to
cd4653b
Compare
6520009
to
37c40dd
Compare
d62808d
to
03debb9
Compare
7647b01
to
cdc0436
Compare
fe573f5
to
817991c
Compare
4544260
to
07a0bef
Compare
df19eb1
to
a93ce13
Compare
a93ce13
to
c5f0cad
Compare
Co-authored-by: Henrique Dias <[email protected]>
- Improve documentation of public API that to conform with pkg.go.dev stylings. Can be previewed with: `go install golang.org/x/pkgsite/cmd/pkgsite@latest && pkgsite` Note that there's a bug that makes the comments in struct fields not formatted: golang/go#56004 - Renamed a few things for consistency and clarity: - `BlocksGateway` to `BlocksBackend` (it is an `IPFSBackend`) - `api` to `backend` (it is an `IPFSBackend`) - `WithHostname` to `NewHostnameHandler` - `Specification` to `PublicGateway` - `ErrorResponse` to `ErrorStatusCode` - `DagEntityByteRange` to `DagByteRange` (there isn't other) - Unexported `ServeContent`, which was never meant to be public - Removed `webRequestError`, which is already handled by `webError`. Added a test to ensure that is the case. - Removed return types from functions that always returned nil. - Exported `DagScopeEntity`, `DagScopeAll`, `DagScopeBlock` as they are `DagScope` - Change some usages of global `log` variable to request-scoped `logger` for more context - Handle CAR before maybe resolving path (CAR handles it differently) - Response formats as constants (avoids typos, etc)
- this also allows to return the PathMetadata, which also allows to set the correct X-Ipfs-Root header.
c5f0cad
to
7be4474
Compare
Plan is:
|
2023-06-08 maintainer conversation: We'll let the spec conversation around CAR roots drive if there are any CAR spec changes and ipld/go-car updates required. |
Fixes #283.