Skip to content

Commit 1991667

Browse files
committed
wip: data onboarding
1 parent cb8bfd8 commit 1991667

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

IPIP/0401.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# IPIP-0401: Data Onboarding (POST) via Writable Gateways
2+
3+
- Start Date: YYYY-MM-DD
4+
- Related Issues:
5+
- (add links here)
6+
7+
## Summary
8+
9+
## Motivation
10+
11+
## Detailed design
12+
13+
## Test fixtures
14+
15+
## Design rationale
16+
17+
### User benefit
18+
19+
### Compatibility
20+
21+
### Security
22+
23+
Introducing data onboarding via HTTP Gateways opens possibility for data creation
24+
and modification through the gateway. It is likely that not all users will want to
25+
have Writable Gateways enabled, or that they are available to everyone. Therefore,
26+
we recommend that the implementer includes an Authentication method. This
27+
authentication method can be application dependent and is therefore not specified.
28+
29+
### Alternatives
30+
31+
### Copyright
32+
33+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

src/_includes/specs/http-gateways/http.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@
1111
that allow light IPFS clients to retrieve data behind a CID and verify its integrity without delegating any
1212
trust to the gateway itself.
1313
</dd>
14+
<dt><a href="/http-gateways/writable-gateway/">Writable Gateways</a></dt>
15+
<dd>
16+
Writable Gateways are a way of onboarding data into IPFS via the HTTP gateways. It exposes a POST endpoint
17+
that supports multiple input types, then ingests the data into IPFS, returning its final location.
18+
</dd>
1419
</dl>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
date: 2023-04-17
3+
editors:
4+
- name: Henrique Dias
5+
github: hacdias
6+
url: https://hacdias.com/
7+
---
8+
9+
# Writable Gateway Specification
10+
11+
Writable Gateway is an extension of :cite[path-gateway], which allows data onboarding
12+
to IPFS via HTTP endpoints. This allows for more interoperability with the remaining
13+
of the web, and allows for more ways of adding data to IPFS.
14+
15+
# HTTP API
16+
17+
This API is a superset of the HTTP API of :cite[path-gateway]. The differences are
18+
documented below. The main difference is the introduction of a `POST` endpoint.
19+
20+
## `POST /ipfs`
21+
22+
Onboards new data to the IPFS node behind the gateway. The onboarded data can be
23+
of any of the following types and be specified via the `Content-Type` header:
24+
25+
- [`application/vnd.ipld.raw`] - adds raw [blocks] to the gateway. The data in
26+
the request body is assumed to be pure blocks of data, with no specific structure.
27+
- [`application/vnd.ipld.car`] - adds a [CAR] to the gateway. The data in the request
28+
body is assumed to be a CAR file.
29+
- [`application/x-tar`] - adds a [TAR] archive to the gateway. The data in the request
30+
body is assumed to be a TAR archive containing a directory tree that will be added
31+
as a UnixFS directory to IPFS.
32+
33+
In case of success, the request will return a `303 See Other` status code, as
34+
well as a `Location` header containing the content path of the newly added
35+
resource.
36+
37+
[`application/vnd.ipld.raw`]: https://www.iana.org/assignments/media-types/application/vnd.ipld.raw
38+
[`application/vnd.ipld.car`]: https://www.iana.org/assignments/media-types/application/vnd.ipld.car
39+
[`application/x-tar`]: https://en.wikipedia.org/wiki/Tar_(computing)
40+
[blocks]: https://docs.ipfs.io/concepts/glossary/#block
41+
[CAR]: https://docs.ipfs.io/concepts/glossary/#car
42+
[TAR]: https://en.wikipedia.org/wiki/Tar_(computing)

0 commit comments

Comments
 (0)