diff --git a/services/api-server/src/simcore_service_api_server/api/dependencies/webserver_rpc.py b/services/api-server/src/simcore_service_api_server/api/dependencies/webserver_rpc.py new file mode 100644 index 00000000000..8fdecd651e9 --- /dev/null +++ b/services/api-server/src/simcore_service_api_server/api/dependencies/webserver_rpc.py @@ -0,0 +1,7 @@ +from fastapi import FastAPI +from simcore_service_api_server.services_rpc.wb_api_server import WbApiRpcClient + + +def get_wb_api_rpc_client(app: FastAPI) -> WbApiRpcClient: + assert app.state.wb_api_rpc_client # nosec + return app.state.wb_api_rpc_client diff --git a/services/api-server/src/simcore_service_api_server/api/routes/licensed_items.py b/services/api-server/src/simcore_service_api_server/api/routes/licensed_items.py index 5f40440fa8a..2f593f1b5ff 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/licensed_items.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/licensed_items.py @@ -2,13 +2,11 @@ from fastapi import APIRouter, Depends from models_library.api_schemas_webserver.licensed_items import LicensedItemGetPage -from servicelib.rabbitmq._client_rpc import RabbitMQRPCClient -from servicelib.rabbitmq.rpc_interfaces.webserver.licenses.licensed_items import ( - get_licensed_items as _get_licensed_items, -) -from simcore_service_api_server.api.dependencies.authentication import get_product_name -from simcore_service_api_server.api.dependencies.rabbitmq import get_rabbitmq_rpc_client -from simcore_service_api_server.models.pagination import PaginationParams + +from ...api.dependencies.authentication import get_product_name +from ...api.dependencies.webserver_rpc import get_wb_api_rpc_client +from ...models.pagination import PaginationParams +from ...services_rpc.wb_api_server import WbApiRpcClient router = APIRouter() @@ -17,12 +15,10 @@ "/", response_model=LicensedItemGetPage, description="Get all licensed items" ) async def get_licensed_items( - wallet_id: int, page_params: Annotated[PaginationParams, Depends()], - webserver_rpc_api: Annotated[RabbitMQRPCClient, Depends(get_rabbitmq_rpc_client)], + web_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)], product_name: Annotated[str, Depends(get_product_name)], ) -> LicensedItemGetPage: - return await _get_licensed_items( - rabbitmq_rpc_client=webserver_rpc_api, - product_name=product_name, + return await web_api_rpc.get_licensed_items( + product_name=product_name, page_params=page_params ) diff --git a/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py b/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py index 6b863ebb53a..3c2bd479b0a 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py @@ -53,7 +53,7 @@ from ..dependencies.database import Engine, get_db_engine from ..dependencies.rabbitmq import get_log_check_timeout, get_log_distributor from ..dependencies.services import get_api_client -from ..dependencies.webserver import AuthSession, get_webserver_session +from ..dependencies.webserver_http import AuthSession, get_webserver_session from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION from .solvers_jobs import ( JOBS_STATUS_CODES,