diff options
| -rw-r--r-- | exports/exports.go | 16 | ||||
| -rw-r--r-- | wrappers/python/eduvpn_common/loader.py | 2 | ||||
| -rw-r--r-- | wrappers/python/eduvpn_common/main.py | 5 |
3 files changed, 9 insertions, 14 deletions
diff --git a/exports/exports.go b/exports/exports.go index 5c36446..c7d4b8c 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -615,13 +615,11 @@ func SetProfileID(data *C.char) *C.char { // // This MUST only be called if the user/client wishes to manually set a location instead of the common lib asking for one using a transition // -// Because this does network requests to initialize the location, there is a cookie again :) -// -// `c` is the Cookie that needs to be passed. To create a cookie, first call `CookieNew` -// `Data` is the location ID +// `orgID` is the organisation ID for the secure internet server +// `cc` is the location ID/country code // // It returns an error if unsuccessful. -// Example Input: ```SetSecureLocation("nl")``` +// Example Input: ```SetSecureLocation("http://idp.geant.org/", "nl")``` // // Example Output: // @@ -633,16 +631,12 @@ func SetProfileID(data *C.char) *C.char { // } // //export SetSecureLocation -func SetSecureLocation(c C.uintptr_t, data *C.char) *C.char { +func SetSecureLocation(orgID *C.char, cc *C.char) *C.char { state, stateErr := getVPNState() if stateErr != nil { return getCError(stateErr) } - ck, err := getCookie(c) - if err != nil { - return getCError(err) - } - locationErr := state.SetSecureLocation(ck, C.GoString(data)) + locationErr := state.SetSecureLocation(C.GoString(orgID), C.GoString(cc)) return getCError(locationErr) } diff --git a/wrappers/python/eduvpn_common/loader.py b/wrappers/python/eduvpn_common/loader.py index 7da159c..51286d2 100644 --- a/wrappers/python/eduvpn_common/loader.py +++ b/wrappers/python/eduvpn_common/loader.py @@ -107,7 +107,7 @@ def initialize_functions(lib: CDLL) -> None: lib.CookieCancel.argtypes, lib.CookieCancel.restype = [c_int], c_void_p lib.CookieDelete.argtypes, lib.CookieDelete.restype = [c_int], c_void_p lib.SetSecureLocation.argtypes, lib.SetSecureLocation.restype = [ - c_int, + c_char_p, c_char_p, ], c_void_p lib.SetSupportWireguard.argtypes, lib.SetSupportWireguard.restype = [ diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index d1b3f48..0daf0b6 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -278,15 +278,16 @@ class EduVPN(object): if profile_err: forwardError(profile_err) - def set_secure_location(self, country_code: str) -> None: + def set_secure_location(self, org_id: str, country_code: str) -> None: """Set the secure location + :param org_id: str: The organisation ID :param country_code: str: The country code of the new location :raises WrappedError: An error by the Go library """ # Set the location by country code - location_err = self.go_cookie_function(self.lib.SetSecureLocation, country_code) + location_err = self.go_function(self.lib.SetSecureLocation, org_id, country_code) # If there is a location event, set it so that the wait callback finishes # And so that the Go code can move to the next state |
