summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-08-31 14:27:35 +0200
committerBotond Hende <nettingman@gmail.com>2024-08-31 14:27:35 +0200
commit21019bc8414e60495573807b0fe0eb562a0e8876 (patch)
tree49a1c412dfe3068e87ff51b2a66e1ea49b290206 /__main__.py
parent254a5eda7d17ff28d4604d95dba6f102120189b8 (diff)
agent auth dependency
Diffstat (limited to '__main__.py')
-rw-r--r--__main__.py6
1 files changed, 3 insertions, 3 deletions
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}