Removed scheme notice
This commit is contained in:
parent
80cfd2e2db
commit
3fad9f1968
@ -13,7 +13,7 @@ from fastapi.responses import UJSONResponse, Response
|
|||||||
from fastapi.openapi.models import APIKey
|
from fastapi.openapi.models import APIKey
|
||||||
from starlette.status import HTTP_204_NO_CONTENT, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT
|
from starlette.status import HTTP_204_NO_CONTENT, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT
|
||||||
|
|
||||||
@app.post("/albums", response_class=UJSONResponse, include_in_schema=True)
|
@app.post("/albums", response_class=UJSONResponse)
|
||||||
async def album_create(name: str, title: str, apikey: APIKey = Depends(get_api_key)):
|
async def album_create(name: str, title: str, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -45,7 +45,7 @@ async def album_create(name: str, title: str, apikey: APIKey = Depends(get_api_k
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.get("/albums", response_class=UJSONResponse, include_in_schema=True)
|
@app.get("/albums", response_class=UJSONResponse)
|
||||||
async def album_find(q: str, apikey: APIKey = Depends(get_api_key)):
|
async def album_find(q: str, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -61,7 +61,7 @@ async def album_find(q: str, apikey: APIKey = Depends(get_api_key)):
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.patch("/albums/{id}", response_class=UJSONResponse, include_in_schema=True)
|
@app.patch("/albums/{id}", response_class=UJSONResponse)
|
||||||
async def album_patch(id: str, name: Union[str, None] = None, title: Union[str, None] = None, apikey: APIKey = Depends(get_api_key)):
|
async def album_patch(id: str, name: Union[str, None] = None, title: Union[str, None] = None, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -101,7 +101,7 @@ async def album_patch(id: str, name: Union[str, None] = None, title: Union[str,
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.put("/albums/{id}", response_class=UJSONResponse, include_in_schema=True)
|
@app.put("/albums/{id}", response_class=UJSONResponse)
|
||||||
async def album_put(id: str, name: str, title: str, apikey: APIKey = Depends(get_api_key)):
|
async def album_put(id: str, name: str, title: str, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -137,7 +137,7 @@ async def album_put(id: str, name: str, title: str, apikey: APIKey = Depends(get
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.delete("/album/{id}", response_class=UJSONResponse, include_in_schema=True)
|
@app.delete("/album/{id}", response_class=UJSONResponse)
|
||||||
async def album_delete(id: str, apikey: APIKey = Depends(get_api_key)):
|
async def album_delete(id: str, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
|
@ -15,7 +15,7 @@ from fastapi.responses import UJSONResponse, Response
|
|||||||
from fastapi.openapi.models import APIKey
|
from fastapi.openapi.models import APIKey
|
||||||
from starlette.status import HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT
|
from starlette.status import HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT
|
||||||
|
|
||||||
@app.post("/albums/{album}/photos", response_class=UJSONResponse, include_in_schema=True)
|
@app.post("/albums/{album}/photos", response_class=UJSONResponse)
|
||||||
async def photo_upload(file: UploadFile, album: str, ignore_duplicates: bool = False, apikey: APIKey = Depends(get_api_key)):
|
async def photo_upload(file: UploadFile, album: str, ignore_duplicates: bool = False, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -64,7 +64,7 @@ async def photo_upload(file: UploadFile, album: str, ignore_duplicates: bool = F
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.get("/photos/{id}", include_in_schema=True)
|
@app.get("/photos/{id}")
|
||||||
async def photo_get(id: str, apikey: APIKey = Depends(get_api_key)):
|
async def photo_get(id: str, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -87,7 +87,7 @@ async def photo_get(id: str, apikey: APIKey = Depends(get_api_key)):
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.delete("/photos/{id}", include_in_schema=True)
|
@app.delete("/photos/{id}")
|
||||||
async def photo_delete(id: str, apikey: APIKey = Depends(get_api_key)):
|
async def photo_delete(id: str, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -106,7 +106,7 @@ async def photo_delete(id: str, apikey: APIKey = Depends(get_api_key)):
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.get("/albums/{album}/photos", response_class=UJSONResponse, include_in_schema=True)
|
@app.get("/albums/{album}/photos", response_class=UJSONResponse)
|
||||||
async def photo_find(q: str, album: str, page: int = 1, page_size: int = 100, apikey: APIKey = Depends(get_api_key)):
|
async def photo_find(q: str, album: str, page: int = 1, page_size: int = 100, apikey: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
if (check_project_key("photos", apikey)):
|
if (check_project_key("photos", apikey)):
|
||||||
@ -134,7 +134,7 @@ async def photo_find(q: str, album: str, page: int = 1, page_size: int = 100, ap
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages"))
|
||||||
|
|
||||||
@app.get("/photos/token/{token}", response_class=UJSONResponse, include_in_schema=True)
|
@app.get("/photos/token/{token}", response_class=UJSONResponse)
|
||||||
async def photo_find_token(token: str):
|
async def photo_find_token(token: str):
|
||||||
|
|
||||||
found_record = col_tokens.find_one( {"token": token} )
|
found_record = col_tokens.find_one( {"token": token} )
|
||||||
|
Loading…
Reference in New Issue
Block a user