Skip to content

Commit

Permalink
connect pieces to expose licensed items
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis committed Dec 12, 2024
1 parent 6d220d3 commit a027ecf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a027ecf

Please sign in to comment.