From 21019bc8414e60495573807b0fe0eb562a0e8876 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sat, 31 Aug 2024 14:27:35 +0200 Subject: agent auth dependency --- __main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index 03fb366..2434422 100644 --- a/__main__.py +++ b/__main__.py @@ -22,6 +22,6 @@ app = FastAPI(lifespan=lifespan) app.include_router(agents.router) -@app.get("/{callsign}/tasks") -async def get_tasks(callsign: str, token: Annotated[str, Depends(agents.oauth2_scheme)]): - return f'{{"callsign": "{callsign}", "token": "{token}"}}' +@app.get("/tasks") +async def get_tasks(agent: Annotated[agents.Agent, Depends(agents.auth_agent)]): + return {"callsign": agent.agent_symbol} -- cgit v1.2.3-70-g09d2