Skip to content

Commit d5efb6f

Browse files
committed
Added documentation to instrument server-side token validation function
1 parent 27a681a commit d5efb6f

File tree

1 file changed

+4
-1
lines changed
  • src/murfey/instrument_server

1 file changed

+4
-1
lines changed

src/murfey/instrument_server/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
def validate_session_token(
5252
session_id: int, token: Annotated[str, Depends(oauth2_scheme)]
5353
):
54+
"""
55+
Validates the token received from the backend server
56+
"""
5457
try:
5558
decoded_data = jwt.decode(
5659
token,
@@ -62,7 +65,7 @@ def validate_session_token(
6265
except JWTError:
6366
raise HTTPException(
6467
status_code=status.HTTP_401_UNAUTHORIZED,
65-
detail="Could not validate credentials",
68+
detail="Could not validate credentials from backend",
6669
headers={"WWW-Authenticate": "Bearer"},
6770
)
6871
return session_id

0 commit comments

Comments
 (0)