diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-07 16:18:03 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-07 16:18:03 +0200 |
| commit | c67b8f64438d439d52a9e4955ff1bdf30363dbb1 (patch) | |
| tree | d54cc9b11bc5cfd9cfef375f4742987193050658 /internal/fsm | |
| parent | 7d67ce7f6a15970677b7d0b8f4912fe379862515 (diff) | |
Secure Internet: Implement the Ask Location transition callback
Diffstat (limited to 'internal/fsm')
| -rw-r--r-- | internal/fsm/fsm.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/fsm/fsm.go b/internal/fsm/fsm.go index 2042977..1ba8133 100644 --- a/internal/fsm/fsm.go +++ b/internal/fsm/fsm.go @@ -36,6 +36,9 @@ const ( // No Server means the user has not chosen a server yet NO_SERVER + // The user selected a Secure Internet server but needs to choose a location + ASK_LOCATION + // The user is currently selecting a server in the UI SEARCH_SERVER @@ -67,6 +70,8 @@ func (s FSMStateID) String() string { return "Deregistered" case NO_SERVER: return "No_Server" + case ASK_LOCATION: + return "Ask_Location" case SEARCH_SERVER: return "Search_Server" case CHOSEN_SERVER: @@ -113,7 +118,8 @@ type FSM struct { func (fsm *FSM) Init(name string, callback func(string, string, string), logger *log.FileLogger, directory string, debug bool) { fsm.States = FSMStates{ DEREGISTERED: {{NO_SERVER, "Client registers"}}, - NO_SERVER: {{CHOSEN_SERVER, "User chooses a server"}, {SEARCH_SERVER, "The user is trying to choose a Server in the UI"}}, + NO_SERVER: {{CHOSEN_SERVER, "User chooses a server"}, {SEARCH_SERVER, "The user is trying to choose a Server in the UI"}, {ASK_LOCATION, "User chooses a Secure Internet server but no location is configured"}}, + ASK_LOCATION: {{CHOSEN_SERVER, "Location chosen"}, {NO_SERVER, "Cancel or Error"}}, SEARCH_SERVER: {{CHOSEN_SERVER, "User clicks a server in the UI"}, {NO_SERVER, "Cancel or Error"}}, CHOSEN_SERVER: {{AUTHORIZED, "Found tokens in config"}, {OAUTH_STARTED, "No tokens found in config"}}, OAUTH_STARTED: {{AUTHORIZED, "User authorizes with browser"}, {NO_SERVER, "Cancel or Error"}}, |
