mirror of
https://github.com/clearml/clearml-server
synced 2025-02-07 13:33:42 +00:00
Add X-Jwt-Payload
to redacted headers
This commit is contained in:
parent
69737308fe
commit
3efed32934
@ -313,6 +313,7 @@ class APICall(DataContainer):
|
|||||||
_redacted_headers = {
|
_redacted_headers = {
|
||||||
HEADER_AUTHORIZATION: " ",
|
HEADER_AUTHORIZATION: " ",
|
||||||
"Cookie": "=",
|
"Cookie": "=",
|
||||||
|
"X-Jwt-Payload": "",
|
||||||
}
|
}
|
||||||
""" Headers whose value should be redacted. Maps header name to partition char """
|
""" Headers whose value should be redacted. Maps header name to partition char """
|
||||||
|
|
||||||
@ -692,6 +693,10 @@ class APICall(DataContainer):
|
|||||||
# this will allow us to debug authorization errors).
|
# this will allow us to debug authorization errors).
|
||||||
for header, sep in self._redacted_headers.items():
|
for header, sep in self._redacted_headers.items():
|
||||||
if header in headers:
|
if header in headers:
|
||||||
prefix, _, redact = headers[header].partition(sep)
|
if sep:
|
||||||
|
prefix, _, redact = headers[header].partition(sep)
|
||||||
|
else:
|
||||||
|
prefix = sep = ""
|
||||||
|
redact = headers[header]
|
||||||
headers[header] = prefix + sep + f"<{len(redact)} bytes redacted>"
|
headers[header] = prefix + sep + f"<{len(redact)} bytes redacted>"
|
||||||
return headers
|
return headers
|
||||||
|
Loading…
Reference in New Issue
Block a user