mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-18 20:58:06 +00:00
log the TokenData and URL on rejecting tokens (#69)
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
import logging
|
||||
from typing import Callable, Union
|
||||
from uuid import UUID
|
||||
|
||||
@ -66,6 +67,12 @@ def verify_token(
|
||||
return not_ok(token, status_code=401, context="token verification")
|
||||
|
||||
if not is_authorized(token):
|
||||
logging.error(
|
||||
"rejecting token url:%s token:%s body:%s",
|
||||
repr(req.url),
|
||||
repr(token),
|
||||
repr(req.get_body()),
|
||||
)
|
||||
return not_ok(
|
||||
Error(code=ErrorCode.UNAUTHORIZED, errors=["Unrecognized agent"]),
|
||||
status_code=401,
|
||||
|
Reference in New Issue
Block a user