Skip to content

Commit f7a0d6c

Browse files
committed
wip: data onboarding
1 parent cce026c commit f7a0d6c

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

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 `201 Created` status code, as
34+
well as a `Content-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)

src/ipips/ipip-0401.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
date: 2023-04-17
3+
ipip: draft
4+
editors:
5+
- name: Henrique Dias
6+
github: hacdias
7+
url: https://hacdias.com/
8+
- name: Marcin Rataj
9+
github: lidel
10+
relatedIssues:
11+
- https://github.com/ipfs/specs/issues/375
12+
---
13+
14+
# IPIP-0401: Data Onboarding (POST) via Writable Gateways
15+
16+
## Summary
17+
18+
Create a new gateway extension, named Writable Gateway, that provides data
19+
onboarding via the HTTP method `POST`.
20+
21+
## Motivation
22+
23+
The IPFS implementation Kubo has provided a non-standardized version of a writable
24+
gateway for the past few years. This gateway has received little attention over the
25+
years and there have been requests from users in order to get a
26+
27+
## Detailed design
28+
29+
## Test fixtures
30+
31+
## Design rationale
32+
33+
### User benefit
34+
35+
### Compatibility
36+
37+
This IPIP is backwards compatible: it adds a new opt-in functionality for the gateway,
38+
not modifying any existing behaviours.
39+
40+
### Security
41+
42+
Introducing data onboarding via HTTP Gateways opens possibility for data creation
43+
and modification through the gateway. It is likely that not all users will want to
44+
have Writable Gateways enabled, or that they are available to everyone. Therefore,
45+
we recommend that the implementer includes an Authentication method. This
46+
authentication method can be application dependent and is therefore not specified.
47+
48+
### Alternatives
49+
50+
51+
### Copyright
52+
53+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)