docs: adding connection diagram

This commit is contained in:
Evgeny Poberezkin 2019-12-21 15:04:51 +00:00
parent ac58b56ac6
commit fea92fa2fe
5 changed files with 673 additions and 145 deletions

24
diagrams/connection.mmd Normal file
View file

@ -0,0 +1,24 @@
sequenceDiagram
participant Alice
participant App A
participant Server A
participant Server B
participant App B
participant Bob
Alice ->> App A: Alice shows <AB public key> as QR code on the screen<br>(Alice's public key for Bob's eyes only)
Bob ->> App B: Bob requests app to add connection
App A ->> App B: Bob's app reads <AB public key> via the camera
App B ->> Server B: Bob's app encrypts "connection request" (including <BA public key> and Bob's profile) and sends it to Bob's servers<br>{from: <BA public key hash>, to: <AB public key hash>, message: <request encrypted with AB public key>}
Server B ->> Server A: Bob's servers use <AB public key hash> to locate Alice's servers<br>and forward encrypted message to all Alice's servers (when they are different from Bob's servers)
Server A ->> App A: Alice's servers send the message to Alice's app
App A ->> Alice: Alice's app uses <AB public key hash> to identify Bob<br>and decrypts Bob's request with <AB private key> to show it
Alice ->> App A: Alice identifies Bob's profile and accepts the connection<br>(Bob is now added to Alice's list of connections as "pending")
App A ->> Server A: Alice's app creates "connection accepted" message (including Alice's profile) and sends it to Alice's servers<br>{from: <AB public key hash>, to: <BA public key hash>, message: <encrypted with AB public key>}
Server A ->> Server B: Alice's servers use <BA public key hash> to locate Bob's servers<br>and forward encrypted message to all Bob's servers (when they are different from Alice's servers)
Server B ->> App B: Bob's servers send the message to Bob's app
App B ->> Bob: Bob's app uses <AB public key hash> to identify Alice<br>and decrypts the acceptance with Bob's <BA private key>
App B ->> Bob: Bob's app adds Alice to the list of connections
App B ->> Server B: "connection acknowledgement" message
Server B ->> Server A: "connection acknowledgement" message
Server A ->> App A: "connection acknowledgement" message
App A ->> Alice: Bob is now in the Alice's list of connections as "established"

498
diagrams/connection.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -7,6 +7,6 @@ sequenceDiagram
participant Bob
Alice ->> App A: Alice writes the message to Bob in the app
App A ->> Server A: The message (including ID & timestamp) is encrypted with Bob's <BA public key> and sent to all Alice's servers<br>{from: <AB public key hash>, to: <BA public key hash>, message: <encrypted with BA public key>}
Server A ->> Server B: Alice's servers use <BA public key hash> to locate Bob's servers<br>and forward encrypted message to all Bob's servers (when they are different from Alice's servers
Server A ->> Server B: Alice's servers use <BA public key hash> to locate Bob's servers<br>and forward encrypted message to all Bob's servers (when they are different from Alice's servers)
Server B ->> App B: Bob's servers send the message to Bob's app
App B ->> Bob: Bob's app uses <AB public key hash> to identify Alice<br>and decrypts the messages with Bob's <BA private key>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before After
Before After

View file

@ -75,6 +75,12 @@ Client apps should provide the following:
## Sequence diagrams
Prepared with [mermaid-js](https://mermaid-js.github.io/mermaid-live-editor)
### Adding connection
![Adding connection](/diagrams/connection.svg)
### Sending message
![Sending message](/diagrams/message.svg)
![Sending message](/diagrams/message.svg)