Commit Graph

159 Commits

Author SHA1 Message Date
Alex Stokes
9355f33da8
Add basic test for secio
Two peers in-memory can create a secure, bidirectional channel
2019-08-24 22:38:26 +02:00
Alex Stokes
3f4589d497
Get tests working 2019-08-24 22:38:25 +02:00
Alex Stokes
8e913a3faa
Dispatch serialization of keys based on key type
- Add some tests to check high-level roundtrip
2019-08-24 22:37:45 +02:00
Alex Stokes
7ccdeaf308
Remove test suite for asyncio, *not* py-libp2p 2019-08-24 22:10:47 +02:00
Alex Stokes
73495038e1
remove simple security 2019-08-24 21:39:25 +02:00
mhchia
16a4fd33c1
PR feedbacks
- Move exceptions to exceptions.py
- Raise `UpgradeFailure` in upgrader
- Refine the try/catch for upgraders in swarm
2019-08-22 22:53:49 +08:00
mhchia
3e04480d62
Raise HandshakeFailure in transport
Change the exception handling flow.
Raise `SecurityUpgradeFailure` in security_multistream.
2019-08-22 22:53:48 +08:00
mhchia
0b62321265
Fix test_security_multistream
By passing initiator keypairs to node.
2019-08-22 22:53:47 +08:00
Alex Stokes
87d943aa39
Internalize the protobuf serialization to the concept of a Key
Given its use across various components of `libp2p` (not just peer IDs),
it makes the abstraction cleaner to pull the serialization into the
key class and expose the canonical serialization to bytes.
2019-08-20 19:01:36 +02:00
Alex Stokes
7535a02da7
Clean up key gen 2019-08-15 19:24:30 -07:00
Alex Stokes
d17e6f3392
Fix some test imports that got botched in rebase 2019-08-15 16:46:23 -07:00
Alex Stokes
82bae341a7
Run isort over files that were missing it 2019-08-15 16:33:35 -07:00
Alex Stokes
cda74dd382
Update tests for new logic 2019-08-15 16:33:34 -07:00
Alex Stokes
fb43728661
Mark some slow tests as such 2019-08-15 16:33:33 -07:00
Alex Stokes
b98025c379
Move security transports into their respective sub-packages 2019-08-15 16:33:33 -07:00
Alex Stokes
67744bcb0f
Add a basic interop test for Go and Python peer IDs 2019-08-14 09:00:40 -07:00
Alex Stokes
ad20d8cb00
Make a KeyPair dataclass for passing around key pairs 2019-08-14 09:00:40 -07:00
Alex Stokes
329bd4eb0f
Clean up peer ID tests 2019-08-14 09:00:40 -07:00
Alex Stokes
3debd2c808
Run black and isort w/ the new config 2019-08-13 14:36:42 -07:00
Chih Cheng Liang
c536aa3e07 flake8 2019-08-08 16:09:02 +08:00
NIC619
a1dc68ab70
Apply PR feedback:
add validation failed test to `push_msg` test
2019-08-07 11:53:54 +08:00
NIC619
1cea1264a4
Raise exception when topic validation failed 2019-08-06 12:38:31 +08:00
NIC619
b96ef0e6c7
Fix:
`_is_subscribed_to_msg` need only subscribe to one of the topics
2019-08-05 18:20:04 +08:00
NIC619
e1b86904e3
Add validate_msg and test 2019-08-05 18:19:32 +08:00
NIC619
f8ca4fa1ef
Add get_msg_validators and test 2019-08-05 18:19:32 +08:00
NIC619
1ed14d0cc8
Add remove_topic_validator test 2019-08-05 18:19:32 +08:00
NIC619
cf69f7e800
Rename to set_topic_validator and add test 2019-08-05 18:19:31 +08:00
Chih Cheng Liang
7a04ebb51f
run black 2019-08-05 11:21:20 +08:00
Alex Stokes
7477b29508 run black w/ extended line length 2019-08-04 12:37:41 +08:00
Alex Stokes
cb301fcc51 Opt-out of linting on the special cases we have, given new ignore rules 2019-08-04 12:37:27 +08:00
mhchia
0a5b4a88ca
Fix flake8 for the existing code 2019-08-04 00:18:30 +08:00
Alex Stokes
c8005c8113 Run isort in repo 2019-08-03 17:50:14 +08:00
Alex Stokes
21e013e753
Merge pull request #214 from ralexstokes/remove-third-party-key-in-id
Refactor ID to not use third-party type for cryptographic keys
2019-08-02 22:50:53 -07:00
Alex Stokes
6090d2ca3b
Clean up old comments, print stmts, formatting, etc. 2019-08-02 21:58:31 -07:00
Alex Stokes
bd8d45fbc1
Refactor ID to not use third-party type for cryptographic keys
Remove `ID.from_privkey` which would require specific knowledge per cryptosystem
2019-08-02 21:51:16 -07:00
Alex Stokes
d47cddee24
Clean up extraneous files in tests 2019-08-02 14:54:40 -07:00
Alex Stokes
7b7c8ad30d
run black over dangling files 2019-08-02 11:47:08 -07:00
mhchia
2e94fcf56c
Remove pylint:disable 2019-08-02 23:26:06 +08:00
NIC619
568454534f
Remove unused ID type conversions 2019-08-02 16:48:38 +08:00
NIC619
924e965537
Change argument name of Network.listen and blakc format 2019-08-02 14:45:59 +08:00
NIC619
cd684aad9e
Update peer_id to type peer.ID in pubsub folder 2019-08-02 14:45:23 +08:00
NIC619
9562cb2a46
Rename:
`KadPeerInfo.peer_id` to `KadPeerInfo.peer_id_bytes`
2019-08-02 14:43:01 +08:00
NIC619
f00e80bc25
Fix wrong peer id type used in KadPeerInfo 2019-08-02 14:42:10 +08:00
NIC619
b928bdb356
Convert from base58/pubkey/privkey to class method 2019-08-02 14:42:10 +08:00
NIC619
80481252ca
Refactor ID to take in type bytes only 2019-08-02 14:42:10 +08:00
mhchia
716c60ca6d
Reflect PR feedback
- Remove leftover `int` in `GossipsubParams`
- Remove default fields in tests
2019-08-01 21:38:14 +08:00
mhchia
4eb846be7c
Remove the assertions for connect
Because it fails in `test_security_multistream.py` and this check is
indeed not necessary inside `connect`.(Should probably be outside the
function.)
2019-08-01 13:30:09 +08:00
mhchia
c72dfe1dd3
Use factories and fixtures in pubsub tests
Done
- Add factories using factory-boy
- Modify fixtures and tests to use factories
- Modify tests to use fixtures and factories
- Clean up
2019-08-01 13:30:08 +08:00
Alex Stokes
0ae9840928
Run black over repo 2019-07-31 15:00:12 -07:00
mhchia
ce369d47e9
Refine exception message 2019-07-31 16:23:07 +08:00