From a015fd1c5ba1aac4e87a678fe47dd2b93ba3b470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B5=AB=E7=84=B6?= Date: Wed, 18 Sep 2024 16:42:17 +0800 Subject: [PATCH] Delete gen_jwt_token API --- common/rpc-service.c | 16 ---------------- include/seafile-rpc.h | 3 --- python/seafile/rpcclient.py | 4 ---- python/seaserv/api.py | 3 --- server/seaf-server.c | 5 ----- 5 files changed, 31 deletions(-) diff --git a/common/rpc-service.c b/common/rpc-service.c index 1354685d..9156b4ef 100644 --- a/common/rpc-service.c +++ b/common/rpc-service.c @@ -4645,22 +4645,6 @@ seafile_search_files_by_path (const char *repo_id, const char *path, const char return g_list_reverse (ret); } -char * -seafile_generate_notif_server_jwt (const char *repo_id, const char *username, GError **error) -{ - if (!repo_id || !username) { - g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Argument should not be null"); - return NULL; - } - - char *token = seaf_gen_notif_server_jwt (repo_id, username); - if (!token) { - g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_INTERNAL, - "Failed to generate jwt token"); - } - return token; -} - /*RPC functions merged from ccnet-server*/ int ccnet_rpc_add_emailuser (const char *email, const char *passwd, diff --git a/include/seafile-rpc.h b/include/seafile-rpc.h index acd55e82..0b70da20 100644 --- a/include/seafile-rpc.h +++ b/include/seafile-rpc.h @@ -1155,9 +1155,6 @@ seafile_search_files (const char *repo_id, const char *str, GError **error); GList * seafile_search_files_by_path (const char *repo_id, const char *path, const char *str, GError **error); -char * -seafile_generate_notif_server_jwt (const char *repo_id, const char *username, GError **error); - /*Following is ccnet rpc*/ int ccnet_rpc_add_emailuser (const char *email, const char *passwd, diff --git a/python/seafile/rpcclient.py b/python/seafile/rpcclient.py index fc3cd452..1c0aae2c 100644 --- a/python/seafile/rpcclient.py +++ b/python/seafile/rpcclient.py @@ -826,10 +826,6 @@ def search_files(self, repo_id, search_str): def search_files_by_path(self, repo_id, path, search_str): pass - @searpc_func("string", ["string", "string"]) - def generate_notif_server_jwt(self, repo_id, username): - pass - #user management @searpc_func("int", ["string", "string", "int", "int"]) def add_emailuser(self, email, passwd, is_staff, is_active): diff --git a/python/seaserv/api.py b/python/seaserv/api.py index b8fb770c..291f9a16 100644 --- a/python/seaserv/api.py +++ b/python/seaserv/api.py @@ -862,9 +862,6 @@ def search_files(self, repo_id, search_str): def search_files_by_path (self, repo_id, path, search_str): return seafserv_threaded_rpc.search_files_by_path(repo_id, path, search_str) - def gen_notif_server_jwt (self, repo_id, username): - return seafserv_threaded_rpc.generate_notif_server_jwt (repo_id, username) - seafile_api = SeafileAPI() class CcnetAPI(object): diff --git a/server/seaf-server.c b/server/seaf-server.c index 31610f92..6a589cde 100644 --- a/server/seaf-server.c +++ b/server/seaf-server.c @@ -355,11 +355,6 @@ static void start_rpc_service (const char *seafile_dir, "search_files_by_path", searpc_signature_objlist__string_string_string()); - searpc_server_register_function ("seafserv-threaded-rpcserver", - seafile_generate_notif_server_jwt, - "generate_notif_server_jwt", - searpc_signature_string__string_string()); - /* share repo to user */ searpc_server_register_function ("seafserv-threaded-rpcserver", seafile_add_share,