Repository navigation
Speak protocol v1 (SPEC.md draft 2) through awp tunnel - #1
Open
kylemclaren wants to merge 1 commit into
Open
kylemclaren wants to merge 1 commit into
kylemclaren wants to merge 1 commit into
Conversation
Every connection is a WireGuard tunnel between the peers' keys. Python has no WireGuard, so a Peer runs the reference implementation's `awp tunnel` as a helper for its whole life: the helper holds the key, listens on carriers, dials on request over a control socket, forwards the streams peers open, and refuses a hello naming another key. - listen(carrier) takes tailcat, udp, ws, cloudflare or unix and returns the awp1 address; `address` and rotate_psk() are new; connect() takes addresses only. The tcp/unix plaintext transports and the tailcat CLI are gone; Peer(awp=...) names the binary. - The handshake is hello only: v1, no nonce, no auth. hello carries our address without its pre-shared key and the grants that concern the peer on the other end of the tunnel (matched by its X25519 key, which the helper passes on). err refused closes. - An explicit connect() now lifts a bye and dials even with no queued work; dial bookkeeping is per Peer rather than per class. - Tests: 37, all through real tunnels, including a raw client with its own helper for the protocol's edges, grant presentation in hello, rotation, and conformance in both modes. CI builds awp at the engine PR's head.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the Python SDK to draft 2 of the protocol. CI builds
awpat the head of agentwireprotocol/awp#30 (stacked on #28). Once those merge and a release is tagged, CI moves to the tag.How the tunnel works
Python has no userspace WireGuard, so a
Peerrunsawp tunnel, the reference implementation's tunnel, as a helper process for its whole life (SPEC §18.2).listen()asks for.The Peer speaks the protocol itself, from framing on.
API changes
listen(carrier)takestailcat,udp:HOST:PORT,ws:HOST:PORT[=URL],cloudflareorunix:/path. It returns theawp1address, which lists every carrier.addressandrotate_psk()are new.connect(address)accepts onlyawp1addresses. An explicit connect now also lifts abye.Peer(awp=...)names the binary; the default is$AWP_BINorawpon PATH.tailcat=is gone, and so are the plaintext TCP and Unix transports.Protocol changes
authstep.err refusedcloses the connection.Bugs fixed along the way
connect()after abyewaited forever on a parked dial loop._dial_waiterswas class-level, so it was shared across every Peer in a process.Testing
37 tests, all over real tunnels:
awp tunnel. They cover a hello naming another key, version 2, bad frames, oversized lines, dedup, resume replay, missed pongs, Go-style encodings, grant delegation presented in hello, andkill -9on either side.