pycti 6.6.6__py3-none-any.whl → 6.6.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pycti might be problematic. Click here for more details.

pycti/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "6.6.6"
2
+ __version__ = "6.6.8"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -2418,6 +2418,9 @@ class OpenCTIStix2:
2418
2418
  field_patch_files = next(
2419
2419
  (op for op in field_patch if op["key"] == "x_opencti_files"), None
2420
2420
  )
2421
+ item_id = self.opencti.get_attribute_in_extension("id", item)
2422
+ if item_id is None:
2423
+ item_id = item["id"]
2421
2424
  do_add_file = self.opencti.stix_domain_object.add_file
2422
2425
  if StixCyberObservableTypes.has_value(item["type"]):
2423
2426
  do_add_file = self.opencti.stix_cyber_observable.add_file
@@ -2427,7 +2430,7 @@ class OpenCTIStix2:
2427
2430
  for file in field_patch_files["value"]:
2428
2431
  if "data" in file:
2429
2432
  do_add_file(
2430
- id=item["id"],
2433
+ id=item_id,
2431
2434
  file_name=file["name"],
2432
2435
  version=file.get("version", None),
2433
2436
  data=base64.b64decode(file["data"]),
@@ -2445,26 +2448,29 @@ class OpenCTIStix2:
2445
2448
  field_patch_without_files = [
2446
2449
  op for op in field_patch if op["key"] != "x_opencti_files"
2447
2450
  ]
2451
+ item_id = self.opencti.get_attribute_in_extension("id", item)
2452
+ if item_id is None:
2453
+ item_id = item["id"]
2448
2454
  if len(field_patch_without_files) > 0:
2449
2455
  if item["type"] == "relationship":
2450
2456
  self.opencti.stix_core_relationship.update_field(
2451
- id=item["id"], input=field_patch_without_files
2457
+ id=item_id, input=field_patch_without_files
2452
2458
  )
2453
2459
  elif item["type"] == "sighting":
2454
2460
  self.opencti.stix_sighting_relationship.update_field(
2455
- id=item["id"], input=field_patch_without_files
2461
+ id=item_id, input=field_patch_without_files
2456
2462
  )
2457
2463
  elif StixCyberObservableTypes.has_value(item["type"]):
2458
2464
  self.opencti.stix_cyber_observable.update_field(
2459
- id=item["id"], input=field_patch_without_files
2465
+ id=item_id, input=field_patch_without_files
2460
2466
  )
2461
2467
  elif item["type"] == "external-reference":
2462
2468
  self.opencti.external_reference.update_field(
2463
- id=item["id"], input=field_patch_without_files
2469
+ id=item_id, input=field_patch_without_files
2464
2470
  )
2465
2471
  else:
2466
2472
  self.opencti.stix_domain_object.update_field(
2467
- id=item["id"], input=field_patch_without_files
2473
+ id=item_id, input=field_patch_without_files
2468
2474
  )
2469
2475
  self.apply_patch_files(item)
2470
2476
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycti
3
- Version: 6.6.6
3
+ Version: 6.6.8
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -1,4 +1,4 @@
1
- pycti/__init__.py,sha256=Gf4J6tRIB1xxu_oUOFTYIYH6S1kHF1ZpjnSwT8XMJsw,5538
1
+ pycti/__init__.py,sha256=Eotxw3vYYLn2Z_87OAaqoCTOr426ni8UK2MoQrMVTHk,5538
2
2
  pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  pycti/api/opencti_api_client.py,sha256=MWswVagpg_0giX-XnhfmsTO06UGLIYfsDCAaRavPhds,34225
4
4
  pycti/api/opencti_api_connector.py,sha256=8xwHuLINP3ZCImzE9_K_iCR9QEA3K6aHpK4bJhcZf20,5582
@@ -67,13 +67,13 @@ pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py
67
67
  pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  pycti/utils/constants.py,sha256=zlt4nPytB-PIVd91X0RGh3bY6qWcCOn3hnuM9TuDWEw,11829
69
69
  pycti/utils/opencti_logger.py,sha256=BHNy9fJuTUTn_JEYSCmyvVwd6y-9ZJKxO40mY4iZ0bc,2226
70
- pycti/utils/opencti_stix2.py,sha256=8rERb39pZEzE3mvhCfhrFetJ5OQtFPt-fFM0pWmO2DY,121248
70
+ pycti/utils/opencti_stix2.py,sha256=Fg7xPAqek4lJrfYh2LLQkdsmTCJHM-uwCS4Mye12khw,121492
71
71
  pycti/utils/opencti_stix2_identifier.py,sha256=k8L1z4q1xdCBfxqUba4YS_kT-MmbJFxYh0RvfGOmrOs,837
72
72
  pycti/utils/opencti_stix2_splitter.py,sha256=etnAWMDzNi2JCovSUJ5Td-XLVdzgKRdsV1XfpXOGols,11070
73
73
  pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
74
74
  pycti/utils/opencti_stix2_utils.py,sha256=xgBZzm7HC76rLQYwTKkaUd_w9jJnVMoryHx7KDDIB_g,5065
75
- pycti-6.6.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
76
- pycti-6.6.6.dist-info/METADATA,sha256=BEeFYsvVkZNxwddk5YZKVQ3gyTqI-qSqKodNoUJNh6o,5530
77
- pycti-6.6.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
78
- pycti-6.6.6.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
79
- pycti-6.6.6.dist-info/RECORD,,
75
+ pycti-6.6.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
76
+ pycti-6.6.8.dist-info/METADATA,sha256=-BhHbgkmGV6DDe1KmIoCwgfIuAF7QWDS4OsV4BIwFjU,5530
77
+ pycti-6.6.8.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
78
+ pycti-6.6.8.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
79
+ pycti-6.6.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5