Commit Graph

9676 Commits

Author SHA1 Message Date
Steven Allen
2d94a3ffc8
Merge pull request #5526 from cboddy/feat/http_proxy_over_p2p
[http_proxy_over_p2p]
2018-11-29 20:15:32 -08:00
Steven Allen
9a443adada p2p proxy tests: make robust against timing
Instead of repeatedly starting the netcat server, start it once and wait for it
to fully start. Then, feed responses in using a fifo.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-29 18:01:41 -08:00
Steven Allen
f505e06af7
Merge pull request #5809 from ipfs/kevina/coreapi-pin-cid-map
coreapi/pin: Use CID's directly in maps instead of converting to string
2018-11-29 15:57:17 -08:00
Kevin Atkinson
b1ecb82172 coreapi/pin: Use CID's directly in maps instead of converting to strings.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2018-11-29 17:13:26 -05:00
Dr Ian Preston
8694984992 Add another test case for invalid p2p http proxy path
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Łukasz Magiera
7e541079c7 Update test/sharness/t0184-http-proxy-over-p2p.sh
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>

Co-Authored-By: ianopolous <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
9956630e0c add more p2p http proxy tests
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Hector Sanjuan
3b2ce4a85d Apply suggestions from code review
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>

Co-Authored-By: ianopolous <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Steven Allen
bf184376ca p2p http proxy: go fmt
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Steven Allen
b720d1f0b5 uses the global PeerHost and don't expose the P2P one
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Steven Allen
fe8ffde4c2 add some additional tests for custom protocols
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Steven Allen
d8cab7998e update tests
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
19d4d66fc7 update p2p http proxy docs
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
47d45c7af8 fix tests
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
fd43f473b4 switch to new path format in p2p http proxy
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
78c43fe68b move p2p http proxy from api to gateway
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Steven Allen
28652758df fix tests for iptb update
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
13b0483df0 Don't url decode protocol name. It won't work.
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Steven Allen
83369b5716 setup and teardown nodes only once
We don't need to do this for every test and our tests are slow enough.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Steven Allen
acb2cacefe use iptb in http proxy tests
Also:

* Disable bootstrapping
* Listen on random ports
* Write temporary files to the current (trash) directory instead of temp (easier
  to find, collected by Jenkins).
* Fix indentation.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-28 23:17:27 -08:00
Chris Boddy
3f6b866edc [http_proxy_over_p2p] url-decode the proxy name and fix test
License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
f61440670a add doc item
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Chris Boddy
749ba25485 [http_proxy_over_p2p] cfg.Experiments.P2pHttpProxy
Updated config dependency and  made p2p-http-proxy option require
P2pHttpProxy config option.

License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:27 -08:00
Chris Boddy
8676b2ebf1 [http_proxy_over_p2p] multipart request proxy test
Added a test for the case where the request to be proxied is a
http post multipart-form request.

License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
9e79c5e3c9 add docs for p2p http proxy
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
264d9d6073 fix remaining sharness tests
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
a818b43624 fix some sharness tests
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
654105a210 fix test
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Hector Sanjuan
42a843d66b Fix request path. Wasn't using proxy correctly
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-11-28 23:17:27 -08:00
Hector Sanjuan
91c919a47e Fix test
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-11-28 23:17:27 -08:00
Hector Sanjuan
2cc1a99566 Let URL's host take precedence
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-11-28 23:17:27 -08:00
Hector Sanjuan
f03efbd200 Use go-libp2p-http
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
d30c41a5e0 Improve p2p stream closing in http proxy
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
6e24fc609a Use request context in p2p stream http proxy
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
c67d2b4186 Remove unnecessary pointer usage.
Make sure the p2p stream is closed eventually

License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:27 -08:00
Dr Ian Preston
f052d18471 fix non empty paths in p2p http proxy
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:26 -08:00
Chris Boddy
90f5bad718 [http_proxy_over_p2p] proxy async.
Simultaneously send request-body while reading response-body when
proxying requests.

License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:26 -08:00
Chris Boddy
5f246e3211 [http_proxy_over_p2p] httputil.ReverseProxy
Reimplement http-request proxying ala httputil.ReverseProxy.

NB: this is proxies the request synchronously (sends all request-body
before reading any response).

License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:26 -08:00
Chris Boddy
335bca2bb7 [http_proxy_over_p2p] remove now superfluous test
License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:26 -08:00
Dr Ian Preston
22f3b11621 change handler mount point to /proxy/http/
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
2018-11-28 23:17:26 -08:00
Chris Boddy
1945e44f7f [http_proxy_over_p2p] Add sharness tests for http-proxy-over-p2p
License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:26 -08:00
Chris Boddy
c862ac1fb4 [http_proxy_over_p2p] more tests, fix build
License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:26 -08:00
Chris
90021c16d6 [http_proxy_over_p2p]
This implements an http-proxy over p2p-streams.

License: MIT
Signed-off-by: Chris Boddy <chris@boddy.im>
2018-11-28 23:17:26 -08:00
Steven Allen
af73c5097c
Merge pull request #5802 from ipfs/kevina/gx-go-merkledag-1.1.23
Gx update go-merkledag and related deps.
2018-11-28 14:58:07 -08:00
Kevin Atkinson
feb4808975 Gx update go-merkledag and related deps.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2018-11-28 17:21:36 -05:00
Steven Allen
496f1d1230
Merge pull request #5786 from overbool/refactor/cmds/rm-old-lib
cmds: rm old lib
2018-11-27 21:33:01 -08:00
Overbool
a7485994d7 cmds: rm old lib
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
2018-11-27 20:43:41 -08:00
Steven Allen
fffa3ec9d7
Merge pull request #5625 from schomatis/feat/badger/add-truncate-option
badger: add truncate flag
2018-11-27 20:40:22 -08:00
Lucas Molas
200df850cc badger: add truncate flag
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-11-27 22:08:02 -03:00
Steven Allen
d40c69f56e
Merge pull request #5798 from ipfs/gx/update-config
gx: update go-ipfs-config
2018-11-27 09:56:32 -08:00