From 3a67e94bd1c0b3d180d5fa6dfa35ee118bb1defa Mon Sep 17 00:00:00 2001 From: Souad Hadjiat Date: Fri, 24 Jan 2025 11:41:40 +0100 Subject: [PATCH] [client] Hide Authorization header (opencti/9693) --- pycti/api/opencti_api_client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pycti/api/opencti_api_client.py b/pycti/api/opencti_api_client.py index a0c102b8a..022649a01 100644 --- a/pycti/api/opencti_api_client.py +++ b/pycti/api/opencti_api_client.py @@ -224,8 +224,11 @@ def set_synchronized_upsert_header(self, synchronized): def set_previous_standard_header(self, previous_standard): self.request_headers["previous-standard"] = previous_standard - def get_request_headers(self): - return self.request_headers + def get_request_headers(self, hide_token=True): + request_headers_copy = self.request_headers.copy() + if hide_token and "Authorization" in request_headers_copy: + request_headers_copy["Authorization"] = "*****" + return request_headers_copy def set_retry_number(self, retry_number): self.request_headers["opencti-retry-number"] = (