summaryrefslogtreecommitdiff
path: root/wrappers/python/eduvpn_common/main.py
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-06 14:23:26 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit900b5acf1445eab22fc2833828abd5649eb9f12a (patch)
tree1d85e8b7b45a0d41d7d588de3e9c2fd47d7a5ce6 /wrappers/python/eduvpn_common/main.py
parentd3e1494a5bb9a71d30b4f0d0d48683343a26f330 (diff)
Exports + Python: New API for Token Getter and Setter
First argument is the server id and type instead of a single argument with JSON
Diffstat (limited to 'wrappers/python/eduvpn_common/main.py')
-rw-r--r--wrappers/python/eduvpn_common/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py
index 2c5165f..798c9a4 100644
--- a/wrappers/python/eduvpn_common/main.py
+++ b/wrappers/python/eduvpn_common/main.py
@@ -344,23 +344,23 @@ global_object: Optional[EduVPN] = None
@TokenSetter
-def token_setter(server: ctypes.c_char_p, tokens: ctypes.c_char_p):
+def token_setter(server_id: ctypes.c_char_p, server_type: ctypes.c_int, tokens: ctypes.c_char_p):
global global_object
if global_object is None:
return
if global_object.token_setter is None:
return 0
- global_object.token_setter(server.decode(), tokens.decode())
+ global_object.token_setter(server_id.decode(), server_type, tokens.decode())
@TokenGetter
-def token_getter(server: ctypes.c_char_p, buf: ctypes.c_char_p, size: ctypes.c_size_t):
+def token_getter(server_id: ctypes.c_char_p, server_type: ctypes.c_int, buf: ctypes.c_char_p, size: ctypes.c_size_t):
global global_object
if global_object is None:
return
if global_object.token_getter is None:
return
- got = global_object.token_getter(server.decode())
+ got = global_object.token_getter(server_id.decode(), server_type)
if got is None:
return