fix: updated to match new caor endpoint structure

This commit is contained in:
Chris Milne 2026-06-10 10:32:28 +01:00
parent 05bd63c33e
commit 5c5cb137fc

View file

@ -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 = {