Commit Graph

118 Commits

Author SHA1 Message Date
Whyrusleeping
a234c56bec
Merge pull request #3983 from ivan386/patch-3
check strong and weak ETag validator
2017-12-04 20:36:43 +01:00
Łukasz Magiera
cbccd847ab gateway: apply review to serveFile
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-20 13:36:44 +02:00
Łukasz Magiera
913f9641e4 merkledag: keep key order in dedupeKeys
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-20 01:26:27 +02:00
Łukasz Magiera
3fbb77153b gateway: custom seeker for files
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-18 22:25:36 +02:00
Łukasz Magiera
e71dce5dfb gateway: fix seeker can't seek on specific files
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-18 20:10:22 +02:00
Steven Allen
70d6629940 gx: update go-cid, go-multibase, base32
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-01 17:46:49 -07:00
Steven Vandevelde
20ad44af1c core/http/gateway: Expose Content-Range header
The `Content-Range` header is necessary for extracting (only)
the metadata of audio files.

License: MIT
Signed-off-by: Steven Vandevelde <icid.asset@gmail.com>
2017-07-19 13:28:33 +02:00
Jeromy
cccc6a94a3 update go-multihash and bubble up changes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-11 19:27:43 -07:00
ivan386
0eafa5e25f Merge branch 'master' of https://github.com/ipfs/go-ipfs into patch-3 2017-07-06 19:16:41 +03:00
Jeromy
bda8c3a687 implement bitswap sessions
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-05 10:47:22 -07:00
Łukasz Magiera
8ab93aaeb2 Update go-datastore to 1.2.2, go-cid to 0.7.16
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-07-04 20:18:57 +02:00
Steven Allen
520938a9ec gx import/update libp2p/go-libp2p-routing
For some reason, this was referenced but wasn't listed in packages.json.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-06-29 22:12:14 +02:00
Steven Allen
13636bef50 blocks: gx import go-block-format
And updated related dependencies.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-06-29 22:12:14 +02:00
Łukasz Magiera
5ebf897f6f Show escaped url in gateway 404 message
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-06-26 19:04:18 +02:00
Ivan
8b88b7ffd2 check strong and weak ETag validator
CDN may change strong ETag validator to weak ETag validator.

License: MIT
Signed-off-by: Ivan <ivan386@users.noreply.github.com>
2017-06-22 19:06:48 +03:00
Lars Gierth
4fe5b3eab7 gateway: don't redirect to trailing slash if it's go get
This enables `go get` to parse go-import meta tags from index.html
files stored in IPFS. One tiny step toward whyrusleeping/gx-go#2.

For an import like `ipfs.io/ipfs/QmFoo/mypkg`, the gateway would
previously redirect to `/ipfs/QmFoo/mypkg/` (note the trailing slash),
which the `go get` tool can't deal with.

Thankfully, `go get` sets a URL query parameter (`?go-get=1`) which
we can use to switch off the redirect in this case.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-06-08 03:23:48 +02:00
Lars Gierth
64ced367ac gx: update go-libp2p-peerstore, go-libp2p, go-libp2p-kbucket
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-05-30 02:26:05 +02:00
Jeromy
0418930ca8 update to dht code with provide announce option
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-05-23 13:59:36 -07:00
James Stanley
cb2a38d89b Add Suborigin header to gateway responses (#3209)
This existed before but was disabled in 912a972 because the Suborigin spec
changed and it became incompatible.

This commit updates the generated Suborigin header to be conformant with the
latest spec.

License: MIT
Signed-off-by: James Stanley <james@incoherency.co.uk>
2017-05-13 10:47:36 +01:00
Jeromy
5bb480b4da improved gateway directory listing for sharded nodes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-05-05 13:31:34 -07:00
Jeromy
b15470d548
bubble up updates from go-multihash changes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-04-20 20:28:04 +02:00
Jakub Sztandera
584ab144f9 Merge branch 'master' into fix/gateway/3868-etag 2017-04-20 19:59:59 +02:00
Remco Bloemen
a90f4967e3 gateway: re-use resolved path
Instead of resolving a node, we resolve a path. This resolved path
is then re-used for Cat and Ls. This way, a resolve operation is
only done once.

The error messages for a failed resolve is changed from `ipfs cat …`
to `ipfs resolve …` to better reflect the API calls. The test is
updated accordingly.

License: MIT
Signed-off-by: Remco Bloemen <remco@2π.com>
2017-04-20 08:17:45 +01:00
Lars Gierth
2c4e6434ad gateway: fix erroneous Cache-Control: immutable on dir listings
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-04-19 05:10:41 +02:00
Remco Bloemen
8db6f86de6 gateway: use CID as an ETag strong validator
* Always use the fully resolved CID from api.ResolveNode
  as the ETag (also for IPNS).

* Format the result as a valid "Strong Validator"
  (double quotes around the encoded CID).

Fixes #3868

License: MIT
Signed-off-by: Remco Bloemen <remco@2π.com>
2017-04-18 16:24:37 +01:00
Jeromy Johnson
2cc5ce45b8 Merge pull request #3777 from ipfs/fix/gateway-status-codes
Return 404 Not Found for failed path resolutions
2017-03-22 22:31:54 -07:00
Lars Gierth
9e4800d40a gateway: simplify error responses, switch to 404
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-03-17 04:10:28 +01:00
Lars Gierth
ee45b8d32f coreapi: make the interfaces path centric
The new coreiface.Path maps a path to the cid.Cid
resulting from a full path resolution.

The path is internally represented as a go-ipfs/path.Path,
but that doesn't matter to the outside.

Apart from the path-to-CID mapping, it also aims to hold all
resolved segment CIDs of the path. Right now it only exposes
Root(), and only for flat paths a la /ipfs/Qmfoo. In other cases,
the root is nil.

In the future, resolution will internally use
go-ipfs/path.Resolver.ResolvePathComponents and thus always return
the proper resolved segments, via Root(), or a future Segments() func.

- Add coreiface.Path with Cid() and Root().
- Add CoreAPI.ResolvePath() for getting a coreiface.Path.
- All functions now expect and return coreiface.Path.
- Add ParsePath() and ParseCid() for constructing a coreiface.Path.
- Add coreiface.Node and Link which are simply go-ipld-node.Node and Link.
- Add CoreAPI.ResolveNode() for getting a Node from a Path.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-03-17 03:47:59 +01:00
Lars Gierth
e260d2fd06 coreapi: smarter way of dealing with the different APIs
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-03-17 02:35:17 +01:00
Jeromy
4e168dc323 update go-libp2p-kad-dht with getclosestpeers fix
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-03-05 23:06:04 -08:00
Jeromy
b4eeff2d84 update go-multihash and bubble up deps
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-02-12 12:25:41 -08:00
Jakub Sztandera
912a9720bd
gateway: remove Suborigins as it conflicts the spec
The Suborigins spec was changed and we have to adjust, the spec is still
unstable and it might change in future. Currently the only browser
supporting it (Chrome) errors out on it as it doesn't confront spec it
uses.

See https://github.com/ipfs/specs/issues/131

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-19 14:41:58 +01:00
Jeromy
53d47669da bubble up go-datastore deps
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-11-28 22:29:38 -08:00
Jakub Sztandera
ce96b915e7 gateway: change status code of failed namesys resution to 500
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-11-16 05:37:38 +01:00
Jakub Sztandera
43320e1b7f gateway: use switch for error handling
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-11-16 05:29:39 +01:00
Jakub Sztandera
82d46a5b5b gateway: degrade error in gateway to log to reduce noise
It logs all errors including expired IPNS keys and other non important
errors.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-11-16 05:25:18 +01:00
Jeromy
396c629301 update to newer ipld node interface with Copy and better Tree
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-11-15 18:00:49 -08:00
Lars Gierth
0097b422de gateway: use core api for serving POST requests
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-11-07 18:25:49 +01:00
Lars Gierth
c31e4f7226 gateway: move context/close-notify wiring
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-11-07 18:25:49 +01:00
Lars Gierth
029f971d9c gateway: use core api for serving GET/HEAD requests
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-11-07 18:25:49 +01:00
Richard Littauer
9843e86258 Changed so only explicit ipfs cli commands are lowercased
License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
2016-10-27 22:55:13 -07:00
Jeromy
67c2a4ec14 make path resolver no longer require whole node for construction
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-25 15:04:44 -07:00
Jeromy
eac13abaec update to new cid and ipld node packages
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-25 09:54:04 -07:00
Jeromy
ded60a7356 unixfs: allow use of raw merkledag nodes for unixfs files
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-17 16:51:39 -07:00
Jeromy
01aee44679 merkledag: change 'Node' to be an interface
Also change existing 'Node' type to 'ProtoNode' and use that most
everywhere for now. As we move forward with the integration we will try
and use the Node interface in more places that we're currently using
ProtoNode.

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-12 08:16:03 -07:00
Jeromy
f4d7369c4a bitswap: protocol extension to handle cids
This change adds the /ipfs/bitswap/1.1.0 protocol. The new protocol
adds a 'payload' field to the protobuf message and deprecates the
existing 'blocks' field. The 'payload' field is an array of pairs of cid
prefixes and block data. The cid prefixes are used to ensure the correct
codecs and hash functions are used to handle the block on the receiving
end.

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-10 08:19:31 -07:00
Jeromy
1f9ec4e3ed update to libp2p 4.0.1 and propogate other changes
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-05 22:12:43 -07:00
Jeromy
e43c770530 update libp2p and dht packages
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-09-25 23:42:14 -07:00
Jeromy
2e6e0f18e3 routing: use extracted dht and routing code
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-09-19 18:28:00 -07:00
Jeromy
c8fe495934 integrate CIDv0
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-09-07 13:32:32 -07:00