Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 8a798e4

Browse files
committed
[client] report work expectations without impersonated user
1 parent 926225a commit 8a798e4

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,8 +2501,10 @@ def import_item(
25012501
if work_id is not None:
25022502
item_str = json.dumps(item)
25032503
# report expectation without impersonated user
2504-
current_applicant_id = self.opencti.get_request_headers()["opencti-applicant-id"]
2505-
self.opencti.set_applicant_id_header('')
2504+
current_applicant_id = self.opencti.get_request_headers()[
2505+
"opencti-applicant-id"
2506+
]
2507+
self.opencti.set_applicant_id_header("")
25062508
self.opencti.work.report_expectation(
25072509
work_id,
25082510
{
@@ -2650,8 +2652,10 @@ def import_item(
26502652
self.import_object(item, update, types)
26512653
if work_id is not None:
26522654
# report expectation without impersonated user
2653-
current_applicant_id = self.opencti.get_request_headers()["opencti-applicant-id"]
2654-
self.opencti.set_applicant_id_header('')
2655+
current_applicant_id = self.opencti.get_request_headers()[
2656+
"opencti-applicant-id"
2657+
]
2658+
self.opencti.set_applicant_id_header("")
26552659
self.opencti.work.report_expectation(work_id, None)
26562660
self.opencti.set_applicant_id_header(current_applicant_id)
26572661
bundles_success_counter.add(1)
@@ -2711,8 +2715,10 @@ def import_item(
27112715
if work_id is not None:
27122716
self.opencti.work.api.set_draft_id("")
27132717
# report expectation without impersonated user
2714-
current_applicant_id = self.opencti.get_request_headers()["opencti-applicant-id"]
2715-
self.opencti.set_applicant_id_header('')
2718+
current_applicant_id = self.opencti.get_request_headers()[
2719+
"opencti-applicant-id"
2720+
]
2721+
self.opencti.set_applicant_id_header("")
27162722
self.opencti.work.report_expectation(
27172723
work_id,
27182724
{
@@ -2729,8 +2735,10 @@ def import_item(
27292735
if work_id is not None:
27302736
item_str = json.dumps(item)
27312737
# report expectation without impersonated user
2732-
current_applicant_id = self.opencti.get_request_headers()["opencti-applicant-id"]
2733-
self.opencti.set_applicant_id_header('')
2738+
current_applicant_id = self.opencti.get_request_headers()[
2739+
"opencti-applicant-id"
2740+
]
2741+
self.opencti.set_applicant_id_header("")
27342742
self.opencti.work.report_expectation(
27352743
work_id,
27362744
{

0 commit comments

Comments
 (0)