summaryrefslogtreecommitdiff
path: root/src/routers/scanner.py
blob: 956153bb5cf8e33f4b42c6665a44765e4a7c7776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import APIRouter, Depends, Request
from fastapi.responses import JSONResponse
from fastapi_jwt_auth import AuthJWT

router = APIRouter()


@router.get('/callhome')
async def callhome(data: Request, Authorize: AuthJWT = Depends()):
    Authorize.jwt_required()

    json_data = await data.json()

    if 'uuid' not in json_data:
        return JSONResponse(content={"status": "error",
                                     "message": "UUID missing"})