forked from pgorecki/python-ddd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagnostics.py
More file actions
31 lines (25 loc) · 702 Bytes
/
Copy pathdiagnostics.py
File metadata and controls
31 lines (25 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from typing import Annotated
from fastapi import APIRouter, Depends
from api.dependencies import (
Application,
User,
get_authenticated_user,
get_application,
)
from .iam import UserResponse
router = APIRouter()
@router.get("/debug", tags=["diagnostics"])
async def debug(
app: Annotated[Application, Depends(get_application)],
current_user: Annotated[User, Depends(get_authenticated_user)],
):
return dict(
app_id=id(app),
name=app.name,
version=app["app_version"],
user=UserResponse(
id=str(current_user.id),
username=current_user.username,
access_token=current_user.access_token,
),
)