diff options
| -rw-r--r-- | cmd/cli/main.go | 6 | ||||
| -rw-r--r-- | state_test.go | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cmd/cli/main.go b/cmd/cli/main.go index c062303..d39cc4d 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -91,7 +91,7 @@ func sendProfile(state *eduvpn.VPNState, data interface{}) { // If OAuth is started we open the browser with the Auth URL // If we ask for a profile, we send the profile using command line input // Note that this has an additional argument, the vpn state which was wrapped into this callback function below -func stateCallback(state *eduvpn.VPNState, oldState eduvpn.VPNStateID, newState eduvpn.VPNStateID, data interface{}) { +func stateCallback(state *eduvpn.VPNState, oldState eduvpn.StateID, newState eduvpn.StateID, data interface{}) { // TODO: Remove internal usage of fsm if newState == fsm.OAUTH_STARTED { openBrowser(data) @@ -168,7 +168,7 @@ func storeSecureInternetConfig(state *eduvpn.VPNState, url string, directory str func getSecureInternetAll(homeURL string) { state := &eduvpn.VPNState{} - state.Register("org.eduvpn.app.linux", "configs", func(old eduvpn.VPNStateID, new eduvpn.VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", "configs", func(old eduvpn.StateID, new eduvpn.StateID, data interface{}) { stateCallback(state, old, new, data) }, true) @@ -209,7 +209,7 @@ func getSecureInternetAll(homeURL string) { func printConfig(url string, serverType ServerTypes) { state := &eduvpn.VPNState{} - state.Register("org.eduvpn.app.linux", "configs", func(old eduvpn.VPNStateID, new eduvpn.VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", "configs", func(old eduvpn.StateID, new eduvpn.StateID, data interface{}) { stateCallback(state, old, new, data) }, true) diff --git a/state_test.go b/state_test.go index 688057b..32a239d 100644 --- a/state_test.go +++ b/state_test.go @@ -57,7 +57,7 @@ func loginOAuthSelenium(t *testing.T, url string, state *VPNState) { } } -func stateCallback(t *testing.T, oldState VPNStateID, newState VPNStateID, data interface{}, state *VPNState) { +func stateCallback(t *testing.T, oldState StateID, newState StateID, data interface{}, state *VPNState) { if newState == fsm.OAUTH_STARTED { url, ok := data.(string) @@ -73,7 +73,7 @@ func Test_server(t *testing.T) { state := &VPNState{} ensureLocalWellKnown() - state.Register("org.eduvpn.app.linux", "configstest", func(old VPNStateID, new VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", "configstest", func(old StateID, new StateID, data interface{}) { stateCallback(t, old, new, data, state) }, false) @@ -89,7 +89,7 @@ func test_connect_oauth_parameter(t *testing.T, parameters httpw.URLParameters, state := &VPNState{} configDirectory := "test_oauth_parameters" - state.Register("org.eduvpn.app.linux", configDirectory, func(oldState VPNStateID, newState VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", configDirectory, func(oldState StateID, newState StateID, data interface{}) { if newState == fsm.OAUTH_STARTED { baseURL := "http://127.0.0.1:8000/callback" url, err := httpw.HTTPConstructURL(baseURL, parameters) @@ -158,7 +158,7 @@ func Test_token_expired(t *testing.T) { // Get a vpn state state := &VPNState{} - state.Register("org.eduvpn.app.linux", "configsexpired", func(old VPNStateID, new VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", "configsexpired", func(old StateID, new StateID, data interface{}) { stateCallback(t, old, new, data, state) }, false) @@ -206,7 +206,7 @@ func Test_token_invalid(t *testing.T) { ensureLocalWellKnown() - state.Register("org.eduvpn.app.linux", "configsinvalid", func(old VPNStateID, new VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", "configsinvalid", func(old StateID, new StateID, data interface{}) { stateCallback(t, old, new, data, state) }, false) @@ -256,7 +256,7 @@ func Test_invalid_profile_corrected(t *testing.T) { ensureLocalWellKnown() - state.Register("org.eduvpn.app.linux", "configscancelprofile", func(old VPNStateID, new VPNStateID, data interface{}) { + state.Register("org.eduvpn.app.linux", "configscancelprofile", func(old StateID, new StateID, data interface{}) { stateCallback(t, old, new, data, state) }, false) |
