From 0319b4e9c43537fcb958394203551c5fcd1eca59 Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Thu, 6 Aug 2026 18:25:51 +0200 Subject: [PATCH] refactor(routes): table credential check registrations --- core/routes/search_support.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/core/routes/search_support.py b/core/routes/search_support.py index 03cd332..76e9c5f 100644 --- a/core/routes/search_support.py +++ b/core/routes/search_support.py @@ -16,21 +16,26 @@ def register_search_support_routes(context: RouteContext): operation=service.clear_search_cache, ) - @routes.post("/model_resolver/civitai/session-token/check") - async def civitai_session_token_check_route(request): - return await service.check_civitai_session_token_route(request) - - @routes.post("/model_resolver/civitai/api-key/check") - async def civitai_api_key_check_route(request): - return await service.check_civitai_api_key_route(request) - - @routes.post("/model_resolver/huggingface/token/check") - async def huggingface_token_check_route(request): - return await service.check_huggingface_token_route(request) - - @routes.post("/model_resolver/brave/api-key/check") - async def brave_api_key_check_route(request): - return await service.check_brave_search_api_key_route(request) + credential_routes = ( + ( + "/model_resolver/civitai/session-token/check", + service.check_civitai_session_token_route, + ), + ( + "/model_resolver/civitai/api-key/check", + service.check_civitai_api_key_route, + ), + ( + "/model_resolver/huggingface/token/check", + service.check_huggingface_token_route, + ), + ( + "/model_resolver/brave/api-key/check", + service.check_brave_search_api_key_route, + ), + ) + for path, operation in credential_routes: + routes.post(path)(operation) register_service_route( context,