Commit Graph

2398 Commits

Author SHA1 Message Date
Hector Sanjuan
fba230fff9
Fix policygen.go path in comment
Co-Authored-By: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-10 11:50:42 +01:00
Hector Sanjuan
a0eeddfae7 Test: remove removed endpoints from mock RPC 2019-05-09 22:52:02 +02:00
Hector Sanjuan
dbc52ae981 rpc auth: golint 2019-05-09 22:36:03 +02:00
Hector Sanjuan
6530808298 rpc auth: adjust tests to work with trusted-peer-enabled crdts component 2019-05-09 21:24:56 +02:00
Hector Sanjuan
a86c7cae2b rpc auth: handle some auth errors gracefully
particuarly we will ignore authorization errors for some broadcasts and somply
not include those responses in the assembled one.
2019-05-09 21:23:49 +02:00
Hector Sanjuan
949e6f2364 RPC auth: Support Trusted Peers in CRDT consensus component.
TrustedPeers are specified in the configuration. Additional peers
can be added at runtime with Trust/Distrust functions.

Unfortunately we cannot use consensus.PeerAdd as a way to trust a peer as
cluster.PeerAdd+Join can be called by any peer and this calls
consensus.PeerAdd.

The result is consensus.PeerAdd doing a lot in Raft while consensus.Trust does
nothing, while in CRDTs consensus.Trust does something but consensus.PeerAdd
does nothing. But this is more or less consistent.
2019-05-09 19:48:40 +02:00
Hector Sanjuan
c5a2e7fdc5 RPC auth: Fix tests
I cannot have RPCAPIs expose a SvcID() method as gorpc will warn about it not
having the right signature. So I have created an RPCServiceID() method instead.
2019-05-09 16:33:59 +02:00
Hector Sanjuan
70f4cad613 RPC Auth: start using the RPC policy in the RPC server. 2019-05-09 15:14:26 +02:00
Hector Sanjuan
1a4ff6a500 RPC auth: Define Default RPC policy and carry it in the cluster config
While right now it is not allowed for the user to overwrite any entries
in the default policy from the JSON, this should be possible (and easy)
in the future.
2019-05-09 14:48:23 +02:00
Hector Sanjuan
2ed48b6ac4 RPC auth: Rework PeerAdd and Join
PeerAdd called RPC endpoints for `LogMetric` and `ConnectSwarms`
remotely. However, I think similar effect can be achieved by calling
these from the Join() function locally.

In particular, ConnectSwarms was called when maybe the joining peer did not
even know about the other peers in the Cluster. Now this is delayed until some
ping metrics have come through.
2019-05-09 14:19:07 +02:00
Hector Sanjuan
40fb0761da RPC Auth: Add policygen.go: a tool to list all RPC endpoints. 2019-05-09 14:18:12 +02:00
Kishan Mohanbhai Sagathiya
654c376a57 Fixed sharness test with new identity
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-09 00:13:29 +05:30
Kishan Mohanbhai Sagathiya
f05af75abc Tests for identity separation
Added tests for identity.go and modifies others according ly

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-08 21:54:59 +05:30
Hector Sanjuan
26b0949b5e
Merge pull request #769 from ipfs/deps/update
Update deps
2019-05-08 13:24:21 +01:00
Hector Sanjuan
5fc5c6d38c Re-update 2019-05-08 13:33:22 +02:00
Hector Sanjuan
8b19f812c6
Merge pull request #773 from ipfs/feat/component-rpc-apis
RPC: Give each component a different RPC Service
2019-05-07 10:57:43 +01:00
Adrian Lanzafame
2f6a839642
Revert "namespace ipfs_mock datastore"
This reverts commit 93c0adc696.
2019-05-07 19:13:19 +10:00
Adrian Lanzafame
764ad69eab
make TestClustersReplicationOverall less flaky
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 19:11:37 +10:00
Adrian Lanzafame
f1afce7644
add String method for Operation and OperationTracker types
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 19:09:05 +10:00
Adrian Lanzafame
a763560e0c
extend the initial size of metrics distribution to 5
This prevents accrual failure detection from kicking in too
soon after a cluster has started.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 19:07:11 +10:00
Adrian Lanzafame
4f0e3c85ff
fix threshold test config value
add full tracing config

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 19:06:14 +10:00
Adrian Lanzafame
e69f440523
add String method for Pin type
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 18:50:03 +10:00
Adrian Lanzafame
8748c45600
go:generate stringer phase and operationtype
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 12:24:28 +10:00
Adrian Lanzafame
ff6e559744
add String method for GlobalPinInfo type
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 12:04:59 +10:00
Adrian Lanzafame
93c0adc696
namespace ipfs_mock datastore
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 12:04:50 +10:00
Adrian Lanzafame
43fb2cf857
fix typo in comment
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-07 12:01:20 +10:00
Kishan Mohanbhai Sagathiya
909a536d59 Pass identity before configs everywhere
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-06 14:24:31 +05:30
Kishan Mohanbhai Sagathiya
b40f2c4caa Merge branch 'master' into issue_760
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-06 14:08:35 +05:30
Kishan Mohanbhai Sagathiya
cbf3e28ccb Separate identity from configuration
- Move identity.go to config package
- extractIdentity --> loadIdentity inside ipfs-cluster-service/configs.go
- ApplyEnvVars for identity
- Use crypto.Ed25519 instead of crypto.RSA
- Don't rewrite service.json

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-06 14:05:12 +05:30
Hector Sanjuan
3d49ac26a5 Feat: Split components into RPC Services
I had thought of this for a very long time but there were no compelling
reasons to do it. Specifying RPC endpoint permissions becomes however
significantly nicer if each Component is a different RPC Service. This also
fixes some naming issues like having to prefix methods with the component name
to separate them from methods named in the same way in some other component
(Pin and IPFSPin).
2019-05-04 21:36:10 +01:00
Hector Sanjuan
7e700e2338
Merge pull request #767 from ipfs/feat/user-allocs-type
Types: make UserAllocations []peer.ID instead of string
2019-05-02 14:08:59 +01:00
Hector Sanjuan
f140bdbdbc
Merge pull request #768 from ipfs/fix/732-pin-update
Proxy: hijack pin/update
2019-05-02 14:07:59 +01:00
Hector Sanjuan
036e3da7f1 Proxy pin/update: Respond with BadRequest when arguments missing 2019-05-02 10:32:13 +01:00
Kishan Mohanbhai Sagathiya
47d7023471 Separate identity and configuration
Resave configuration if identity.json did not exist. This would remove
identity from service.json

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-04-30 20:59:15 +05:30
Kishan Mohanbhai Sagathiya
51214da4d8 Separate Identity and Configuaration 2019-04-30 15:17:36 +05:30
Adrian Lanzafame
9464759ae6
remove hard timeout limits and use only accrual failure detection
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-30 12:06:01 +10:00
Hector Sanjuan
539dfcd6ec Update exporter import paths 2019-04-29 18:57:13 +02:00
Hector Sanjuan
dfaa141bc0 fix label in bug report 2019-04-29 18:01:12 +02:00
Hector Sanjuan
93d464c6d5 Small fixes to issue template for bugs 2019-04-29 18:00:20 +02:00
Hector Sanjuan
552c59f008 Delete old issue template 2019-04-29 17:58:40 +02:00
Hector Sanjuan
5325f5a31a Update issue templates 2019-04-29 17:57:24 +02:00
Hector Sanjuan
0fd70e45f3 Update deps 2019-04-29 17:26:22 +02:00
Hector Sanjuan
da24114ae0 Proxy: hijack pin/update
The IPFS pin/update endpoint takes two arguments and usually
unpins the first and pins the second. It is a bit more efficient
to do it in a single operation than two separate ones.

This will make the proxy endpoint hijack pin/update requests.

First, the FROM pin is fetched from the state. If present, we
set the options (replication factors, actual allocations) from
that pin to the new one. Then we pin the TO item and proceed
to unpin the FROM item when `unpin` is not false.

We need to support path resolving, just like IPFS, therefore
it was necessary to expose IPFSResolve() via RPC.
2019-04-29 16:36:40 +02:00
Hector Sanjuan
2144f4bd42 Types: make UserAllocations []peer.ID instead of string
It seems we forgot to convert this after peer.IDs became serializable. This
fixes it.
2019-04-29 16:24:38 +02:00
Adrian Lanzafame
4b114dffe1
pass ctx to NewCluster in tests
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-29 18:20:21 +10:00
Adrian Lanzafame
b1dbc1a584
pass ctx to NewCluster in tests
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-29 18:10:30 +10:00
Adrian Lanzafame
42693eb06d
fix passing ctx from daemon to pubsub
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-29 17:58:28 +10:00
Adrian Lanzafame
661de45908
fix daemon call to create pubsubmon
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-26 18:14:38 +10:00
Adrian Lanzafame
32ca9167d6
use accrual instead of metric expiration
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-26 17:58:29 +10:00
Adrian Lanzafame
911c417f58
rename test so it can be run by itself
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-26 17:57:45 +10:00