basic = HTTPBasic()
@application.get("/test")
def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(basic)]):
return {"username": credentials.username, "password": credentials.password}
HTTPException(
status_code=HTTP_401_UNAUTHORIZED,
detail="Not authenticated",
headers=unauthorized_headers,
)