Skip to content

Commit

Permalink
72: ensured all endpoints are authenitcated
Browse files Browse the repository at this point in the history
  • Loading branch information
Nargis Sultani committed Feb 28, 2024
1 parent 394cb36 commit 089df7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routers/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ async def get_filing_periods(request: Request):


@router.get("/institutions/{lei}/filings/{period_name}", response_model=FilingDTO)
@requires("authenticated")
async def get_filing(request: Request, lei: str, period_name: str):
return await repo.get_filing(request.state.db_session, lei, period_name)


@router.post("/institutions/{lei}/filings/{period_name}", response_model=FilingDTO)
@requires("authenticated")
async def post_filing(request: Request, lei: str, period_name: str, filing_obj: FilingDTO = None):
if filing_obj:
return await repo.upsert_filing(request.state.db_session, filing_obj)
Expand All @@ -41,6 +43,7 @@ async def post_filing(request: Request, lei: str, period_name: str, filing_obj:


@router.post("/{lei}/submissions/{submission_id}", status_code=HTTPStatus.ACCEPTED)
@requires("authenticated")
async def upload_file(
request: Request, lei: str, submission_id: str, file: UploadFile, background_tasks: BackgroundTasks
):
Expand All @@ -56,6 +59,7 @@ async def get_submission(request: Request, lei: str, period_name: str):


@router.get("/institutions/{lei}/filings/{period_name}/submissions/latest", response_model=SubmissionDTO)
@requires("authenticated")
async def get_submission_latest(request: Request, lei: str, period_name: str):
result = await repo.get_latest_submission(request.state.db_session, lei, period_name)
if result:
Expand Down

0 comments on commit 089df7e

Please sign in to comment.