Update collaboration doc

Add some diagrams
This commit is contained in:
Max Brunsfeld committed 2021-06-10 14:27:05 -07:00
1 parent 99f1d297c7
commit d6535e0650
8 files changed
+157 -148

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
# Diagrams
The SVG sequence diagrams in the `svg` folder are generated from the UML text files in the `src` folder. To regenerate them, run `script/generate-doc-diagrams`.
Documentation for the UML sequence diagram format is located on [the PlantUML website](https://plantuml.com/sequence-diagram).
+17
View File
@@ -0,0 +1,17 @@
@startuml
participant "Zed App" as app
participant "Browser" as browser
participant "Zed HTTP server" as server
rnote over app: Generate encryption keypair.\nListen on an open TCP port.
app -> browser: Open sign-in page\n(public key, TCP port)
browser -> server: Sign in\n(app's public key, app's TCP port)
rnote over server: Generate access token.\nEncrypt it with app's public key.
server -> browser: Redirect to loopback with app's port\n(user id, encrypted access token)
browser -> app: Follow redirect\n(user id, encrypted access token)
rnote over app: Decrypt access token with private key.\nSave credentials to keychain.
@enduml
+19
View File
@@ -0,0 +1,19 @@
@startuml
participant "Zed App" as app
participant "Zed HTTP server" as server
participant "Zed RPC server" as rpc_server
app -> server: POST worktrees\n(user id, access token)
server -> app: OK\n(worktree id, RPC server address)
app -> rpc_server: Connect to the given RPC server address
app -> rpc_server: **Auth**\n(user id, access token)
rnote over rpc_server: Load access token hashes for user.\nVerify that one matches the given access token.
rpc_server -> app: **AuthResponse**\n(credentials valid)
app -> rpc_server: **ShareWorktree**\n(worktree_id, file paths, file digests)
rnote over rpc_server: Load existing files.\nIdentify which are needed.
rpc_server -> app: **ShareWorktreeResponse**\n(needed path indices)
@enduml
+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="428px" preserveAspectRatio="none" style="width:727px;height:428px;background:#FFFFFF;" version="1.1" viewBox="0 0 727 428" width="727px" zoomAndPan="magnify"><defs><filter height="300%" id="f1s3tlar68499x" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="130" x2="130" y1="40.4883" y2="384.8359"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="361" x2="361" y1="40.4883" y2="384.8359"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="613" x2="613" y1="40.4883" y2="384.8359"/><rect fill="#FEFECE" filter="url(#f1s3tlar68499x)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="71" x="93" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="100" y="25.5352">Zed App</text><rect fill="#FEFECE" filter="url(#f1s3tlar68499x)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="71" x="93" y="383.8359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="100" y="404.3711">Zed App</text><rect fill="#FEFECE" filter="url(#f1s3tlar68499x)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="69" x="325" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55" x="332" y="25.5352">Browser</text><rect fill="#FEFECE" filter="url(#f1s3tlar68499x)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="69" x="325" y="383.8359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55" x="332" y="404.3711">Browser</text><rect fill="#FEFECE" filter="url(#f1s3tlar68499x)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="125" x="549" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="556" y="25.5352">Zed HTTP server</text><rect fill="#FEFECE" filter="url(#f1s3tlar68499x)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="125" x="549" y="383.8359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="556" y="404.3711">Zed HTTP server</text><rect fill="#FBFB77" filter="url(#f1s3tlar68499x)" height="38" style="stroke:#A80036;stroke-width:1.0;" width="188" x="36" y="55.4883"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="180" x="40" y="72.0566">Generate encryption keypair.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="174" x="40" y="87.3672">Listen on an open TCP port.</text><polygon fill="#A80036" points="349.5,131.7305,359.5,135.7305,349.5,139.7305,353.5,135.7305" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="130.5" x2="355.5" y1="135.7305" y2="135.7305"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="118" x="137.5" y="115.6777">Open sign-in page</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="135" x="137.5" y="130.9883">(public key, TCP port)</text><polygon fill="#A80036" points="601.5,176.3516,611.5,180.3516,601.5,184.3516,605.5,180.3516" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="361.5" x2="607.5" y1="180.3516" y2="180.3516"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="43" x="368.5" y="160.2988">Sign in</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="209" x="368.5" y="175.6094">(app's public key, app's TCP port)</text><rect fill="#FBFB77" filter="url(#f1s3tlar68499x)" height="38" style="stroke:#A80036;stroke-width:1.0;" width="209" x="509" y="193.3516"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="145" x="513" y="209.9199">Generate access token.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="201" x="513" y="225.2305">Encrypt it with app's public key.</text><polygon fill="#A80036" points="372.5,269.5938,362.5,273.5938,372.5,277.5938,368.5,273.5938" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="366.5" x2="612.5" y1="273.5938" y2="273.5938"/><text fill="#000000" font-family="sans-sLine truncated

After

Width:  |  Height:  |  Size: 6.2 KiB

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="498px" preserveAspectRatio="none" style="width:570px;height:498px;background:#FFFFFF;" version="1.1" viewBox="0 0 570 498" width="570px" zoomAndPan="magnify"><defs><filter height="300%" id="fy4tkdb0wbh8o" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="42" x2="42" y1="40.4883" y2="454.7676"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="272" x2="272" y1="40.4883" y2="454.7676"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="407" x2="407" y1="40.4883" y2="454.7676"/><rect fill="#FEFECE" filter="url(#fy4tkdb0wbh8o)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="71" x="5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="12" y="25.5352">Zed App</text><rect fill="#FEFECE" filter="url(#fy4tkdb0wbh8o)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="71" x="5" y="453.7676"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="12" y="474.3027">Zed App</text><rect fill="#FEFECE" filter="url(#fy4tkdb0wbh8o)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="125" x="208" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="215" y="25.5352">Zed HTTP server</text><rect fill="#FEFECE" filter="url(#fy4tkdb0wbh8o)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="125" x="208" y="453.7676"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="215" y="474.3027">Zed HTTP server</text><rect fill="#FEFECE" filter="url(#fy4tkdb0wbh8o)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="116" x="347" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="102" x="354" y="25.5352">Zed RPC server</text><rect fill="#FEFECE" filter="url(#fy4tkdb0wbh8o)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="116" x="347" y="453.7676"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="102" x="354" y="474.3027">Zed RPC server</text><polygon fill="#A80036" points="260.5,83.1094,270.5,87.1094,260.5,91.1094,264.5,87.1094" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="42.5" x2="266.5" y1="87.1094" y2="87.1094"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="98" x="49.5" y="67.0566">POST worktrees</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="141" x="49.5" y="82.3672">(user id, access token)</text><polygon fill="#A80036" points="53.5,127.7305,43.5,131.7305,53.5,135.7305,49.5,131.7305" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="47.5" x2="271.5" y1="131.7305" y2="131.7305"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="18" x="59.5" y="111.6777">OK</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="206" x="59.5" y="126.9883">(worktree id, RPC server address)</text><polygon fill="#A80036" points="395,157.041,405,161.041,395,165.041,399,161.041" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="42.5" x2="401" y1="161.041" y2="161.041"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="254" x="49.5" y="156.2988">Connect to the given RPC server address</text><polygon fill="#A80036" points="395,201.6621,405,205.6621,395,209.6621,399,205.6621" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="42.5" x2="401" y1="205.6621" y2="205.6621"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="33" x="49.5" y="185.6094">Auth</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="141" x="49.5" y="200.9199">(user id, access token)</text><rect fill="#FBFB77" filter="url(#fy4tkdb0wbh8o)" height="38" style="stroke:#A80036;stroke-width:1.0;" width="309" x="252" y="218.6621"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="221" x="256" y="235.2305">Load access token haLine truncated

After

Width:  |  Height:  |  Size: 7.1 KiB