add uuid to all xmpp messages

(Except for the actual streaming of receive-pack through XMPP, which
can only run once we've gotten an appropriate uuid in a push initiation
message.)

Pushes are now only initiated when the initiation message comes from a
known uuid. This allows multiple distinct repositories to use the same xmpp
address.

Note: This probably breaks initial push after xmpp pairing, because at that
point we may not know about the paired uuid, and so reject the push from
it. It won't break in simple cases, because the annex-uuid of the remote
is checked. However, when there are multiple clients behind a single xmpp
address, only uuid of the first is recorded in annex-uuid, and so any
pushes from the others will be rejected (unless the first remote pushes their
uuids to us beforehand.
This commit is contained in:
Joey Hess 2013-04-30 13:22:55 -04:00
parent 343f989c14
commit df88c51334
5 changed files with 47 additions and 37 deletions

View file

@ -69,18 +69,18 @@ containing:
For pairing, a chat message is sent to every known git-annex client,
containing:
<git-annex xmlns='git-annex' pairing="PairReq|PairAck|PairDone uuid" />
<git-annex xmlns='git-annex' pairing="PairReq|PairAck|PairDone myuuid" />
### git push over XMPP
To indicate that we could push over XMPP, a chat message is sent,
to each known client of each XMPP remote.
<git-annex xmlns='git-annex' canpush="" />
<git-annex xmlns='git-annex' canpush="myuuid" />
To request that a remote push to us, a chat message can be sent.
<git-annex xmlns='git-annex' pushrequest="" />
<git-annex xmlns='git-annex' pushrequest="myuuid" />
When replying to an canpush message, this is directed at the specific
client that indicated it could push. To solicit pushes from all clients,
@ -88,7 +88,7 @@ the message has to be sent directed individually to each client.
When a peer is ready to send a git push, it sends:
<git-annex xmlns='git-annex' startingpush="" />
<git-annex xmlns='git-annex' startingpush="myuuid" />
The receiver runs `git receive-pack`, and sends back its output in
one or more chat messages, directed to the client that is pushing: