Skip to content

Commit

Permalink
Docs API: Update state machine figure
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed Sep 22, 2023
1 parent d9a11b7 commit f079081
Showing 1 changed file with 71 additions and 8 deletions.
79 changes: 71 additions & 8 deletions docs/src/api/statemachine.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,39 @@ The following is an example of the FSM when the client has obtained a Wireguard/
```mermaid
graph TD
style Deregistered fill:white
style Deregistered fill:cyan
Deregistered(Deregistered) -->|Client registers| No_Server
style No_Server fill:white
No_Server(No_Server) -->|Reload list| No_Server
style No_Server fill:white
No_Server(No_Server) -->|The client wants to ask for a location on the main screen| Ask_Location
style No_Server fill:white
No_Server(No_Server) -->|User clicks a server in the UI| Loading_Server
style No_Server fill:white
No_Server(No_Server) -->|The VPN is still active| Connected
style Ask_Location fill:white
Ask_Location(Ask_Location) -->|Location chosen| Chosen_Location
style Ask_Location fill:white
Ask_Location(Ask_Location) -->|Go back or Error| No_Server
style Ask_Location fill:white
Ask_Location(Ask_Location) -->|Go back or Error| Got_Config
style Chosen_Location fill:white
Chosen_Location(Chosen_Location) -->|Server has been chosen| Chosen_Server
style Chosen_Location fill:white
Chosen_Location(Chosen_Location) -->|Go back or Error| No_Server
style Chosen_Location fill:white
Chosen_Location(Chosen_Location) -->|Go back or Error| Got_Config
style Loading_Server fill:white
Loading_Server(Loading_Server) -->|Server info loaded| Chosen_Server
Expand All @@ -44,26 +59,44 @@ Loading_Server(Loading_Server) -->|User chooses a Secure Internet server but no
style Loading_Server fill:white
Loading_Server(Loading_Server) -->|Go back or Error| No_Server
style Loading_Server fill:white
Loading_Server(Loading_Server) -->|Go back or Error| Got_Config
style Chosen_Server fill:white
Chosen_Server(Chosen_Server) -->|Found tokens in config| Authorized
style Chosen_Server fill:white
Chosen_Server(Chosen_Server) -->|No tokens found in config| OAuth_Started
style Chosen_Server fill:white
Chosen_Server(Chosen_Server) -->|Go back or Error| No_Server
style Chosen_Server fill:white
Chosen_Server(Chosen_Server) -->|Go back or Error| Got_Config
style OAuth_Started fill:white
OAuth_Started(OAuth_Started) -->|User authorizes with browser| Authorized
style OAuth_Started fill:white
OAuth_Started(OAuth_Started) -->|Go back or Error| No_Server
style OAuth_Started fill:white
OAuth_Started(OAuth_Started) -->|Go back or Error| Got_Config
style Authorized fill:white
Authorized(Authorized) -->|Re-authorize with OAuth| OAuth_Started
style Authorized fill:white
Authorized(Authorized) -->|Client requests a config| Request_Config
style Authorized fill:white
Authorized(Authorized) -->|Client wants to go back to the main screen| No_Server
Authorized(Authorized) -->|Load the server again| Loading_Server
style Authorized fill:white
Authorized(Authorized) -->|Go back or Error| No_Server
style Authorized fill:white
Authorized(Authorized) -->|Go back or Error| Got_Config
style Request_Config fill:white
Request_Config(Request_Config) -->|Multiple profiles found and no profile chosen| Ask_Profile
Expand All @@ -72,28 +105,58 @@ style Request_Config fill:white
Request_Config(Request_Config) -->|Only one profile or profile already chosen| Chosen_Profile
style Request_Config fill:white
Request_Config(Request_Config) -->|Cancel or Error| No_Server
Request_Config(Request_Config) -->|Re-authorize| OAuth_Started
style Request_Config fill:white
Request_Config(Request_Config) -->|Re-authorize| OAuth_Started
Request_Config(Request_Config) -->|Go back or Error| No_Server
style Request_Config fill:white
Request_Config(Request_Config) -->|Go back or Error| Got_Config
style Ask_Profile fill:white
Ask_Profile(Ask_Profile) -->|Cancel or Error| No_Server
style Ask_Profile fill:white
Ask_Profile(Ask_Profile) -->|Profile has been chosen| Chosen_Profile
style Chosen_Profile fill:white
Chosen_Profile(Chosen_Profile) -->|Cancel or Error| No_Server
style Ask_Profile fill:white
Ask_Profile(Ask_Profile) -->|Go back or Error| No_Server
style Ask_Profile fill:white
Ask_Profile(Ask_Profile) -->|Go back or Error| Got_Config
style Chosen_Profile fill:white
Chosen_Profile(Chosen_Profile) -->|Config has been obtained| Got_Config
style Got_Config fill:cyan
style Chosen_Profile fill:white
Chosen_Profile(Chosen_Profile) -->|Go back or Error| No_Server
style Chosen_Profile fill:white
Chosen_Profile(Chosen_Profile) -->|Go back or Error| Got_Config
style Got_Config fill:white
Got_Config(Got_Config) -->|Choose a new server| No_Server
style Got_Config fill:cyan
style Got_Config fill:white
Got_Config(Got_Config) -->|Get a new configuration| Loading_Server
style Got_Config fill:white
Got_Config(Got_Config) -->|VPN is connecting| Connecting
style Connecting fill:white
Connecting(Connecting) -->|Go back or Error| Got_Config
style Connecting fill:white
Connecting(Connecting) -->|Done connecting| Connected
style Disconnecting fill:white
Disconnecting(Disconnecting) -->|Done disconnecting| Got_Config
style Disconnecting fill:white
Disconnecting(Disconnecting) -->|Go back or Error| Connected
style Connected fill:white
Connected(Connected) -->|The VPN is disconnecting| Disconnecting
```

</div>
Expand Down

0 comments on commit f079081

Please sign in to comment.