-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 support for /ipfs/{cid}?format=car|raw|... #8234
Comments
I like this querystring approach a lot. You can easily imagine extending this with new parameters for partial dag queries and the like. One thing I’d like to specify is how an implementation exposes what formats it does and does not support. Then clients can implement fallback logic in order to be more robust and servers aren’t required to implement every feature ever. |
It looks promising! Does it matter that it'd be mixing codecs
can a and can has mime/types ipld/specs#368 |
@olizilla relevant 🧵 |
|
Would it make sense to also look at the |
Food for thought (cc @warpfork): mixing IPLD codec names with formats like # fetch full DAG or a single block
?format=car
?format=block
# request response parsed using implicit IPLD lens (assume multicodec name when format is unknown)
?format=dag-json
?format=dag-cbor
?format=raw # same output as ?format=block (?)
# request response parsed using explicit IPLD lens
?format=ipld&codec=dag-json
?format=ipld&codec=dag-cbor
# TBD - surface for IPLD selector queries
?format=ipld&codec=dag-json&selector={inlined_selector}
?format=ipld&codec=dag-cbor&selector={cid_of_a_complex_selector} This explicit notation provides enough keywords to be self-explaining, and fairly easy to reason about their purpose without forcing users to read the docs. For daily use, we could add a porcelain in for of a shorter notation where |
what ever happened to this? |
@mikeal prioritization / limited bandwidth within stewards group – fleshing out details is still on the roadmap as part of gateway spec work, which I hope to get back to this quarter. 👉 If someone has bandwidth to make this happen sooner – I am all ears, happy to sync. |
Note: My take / question: can we use the codec field of CIDv1 to indicate expected format/transformation when requesting data from Grateways?
We could play it safe and use |
Block/CAR response types are implemented in #8758 – ready for review, plan is to ship it in go-ipfs 0.13. |
This is a meta issue for streamlining various feature requests and needs under a single opt-in query parameter that enables gateway users to fetch a specific representation of a specific content path.
Support for each format can be discussed/added via a separate issue/PR – this issue is just for tracking the bigger picture around unified
format
paramerer.Note: if you need CARs from an ipfs gateway today, POST to
/v0/api/dag/export?arg=<cid>
, see: https://docs.ipfs.io/reference/http/api/#api-v0-dag-exportMVP formats
Ability to fetch every CID as full DAG in CAR or a single Block
This is the key feature to enable Verifiable Gateway Responses and "HTTP-based transport for IPFS" (mobile browsers, IoT) without introducing even more dependency on
/api/v0
, and giving us flexibility for adding new features in the future.?format=car
– implemented in feat(gateway): Block and CAR response formats #8758/api/v0/dag/export
, but with better UX:/api/v0
content-disposition
defaults to{filename|cid}.car
?format=block
?format=raw
– implemented in feat(gateway): Block and CAR response formats #8758/api/v0/block/get
, but with better UX:/api/v0
content-disposition
defaults to{cid}.bin
CBOR / JSON
Moved to #8823
Future ideas / lower priorities
?format=tar|zip
?format=share-img
?format=unixfs-stats
share-img
but indag-json
format, could provide information about Size and Type (dir/file) and be leveraged for efficient pagination of huge directories (Gateway directory listings should be paginated #8455, Get some info about UnixFS objects on public IPFS HTTP API #8528)Behaviors
?format
missingdag-pb
orraw
return file/directory(current gateway behavior)
?format=car|block|..
The text was updated successfully, but these errors were encountered: