Skip to content

Commit 6234553

Browse files
committed
wip: data onboarding
1 parent b3ab660 commit 6234553

File tree

2 files changed

+101
-0
lines changed

2 files changed

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

src/ipips/ipip-0401.md

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

0 commit comments

Comments
 (0)