Commit Graph

173 Commits

Author SHA1 Message Date
b955c0fa02 Explicitly import ID, Transport from secio 2019-08-31 22:38:46 +08:00
9e8a6bdf29 Update tests/conftest.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-08-31 22:32:43 +08:00
cec2aea928 Move shared fixtures and constants to files 2019-08-29 22:38:08 +08:00
9ceb5f55bb Call make_echo_proc with is_host_insecure
Use the fixture, this way we can configure `is_host_insecure` to support
the test against secio.
2019-08-29 22:08:27 +08:00
c61a06706a Refactor interop tests and factories
- Add `close` and `disconnect` in `Host`
- Add `close` and `close_peer` in `Network`
- Change `IListener.close` to async, to await for server's closing
- Add factories for security transports, and modify `HostFactory`
2019-08-29 21:38:06 +08:00
64c0dab3af Fix isort 2019-08-29 00:01:48 +08:00
b726d7c9da Add tox and CI for interop 2019-08-28 23:39:33 +08:00
d35b8ffc64 Conform stream_id to go-mplex 2019-08-28 21:43:34 +08:00
66c3bacf7e Merge pull request #254 from ralexstokes/implement-secio
Implement `secio`
2019-08-26 19:22:00 +02:00
fa0acd9fc5 Apply PR feedback 2019-08-26 10:03:12 -07:00
5e68aff1d1 Fix conn attribute and docstring in mplex 2019-08-25 14:42:44 +08:00
f08aa339b4 Verify the channel can pass some plaintext 2019-08-24 23:26:26 +02:00
737195f461 Simplify testing connection w/ other simplifications 2019-08-24 23:15:31 +02:00
10e30beb42 Disable "friendly" IDs for tests that expect a full string 2019-08-24 22:57:22 +02:00
9355f33da8 Add basic test for secio
Two peers in-memory can create a secure, bidirectional channel
2019-08-24 22:38:26 +02:00
3f4589d497 Get tests working 2019-08-24 22:38:25 +02:00
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
7ccdeaf308 Remove test suite for asyncio, *not* py-libp2p 2019-08-24 22:10:47 +02:00
73495038e1 remove simple security 2019-08-24 21:39:25 +02:00
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
3e04480d62 Raise HandshakeFailure in transport
Change the exception handling flow.
Raise `SecurityUpgradeFailure` in security_multistream.
2019-08-22 22:53:48 +08:00
0b62321265 Fix test_security_multistream
By passing initiator keypairs to node.
2019-08-22 22:53:47 +08:00
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
7535a02da7 Clean up key gen 2019-08-15 19:24:30 -07:00
d17e6f3392 Fix some test imports that got botched in rebase 2019-08-15 16:46:23 -07:00
82bae341a7 Run isort over files that were missing it 2019-08-15 16:33:35 -07:00
cda74dd382 Update tests for new logic 2019-08-15 16:33:34 -07:00
fb43728661 Mark some slow tests as such 2019-08-15 16:33:33 -07:00
b98025c379 Move security transports into their respective sub-packages 2019-08-15 16:33:33 -07:00
67744bcb0f Add a basic interop test for Go and Python peer IDs 2019-08-14 09:00:40 -07:00
ad20d8cb00 Make a KeyPair dataclass for passing around key pairs 2019-08-14 09:00:40 -07:00
329bd4eb0f Clean up peer ID tests 2019-08-14 09:00:40 -07:00
3debd2c808 Run black and isort w/ the new config 2019-08-13 14:36:42 -07:00
c536aa3e07 flake8 2019-08-08 16:09:02 +08:00
a1dc68ab70 Apply PR feedback:
add validation failed test to `push_msg` test
2019-08-07 11:53:54 +08:00
1cea1264a4 Raise exception when topic validation failed 2019-08-06 12:38:31 +08:00
b96ef0e6c7 Fix:
`_is_subscribed_to_msg` need only subscribe to one of the topics
2019-08-05 18:20:04 +08:00
e1b86904e3 Add validate_msg and test 2019-08-05 18:19:32 +08:00
f8ca4fa1ef Add get_msg_validators and test 2019-08-05 18:19:32 +08:00
1ed14d0cc8 Add remove_topic_validator test 2019-08-05 18:19:32 +08:00
cf69f7e800 Rename to set_topic_validator and add test 2019-08-05 18:19:31 +08:00
7a04ebb51f run black 2019-08-05 11:21:20 +08:00
7477b29508 run black w/ extended line length 2019-08-04 12:37:41 +08:00
cb301fcc51 Opt-out of linting on the special cases we have, given new ignore rules 2019-08-04 12:37:27 +08:00
0a5b4a88ca Fix flake8 for the existing code 2019-08-04 00:18:30 +08:00
c8005c8113 Run isort in repo 2019-08-03 17:50:14 +08:00
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
6090d2ca3b Clean up old comments, print stmts, formatting, etc. 2019-08-02 21:58:31 -07:00
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
d47cddee24 Clean up extraneous files in tests 2019-08-02 14:54:40 -07:00