Commit Graph

129 Commits

Author SHA1 Message Date
Hector Sanjuan
93d1a695d4 Feat: Separate "path" from "path/resolver"
Currently the "path" module does two very different things:

* Defines how ipfs paths look like and provides tools to parse/split etc.
* Provides a resolver to resolve paths.

This moves the resolver stuff to `path/resolver` and leaves the
path utilities in `path`.

The result is that now the IPFS `path` package just defines what a path
looks like and becomes a module that can be exported/re-used without problems.
Currently there are circular dependency cycles (resolve_test -> merkledag/utils,
merkledag->path), which the prevent the export of merkledag itself.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-16 00:20:30 +01:00
Hector Sanjuan
381977476f Extract: chunker: rename "chunk" to "chunker" as it is more consistent
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-08 12:49:39 +01:00
Hector Sanjuan
76d228cf75 Extract chunker: Use last gx'ed go-ipfs-chunker
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-08 12:43:29 +01:00
Hector Sanjuan
1811425aab go-ipfs-chunker: Use the stable gx'ed release
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-08 12:34:51 +01:00
Hector Sanjuan
c613fbec38 WIP: Extract: importers/chunk module as go-ipfs-chunker
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-08 12:34:15 +01:00
Steven Allen
b2cbfd299c gx: update go-log
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-31 21:54:22 -08:00
Steven Allen
f9d935b984 rename import of go-ipld-format from node/format to ipld
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-29 11:55:34 -08:00
Steven Allen
d154b4a990 merkledag: switch to new dag interface
Also:

* Update the blockstore/blockservice methods to match.
* Construct a new temporary offline dag instead of having a
  GetOfflineLinkService method.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-25 15:13:19 -08:00
Steven Allen
fe8846fcd7 gx: mass update
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-24 15:58:44 -08:00
Steven Allen
dfe7ef4fcf gx: update go-multihash
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-14 13:09:51 -08:00
Lars Gierth
55692ac9b6 gateway: degrade most logging to debug level
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-12-07 00:21:57 +01:00
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