Skip to content
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

IPIP: Gateway _redirects File #290

Merged
merged 32 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b695910
Initial pass at gateway redirects spec
Jun 15, 2022
0abadca
Clarify error handling and fix some typos
Jun 17, 2022
abb348d
Wording cleanup. Make things more clear.
Jun 17, 2022
6c354a2
The redirects file can have comments.
Jun 17, 2022
00c2215
More corrections and clarifications.
Jun 17, 2022
b6347d6
Mention DNSLink as well
Jun 17, 2022
851de62
Redirects File, not Redirect File
Jun 24, 2022
5d3ab19
Update RFC/0000-gateway-redirects.md
Jun 27, 2022
d16c76d
Update http-gateways/REDIRECTS_FILE.md
Jun 27, 2022
c78507e
Update RFC/0000-gateway-redirects.md
Jun 27, 2022
877a334
Reorg test fixtures, per feedback
Jul 2, 2022
e231593
Reorg security, per feedback
Jul 2, 2022
9ccd750
linting
Jul 11, 2022
b2f7dad
more linting, and move to IPIP folder
Jul 11, 2022
418b6b4
more linting
Jul 11, 2022
4fee0a7
Update IPIP/0000-gateway-redirects.md
Aug 11, 2022
9b8574e
Update IPIP/0000-gateway-redirects.md
Aug 11, 2022
d8d76f3
Update IPIP/0000-gateway-redirects.md
Aug 11, 2022
97a0257
Update IPIP/0000-gateway-redirects.md
Aug 11, 2022
5e198d2
Update http-gateways/REDIRECTS_FILE.md
Aug 11, 2022
6086582
Update http-gateways/REDIRECTS_FILE.md
Aug 11, 2022
5be7fc3
Update http-gateways/REDIRECTS_FILE.md
Aug 11, 2022
2b46076
Address feedback
Aug 11, 2022
8b330b6
Update CID for test fixture
Aug 11, 2022
82175fe
More feedback
Aug 11, 2022
d065377
Update CIDs for test cases
Aug 12, 2022
f3c1d57
Give comments and line termination to their own headings
Aug 19, 2022
9b8cb7d
- Adding missing TOC entries
Sep 16, 2022
5525995
Rename to IPIP 00002
Sep 16, 2022
8b8ccf9
Update CIDs
Sep 22, 2022
67f7c7b
Update CIDs
Sep 23, 2022
33f4f44
IPIP 0002: final editorial changes
lidel Sep 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IPIP/0000-gateway-redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If a `_redirects` file exists but is unable to be processed, perhaps not even pa
The detailed specification is added in [`http-gateways/REDIRECTS_FILE.md`](../http-gateways/REDIRECTS_FILE.md).

### Test fixtures
QmcZzEbsNsQM6PmnvPbtDJdRAen5skkCxDRS8K7HafpAsX
QmXqMQ5Sja34NaBEFD7x1hH4VTZWEGmmFF8fGQvAqRsJ1e
lidel marked this conversation as resolved.
Show resolved Hide resolved

See spec for testing details.

Expand Down
14 changes: 12 additions & 2 deletions http-gateways/REDIRECTS_FILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ This can be used, for example, to enable URL rewriting for hosting a single-page
- [Status](#status)
- [Placeholders](#placeholders)
- [Splat](#splat)
- [Comments](#comments)
- [Line Termination](#line-termination)
- [Max File Size](#max-file-size)
- [Evaluation](#evaluation)
- [Subdomain or DNSLink Gateways](#subdomain-or-dnslink-gateways)
- [Order](#order)
Expand Down Expand Up @@ -117,6 +120,10 @@ is functionally equivalent to

Lines MUST be terminated by either `\n` or `\r\n`.

### Max File Size

The file size MUST NOT exceed 64 KiB.

# Evaluation

## Subdomain or DNSLink Gateways
Expand All @@ -141,21 +148,24 @@ This functionality will only be evaluated for Subdomain or DNSLink Gateways, to

Parsing of the `_redirects` file should be done safely to prevent any sort of injection vector or daemon crash.

The [max file size](#max-file-size) helps to prevent an additional [denial of service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) vector.

# Appendix: notes for implementors

## Test fixtures

Sample files for various test cases can be found in QmfHFheaikRRB6ap7AdL4FHBkyHPhPBDX7fS25rMzYhLuW, which comes from
Sample files for various test cases can be found in QmXqMQ5Sja34NaBEFD7x1hH4VTZWEGmmFF8fGQvAqRsJ1e, which comes from
sharness test data for the implementation of this feature in Kubo.

```
ipfs ls QmfHFheaikRRB6ap7AdL4FHBkyHPhPBDX7fS25rMzYhLuW
» ipfs ls QmXqMQ5Sja34NaBEFD7x1hH4VTZWEGmmFF8fGQvAqRsJ1e
QmcBcFnKKqgpCVMxxGsriw9ByTVF6uDdKDMuEBq3m6f1bm - bad-codes/
QmcZzEbsNsQM6PmnvPbtDJdRAen5skkCxDRS8K7HafpAsX - examples/
QmU7ysGXwAtiV7aBarZASJsxKoKyKmd9Xrz2FFamSCbg8S - forced/
QmWHn2TunA1g7gQ7q9rwAoWuot2hMpojZ6cZ9ERsNKm5gE - good-codes/
QmRgpzYQESidTtTojN8zRWjiNs9Cy6o7KHRxh7kDpJm3KH - invalid/
QmYzMrtPyBv7LKiEAGLLRPtvqm3SjQYLWxwWQ2vnpxQwRd - newlines/
QmXEZAp8vRLhfqY6wSCdHg6e9pjBAd56QUYGzcqdgkAYwi - too-large/
```

For example, the "examples" site can be found in QmcZzEbsNsQM6PmnvPbtDJdRAen5skkCxDRS8K7HafpAsX.
Expand Down