Skip to content

Commit

Permalink
Remove the authentication feature when acquiring generated images
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhan1993 committed Jul 12, 2024
1 parent a609820 commit 4b973ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apis/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from apis.routes.generate import secure_router as generate
from apis.routes.query import secure_router as query
from apis.routes.query import router
from apis.utils import file_utils
from apis.utils import api_utils

Expand All @@ -25,6 +26,7 @@

app.include_router(query)
app.include_router(generate)
app.include_router(router)


@app.get("/", tags=["Query"])
Expand Down
6 changes: 4 additions & 2 deletions apis/routes/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ async def tasks_info(task_id: str = None):
dependencies=[Depends(api_key_auth)]
)

router = APIRouter()


@secure_router.get("/tasks", tags=["Query"])
async def get_tasks(
Expand Down Expand Up @@ -147,7 +149,7 @@ async def get_task(task_id: str):
return JSONResponse(await tasks_info(task_id))


@secure_router.get("/outputs/{date}/{file_name}", tags=["Query"])
@router.get("/outputs/{date}/{file_name}", tags=["Query"])
async def get_output(date: str, file_name: str, accept: str = Header(None)):
"""
Get a specific output by its ID.
Expand All @@ -172,7 +174,7 @@ async def get_output(date: str, file_name: str, accept: str = Header(None)):
return Response(content=img, media_type=f"image/{ext}")


@secure_router.get("/inputs/{file_name}", tags=["Query"])
@router.get("/inputs/{file_name}", tags=["Query"])
async def get_input(file_name: str, accept: str = Header(None)):
"""
Get a specific input by its ID.
Expand Down

0 comments on commit 4b973ee

Please sign in to comment.