From 5c5cb137fc248f5ea47e02eef0974f4d3671879a Mon Sep 17 00:00:00 2001 From: luxferre Date: Wed, 10 Jun 2026 10:32:28 +0100 Subject: [PATCH] fix: updated to match new caor endpoint structure --- src/_module_template/router.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/_module_template/router.py b/src/_module_template/router.py index 6593c45..3914985 100644 --- a/src/_module_template/router.py +++ b/src/_module_template/router.py @@ -18,7 +18,7 @@ Exports: - Verify module level docstring is still accurate after updates """ import threading -from typing import Annotated +from typing import Annotated, Optional from fastapi import APIRouter, Request, HTTPException from fastapi.params import Query @@ -31,6 +31,7 @@ router = APIRouter( tags=[""], ) + @router.put("/timer/start") async def start_timer(request: Request, interval: int): def example_timer_target(): @@ -71,16 +72,20 @@ async def stop_timer(request: Request, ident: str): @router.get("/hub/access") -async def test_hub_access(headers: header_dependency, client: http_client_dependency, org_name: Annotated[str, Query()]): - resource_name = "example_resource" - action = "read" - rn = generate_resource_name(resource=resource_name, org=org_name) +async def test_hub_access(headers: header_dependency, client: http_client_dependency, org_name: Annotated[str, Query()], + resource_name: Annotated[str, Query()] = "example_resource", + action: Annotated[str, Query()] = "read", instance: Optional[Annotated[str, Query()]] = None): + rn = generate_resource_name(resource=resource_name, org=org_name, instance=instance) + + request_body = { + "rn": rn.model_dump(), + "action": action, + } hub_response = await client.post( f"http://localhost:8001/api/v1/iam/can_act_on_resource", headers=headers, - params={"action": action}, - json=rn.model_dump() + json=request_body ) response = {