Commit Graph

556 Commits

Author SHA1 Message Date
Brian Warner
1e7c714453 CLI: don't hide errors so much 2016-04-20 22:36:43 -07:00
Brian Warner
1b16127cad fix --tor
* twisted/transcribe: call correct tor_manager method
* tor_manager: remove now-unused web agent endpoint factory
2016-04-20 22:34:58 -07:00
Brian Warner
f3e310acbc travis: we no longer need twisted from trunk 2016-04-20 19:42:24 -07:00
Brian Warner
29889eb20b Merge all packages back under 'wormhole'.
After talking to Glyph, I came to my senses:

* There will be just one distribution, pip install "magic-wormhole",
  which will provide both Twisted- and blocking- style libraries. (I was
  looking at separate distributions for each, plus one for the server,
  plus one for the common bits). This involves extra dependencies for
  both (twisted folks will be stuck with 'requests', blocking folks will
  be stuck with 'twisted'), but those aren't huge, and the the
  simplicity is worth it. Blocking users don't have to know anything
  about Twisted to use Wormhole.
* Giving up on multiple distributions means we no longer need multiple
  packages. This makes the import names easier to work with (more
  relative imports).
* This will allow us to provide the blocking flavor with crochet (which
  lets you call twisted code from a blocking world), so we'll have just
  one implementation for both environments, and can get WebSockets and
  Transit in both.
* The server is now part of the main package, as is the test suite.

Fun fact: travis was completely broken while the split was in place (it
wasn't testing the right things).
2016-04-20 19:28:21 -07:00
Brian Warner
7b9c48fbc4 unsplit: last fixups 2016-04-20 19:18:41 -07:00
Brian Warner
b2c3f49038 unsplit txwormhole step 2: edit files 2016-04-20 19:18:41 -07:00
Brian Warner
0ae8463331 unsplit txwormhole step 1: move files 2016-04-20 19:15:33 -07:00
Brian Warner
7c45f3d472 unsplit wormhole_server step 2: edit files 2016-04-20 19:15:33 -07:00
Brian Warner
ec13404fca unsplit wormhole_server step 1: move files 2016-04-20 19:15:33 -07:00
Brian Warner
85b6264826 unsplit cli step 2: edit files 2016-04-20 19:15:33 -07:00
Brian Warner
a3c836bcd3 unsplit cli step 1: move files 2016-04-20 18:54:36 -07:00
Brian Warner
7a5a99a1a8 unsplit tests step 3: modify files 2016-04-20 18:54:10 -07:00
Brian Warner
fc33ea41ff unsplit tests step 2: delete test_load 2016-04-20 18:51:03 -07:00
Brian Warner
c890a850aa unsplit tests step 1: move files 2016-04-20 18:44:33 -07:00
Brian Warner
87b17121a0 update NEWS with recent changes 2016-04-20 18:36:26 -07:00
Brian Warner
fbbd21775c test_scripts: delete the named pipe when we're done
Otherwise, running "pip wheel ." from the source directory will fail
(it chokes while trying to copy the pipe inside _trial_test/). Arguably
pip shouldn't be doing a full copy, but until/unless they change that,
this is an easy workaround.
2016-04-20 18:19:30 -07:00
Brian Warner
5f25e92a2d cmd_send.py: add note about future speedup opportunity 2016-04-20 18:14:58 -07:00
Brian Warner
34f4c284b0 txwormhole: use websockets, not HTTP
This should speed up the protocol, since we don't have to wait for
acks (HTTP responses) unless we really want to. It also makes it easier
to have multiple messages in flight at once. The protocol is still
compatible with the old HTTP version (which is still used by the
blocking flavor), but requires an updated Rendezvous server that speaks
websockets.

set_code() no longer touches the network: it just stores the code and
channelid for later. We hold off doing 'claim' and 'watch' until we need
messages, triggered by get_verifier() or get_data() or send_data().

We check for error before sleeping, not just after waking. This makes it
possible to detect a WrongPasswordError in get_data() even if the other
side hasn't done a corresponding send_data(), as long as the other side
finished PAKE (and thus sent a CONFIRM message). The unit test was doing
just this, and was hanging.
2016-04-20 18:14:47 -07:00
Brian Warner
a57845eb0b tor_manager: accept websocket URLs too 2016-04-20 12:15:59 -07:00
Brian Warner
611a7d05e9 cmd_receive: use wait=True for the last ack
This prevents the process from shutting down before the ack makes it to
the server.
2016-04-20 12:13:53 -07:00
Brian Warner
9c1af2667e send_data(): add wait=True
This doesn't do anything yet (the HTTP-based Channel always waits), but
will matter in an upcoming implementation change.
2016-04-20 12:13:53 -07:00
Brian Warner
8068aeeca4 CLI runner: use task.react, remove sync wrapper 2016-04-20 12:13:53 -07:00
Brian Warner
44ca031047 transcribe.py: accept reactor=, for tests 2016-04-20 12:13:53 -07:00
Brian Warner
42106fd4f0 test_twisted: rewrite with inlineCallbacks
Also, we now disable confirmation to exercise a verifier mismatch. An
upcoming implementation change can probably detect the mismatch too
early otherwise, and throw WrongPasswordError before the test can
compare the verifiers.
2016-04-20 11:38:25 -07:00
Brian Warner
28b3f685d6 rendezvous: allow both allocate and claim (of the same channelid)
This allows the Wormhole setup path to be simpler: consistently doing a
claim() just before watch(), regardless of whether we allocated the
channelid (with get_code), or dictated it (with set_code or
from_serialized).
2016-04-20 11:20:53 -07:00
Brian Warner
558f01818f server: log websocket URL 2016-04-20 11:14:52 -07:00
Brian Warner
88b78d1c46 fix comment: bodies are hex, not base64 2016-04-20 11:13:40 -07:00
Brian Warner
92c4ad19bc rendezvous_websocket: fix Error 2016-04-20 11:12:50 -07:00
Brian Warner
aa8f714a48 websocket: change 'all-channelids' to 'channelids'
Yeah, names are easier to work with when they're also valid identifiers.
2016-04-18 23:49:11 -07:00
Brian Warner
f606207163 Merge branch 'websocket' 2016-04-18 18:10:31 -07:00
Brian Warner
aec0615d66 Add WebSocket-based rendezvous protocol frontend
The websocket lives on a Resource of the main rendezvous web site, and
the websocket URL is derived from the main "relay_url", so there's no
extra port to allocate, and no extra service to shut down.
2016-04-18 18:03:26 -07:00
Brian Warner
2e2b869ec2 tests: internal changes 2016-04-18 17:58:40 -07:00
Brian Warner
b99adecdde Depend upon autobahn, for upcoming websocket support.
Use 'autobahn[twisted]' just to be sure (plain 'autobahn' worked fine
for py27, but maybe it's needed for py35 or something).

Autobahn is failing to do some conditional import and accidentally
depends upon pytrie (for some encrypted WAMP thing) when we didn't ask
for it (https://github.com/crossbario/autobahn-python/issues/604). This
commit also adds a manual dependency on pytrie (which is pretty small)
until the upstream bug is fixed.
2016-04-18 17:58:40 -07:00
Brian Warner
efc23bd078 Rendezvous: change internal API
Deliver not-yet-JSONed objects to listeners (both in broadcast_message
and as the "catch-up" responses to add_listener). Also make the (web)
frontend responsible for adding "sent" timestamps. This all makes
rendezvous.py less web-centric.
2016-04-18 17:40:12 -07:00
Brian Warner
c3bd9e936e split rendezvous server into web, nonweb files
Also rename files/classes from "relay" to "rendezvous".
2016-04-18 17:40:08 -07:00
Brian Warner
7321a2391b Use HKDF from Pypi, not local copy 2016-04-18 16:50:14 -07:00
Brian Warner
3b215c106a use "hkdf" from PyPI instead of wormhole.hkdf 2016-04-18 16:49:29 -07:00
Brian Warner
0edb64b94d add some HKDF tests while we're still using a local copy 2016-04-18 16:49:29 -07:00
Brian Warner
d62e7d3c47 move tests to separage package (not included in sdist) 2016-04-18 16:45:55 -07:00
Brian Warner
17613ce8c1 move hkdf out of util/, remove now-empty directory 2016-04-18 16:45:03 -07:00
Brian Warner
a13a846d7b .coveragerc: fix for split package names 2016-04-18 16:45:03 -07:00
Brian Warner
f9e3b83456 move tests step 2: fix imports, setup.py, tox.ini 2016-04-18 16:45:03 -07:00
Brian Warner
95706c752c move tests step 1: rename files 2016-04-18 16:45:03 -07:00
Brian Warner
26e9621747 Split wormhole_cli out to separate package 2016-04-18 16:44:47 -07:00
Brian Warner
36e63e2347 split wormhole_cli step 2: fix imports, setup.py 2016-04-18 16:43:18 -07:00
Brian Warner
2e7bb1a8f1 split wormhole_cli step 1: move files 2016-04-18 16:43:18 -07:00
Brian Warner
b0b9edb102 Split txwormhole out to separate pacakge 2016-04-18 16:42:36 -07:00
Brian Warner
1688da74d9 split txwormhole step 2: fix imports 2016-04-18 16:41:56 -07:00
Brian Warner
323175ddfe split txwormhole step 1: move files 2016-04-18 16:41:52 -07:00
Brian Warner
0b162af09e move ipaddrs.py from wormhole.util to wormhole.twisted 2016-04-18 16:24:13 -07:00