kubo/test
Hector Sanjuan 1b490476e5 HTTP API: Disallow GET requests on API
This commit upgrades go-ipfs-cmds and configures the commands HTTP API Handler
to only allow POST/OPTIONS, disallowing GET and others in the handling of
command requests in the IPFS HTTP API (where before every type of request
method was handled, with GET/POST/PUT/PATCH being equivalent).

The Read-Only commands that the HTTP API attaches to the gateway endpoint will
additional handled GET as they did before (but stop handling PUT,DELETEs).

By limiting the request types we address the possibility that a website
accessed by a browser abuses the IPFS API by issuing GET requests to it which
have no Origin or Referrer set, and are thus bypass CORS and CSRF protections.

This is a breaking change for clients that relay on GET requests against the
HTTP endpoint (usually :5001). Applications integrating on top of the
gateway-read-only API should still work (including cross-domain access).

Co-Authored-By: Steven Allen <steven@stebalien.com>
Co-Authored-By: Marcin Rataj <lidel@lidel.org>
2020-04-05 09:57:57 +02:00
..
3nodetest test(sharness): fix tests for /ipfs -> /p2p change 2019-12-14 19:41:05 +01:00
api-startup misc: Remove some dead code 2018-03-21 01:34:04 +01:00
bench Use 2048 bit RSA keys in sharness and bench 2019-08-23 14:26:20 -07:00
bin test(graphsync): test server-side graphsync 2020-02-26 09:11:17 -08:00
dependencies HTTP API: Disallow GET requests on API 2020-04-05 09:57:57 +02:00
integration fix: require gmake 2019-08-01 12:18:56 -07:00
sharness HTTP API: Disallow GET requests on API 2020-04-05 09:57:57 +02:00
unit make: Replace json-to-junit with gotestsum 2019-03-05 18:33:58 +01:00
.gitignore test: add IPFS-BUILD-OPTIONS to .gitignore 2015-04-06 18:06:24 +02:00
ipfs-test-lib.sh switch base64 decoder based on OS 2018-01-28 14:13:16 -08:00
README.md test/README: update sharness test coverage 2015-04-02 11:56:49 +02:00
Rules.mk ci: Coverage and Junit xmls in one run 2018-10-29 18:44:49 +01:00
sharness_test_coverage_helper.sh coverage_helper: better group long and short options 2015-10-24 11:22:53 +02:00

Sharness test command coverage

Module Online Test Offline Test
object t0051 t0051
ls t0045 t0045
cat t0040
dht
bitswap
block t0050
daemon t0030 N/A
init N/A t0020
add t0040
config t0021 t0021
version t0060 t0010
ping
diag
mount t0030
name t0110 t0100
pin t0080
get t0090 t0090
refs t0080
repo gc t0080
id
bootstrap t0120 t0120
swarm
update
commands