storj/pkg
Jeff Wendling 30f790a040
Create and use an encryption.Store (#2293)
* add path implementation

This commit adds a pkg/paths package which contains two types,
Encrypted and Unencrypted, to statically enforce what is contained
in a path. It's part of a refactoring of the code base to be more
clear about what is contained in a storj.Path at all the layers.

Change-Id: Ifc4d4932da26a97ea99749b8356b4543496a8864

* add encryption store

This change adds an encryption.Store type to keep a collection
of root keys for arbitrary locations in some buckets. It allows
one to look up all of the necessary information to encrypt paths,
decrypt paths and decrypt list operations.

It adds some exported functions to perform encryption on paths
using a Store.

Change-Id: I1a3d230c521d65f0ede727f93e1cb389f8be9497

* add shim around streams store

This commit changes no functionality, but just reorganizes the code
so that changes can be made directly to the streams store
implementation without affecting callers.

It also adds a Path type that will be used at the interface boundary
for the streams store so that it can be sure that it's getting well
formed paths that it expects.

Change-Id: I50bd682995b185beb653b00562fab62ef11f1ab5

* refactor streams to use encryption store

This commit changes the streams store to use the path type as
well as the encryption store to handle all of it's encryption
and decryption.

Some changes were made to how the default key is returned in
the encryption store to have it include the case when the bucket
exists but no paths matched. The path iterator could also be
simplified to not report if a consume was valid: that information
is no longer necessary.

The kvmetainfo tests were changed to appropriately pass the
subtests *testing.T rather than having the closure it executes
use the parent one. The test framework now correctly reports
which test did the failing.

There are still some latent issues with listing in that listing
for "a/" and listing for "a" are not the same operation, but we
treat them as such. I suspect that there are also issues with
paths like "/" or "//foo", but that's for another time.

Change-Id: I81cad4ba2850c3d14ba7e632777c4cac93db9472

* use an encryption store at the upper layers

Change-Id: Id9b4dd5f27b3ecac863de586e9ae076f4f927f6f

* fix linting failures

Change-Id: Ifb8378879ad308d4d047a0483850156371a41280

* fix linting in encryption test

Change-Id: Ia35647dfe18b0f20fe13763b28e53294f75c38fa

* get rid of kvmetainfo rootKey

Change-Id: Id795ca03d9417e3fe9634365a121430eb678d6d5

* Fix linting failure for return with else

Change-Id: I0b9ffd92be42ffcd8fef7ea735c5fc114a55d3b5

* fix some bugs adding enc store to kvmetainfo

Change-Id: I8e765970ba817289c65ec62971ae3bfa2c53a1ba

* respond to review feedback

Change-Id: I43e2ce29ce2fb6677b1cd6b9469838d80ec92c86
2019-06-24 19:23:07 +00:00
..
accounting Remove audit / uptime ratio fields (#2247) 2019-06-21 13:14:53 -04:00
audit Do not use disqualified nodes when asking for get order limits (#2303) 2019-06-24 16:46:10 +02:00
auth add storage node voucher request service (#2158) 2019-06-21 18:48:52 -04:00
bloomfilter pkg/bloomfilter: implementation and benchmark results (#2113) 2019-06-20 12:27:20 +02:00
certdb Unite all cryptographic signing and verifying (#1244) 2019-02-07 14:39:20 -06:00
certificates Use mail.test as domain in emails (#2224) 2019-06-18 02:28:40 +02:00
cfgstruct add support to hide config settings (#2241) 2019-06-19 07:27:44 -07:00
datarepair Fix checks around repair threshold (#2246) 2019-06-19 22:13:11 +02:00
dht kademlia/routing: add contexts to more places so monkit works (#2188) 2019-06-13 16:51:50 +02:00
discovery Stop pinging disqualified nodes (#2306) 2019-06-24 14:39:47 +02:00
eestream Repair should not corrupt files (#2194) 2019-06-14 12:16:31 +03:00
encryption Create and use an encryption.Store (#2293) 2019-06-24 19:23:07 +00:00
identity storage: add monkit task to missing places (#2122) 2019-06-05 16:23:10 +02:00
kademlia Use zap.Stringer instead of zap.String (#2223) 2019-06-18 01:37:43 +02:00
macaroon metainfo: add project info rpc for getting a project salt using an api key (#2311) 2019-06-24 11:15:45 -06:00
metainfo/kvmetainfo Create and use an encryption.Store (#2293) 2019-06-24 19:23:07 +00:00
miniogw Create and use an encryption.Store (#2293) 2019-06-24 19:23:07 +00:00
overlay change uptime dq threshold to 0.4 (#2313) 2019-06-24 12:18:32 -04:00
paths Create and use an encryption.Store (#2293) 2019-06-24 19:23:07 +00:00
pb metainfo: add project info rpc for getting a project salt using an api key (#2311) 2019-06-24 11:15:45 -06:00
peertls pkg/*: add monkit task to missing places (#2109) 2019-06-04 13:36:27 +02:00
pkcrypto Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
process add support to hide config settings (#2241) 2019-06-19 07:27:44 -07:00
ranger pkg/*: add monkit task to missing places (#2109) 2019-06-04 13:36:27 +02:00
server add capability of logging all GRPC calls/payloads (#2067) 2019-06-04 14:55:24 +02:00
storage Create and use an encryption.Store (#2293) 2019-06-24 19:23:07 +00:00
storj testcontext: sanitize folder name (#2195) 2019-06-13 15:46:08 +03:00
stream remove utils.CombineErrors and utils.ErrorGroup (#1603) 2019-03-29 14:30:23 +02:00
telemetry pkg/*: add monkit task to missing places (#2109) 2019-06-04 13:36:27 +02:00
transport Moved monkit tracing after the limit nil check & fix node id formatting. (#2156) 2019-06-07 18:34:16 -04:00