Skip to content

Commit

Permalink
Add additional authentication check step
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Dec 17, 2024
1 parent 7ee9761 commit dfdf6d9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions librarian_server/api/corrupt.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ def user_and_librarian_validation_flow(

librarian_exists = librarian is not None

if not librarian_exists:
logger.warning(
"Librarian {} does not exist, cannot authenticate remedy request",
librarian_name,
)
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=dict(
reason="Unauthorized",
suggested_remedy="",
),
)

stmt = select(RemoteInstance).filter_by(
file_name=file_name, librarian_id=librarian.id
)
Expand Down

0 comments on commit dfdf6d9

Please sign in to comment.