pycti 6.0.2__py3-none-any.whl → 6.0.4__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.0.2"
2
+ __version__ = "6.0.4"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -210,6 +210,9 @@ class OpenCTIApiClient:
210
210
  "true" if synchronized is True else "false"
211
211
  )
212
212
 
213
+ def set_previous_standard_header(self, previous_standard):
214
+ self.request_headers["previous-standard"] = previous_standard
215
+
213
216
  def get_request_headers(self):
214
217
  return self.request_headers
215
218
 
@@ -268,13 +268,13 @@ class ExternalReference:
268
268
  id = kwargs.get("id", None)
269
269
  file_name = kwargs.get("file_name", None)
270
270
  data = kwargs.get("data", None)
271
- version = kwargs.get("version")
271
+ version = kwargs.get("version", None)
272
272
  mime_type = kwargs.get("mime_type", "text/plain")
273
273
  no_trigger_import = kwargs.get("no_trigger_import", False)
274
274
  if id is not None and file_name is not None:
275
275
  final_file_name = os.path.basename(file_name)
276
276
  query = """
277
- mutation ExternalReferenceEdit($id: ID!, $file: Upload!, $version: String, $noTriggerImport: Boolean) {
277
+ mutation ExternalReferenceEdit($id: ID!, $file: Upload!, $version: DateTime, $noTriggerImport: Boolean) {
278
278
  externalReferenceEdit(id: $id) {
279
279
  importPush(file: $file, version: $version, noTriggerImport: $noTriggerImport) {
280
280
  id
@@ -764,13 +764,13 @@ class StixCyberObservable:
764
764
  id = kwargs.get("id", None)
765
765
  file_name = kwargs.get("file_name", None)
766
766
  data = kwargs.get("data", None)
767
- version = kwargs.get("version")
767
+ version = kwargs.get("version", None)
768
768
  mime_type = kwargs.get("mime_type", "text/plain")
769
769
  no_trigger_import = kwargs.get("no_trigger_import", False)
770
770
  if id is not None and file_name is not None:
771
771
  final_file_name = os.path.basename(file_name)
772
772
  query = """
773
- mutation StixCyberObservableEdit($id: ID!, $file: Upload!, $version: String, $noTriggerImport: Boolean) {
773
+ mutation StixCyberObservableEdit($id: ID!, $file: Upload!, $version: DateTime, $noTriggerImport: Boolean) {
774
774
  stixCyberObservableEdit(id: $id) {
775
775
  importPush(file: $file, version: $version, noTriggerImport: $noTriggerImport) {
776
776
  id
@@ -1280,13 +1280,13 @@ class StixDomainObject:
1280
1280
  id = kwargs.get("id", None)
1281
1281
  file_name = kwargs.get("file_name", None)
1282
1282
  data = kwargs.get("data", None)
1283
- version = kwargs.get("version")
1283
+ version = kwargs.get("version", None)
1284
1284
  mime_type = kwargs.get("mime_type", "text/plain")
1285
1285
  no_trigger_import = kwargs.get("no_trigger_import", False)
1286
1286
  if id is not None and file_name is not None:
1287
1287
  final_file_name = os.path.basename(file_name)
1288
1288
  query = """
1289
- mutation StixDomainObjectEdit($id: ID!, $file: Upload!, $version: String, $noTriggerImport: Boolean) {
1289
+ mutation StixDomainObjectEdit($id: ID!, $file: Upload!, $version: DateTime, $noTriggerImport: Boolean) {
1290
1290
  stixDomainObjectEdit(id: $id) {
1291
1291
  importPush(file: $file, version: $version, noTriggerImport: $noTriggerImport) {
1292
1292
  id
@@ -557,7 +557,7 @@ class OpenCTIStix2:
557
557
  self.opencti.external_reference.add_file(
558
558
  id=external_reference_id,
559
559
  file_name=file["name"],
560
- version=file["version"],
560
+ version=file.get("version", None),
561
561
  data=base64.b64decode(file["data"]),
562
562
  mime_type=file["mime_type"],
563
563
  no_trigger_import=file.get("no_trigger_import", False),
@@ -574,7 +574,7 @@ class OpenCTIStix2:
574
574
  self.opencti.external_reference.add_file(
575
575
  id=external_reference_id,
576
576
  file_name=file["name"],
577
- version=file["version"],
577
+ version=file.get("version", None),
578
578
  data=base64.b64decode(file["data"]),
579
579
  mime_type=file["mime_type"],
580
580
  no_trigger_import=file.get("no_trigger_import", False),
@@ -725,7 +725,7 @@ class OpenCTIStix2:
725
725
  self.opencti.external_reference.add_file(
726
726
  id=external_reference_id,
727
727
  file_name=file["name"],
728
- version=file["version"],
728
+ version=file.get("version", None),
729
729
  data=base64.b64decode(file["data"]),
730
730
  mime_type=file["mime_type"],
731
731
  no_trigger_import=file.get("no_trigger_import", False),
@@ -740,7 +740,7 @@ class OpenCTIStix2:
740
740
  self.opencti.external_reference.add_file(
741
741
  id=external_reference_id,
742
742
  file_name=file["name"],
743
- version=file["version"],
743
+ version=file.get("version", None),
744
744
  data=base64.b64decode(file["data"]),
745
745
  mime_type=file["mime_type"],
746
746
  no_trigger_import=file.get("no_trigger_import", False),
@@ -951,7 +951,7 @@ class OpenCTIStix2:
951
951
  self.opencti.stix_domain_object.add_file(
952
952
  id=stix_object_result["id"],
953
953
  file_name=file["name"],
954
- version=file["version"],
954
+ version=file.get("version", None),
955
955
  data=base64.b64decode(file["data"]),
956
956
  mime_type=file["mime_type"],
957
957
  no_trigger_import=file.get("no_trigger_import", False),
@@ -966,7 +966,7 @@ class OpenCTIStix2:
966
966
  self.opencti.stix_domain_object.add_file(
967
967
  id=stix_object_result["id"],
968
968
  file_name=file["name"],
969
- version=file["version"],
969
+ version=file.get("version", None),
970
970
  data=base64.b64decode(file["data"]),
971
971
  mime_type=file["mime_type"],
972
972
  no_trigger_import=file.get("no_trigger_import", False),
@@ -1074,7 +1074,7 @@ class OpenCTIStix2:
1074
1074
  self.opencti.stix_cyber_observable.add_file(
1075
1075
  id=stix_observable_result["id"],
1076
1076
  file_name=file["name"],
1077
- version=file["version"],
1077
+ version=file.get("version", None),
1078
1078
  data=base64.b64decode(file["data"]),
1079
1079
  mime_type=file["mime_type"],
1080
1080
  no_trigger_import=file.get("no_trigger_import", False),
@@ -1089,7 +1089,7 @@ class OpenCTIStix2:
1089
1089
  self.opencti.stix_cyber_observable.add_file(
1090
1090
  id=stix_observable_result["id"],
1091
1091
  file_name=file["name"],
1092
- version=file["version"],
1092
+ version=file.get("version", None),
1093
1093
  data=base64.b64decode(file["data"]),
1094
1094
  mime_type=file["mime_type"],
1095
1095
  no_trigger_import=file.get("no_trigger_import", False),
@@ -1539,7 +1539,7 @@ class OpenCTIStix2:
1539
1539
  "name": file["name"],
1540
1540
  "data": data,
1541
1541
  "mime_type": file["metaData"]["mimetype"],
1542
- "version": file["metaData"]["version"],
1542
+ "version": file["metaData"].get("version", None),
1543
1543
  }
1544
1544
  )
1545
1545
  entity["external_references"].append(external_reference)
@@ -1826,7 +1826,7 @@ class OpenCTIStix2:
1826
1826
  "name": file["name"],
1827
1827
  "data": data,
1828
1828
  "mime_type": file["metaData"]["mimetype"],
1829
- "version": file["metaData"]["version"],
1829
+ "version": file["metaData"].get("version", None),
1830
1830
  }
1831
1831
  )
1832
1832
  del entity["importFiles"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycti
3
- Version: 6.0.2
3
+ Version: 6.0.4
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -1,6 +1,6 @@
1
- pycti/__init__.py,sha256=kJskiy15sEPIOMD7n16l6hFJwlWfXttQosnK7Q5xuto,4691
1
+ pycti/__init__.py,sha256=XiDcU3tfngNzx4T0018HGu9XPfGIn1qZwOwYtLd4ZG0,4691
2
2
  pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pycti/api/opencti_api_client.py,sha256=Kydofv47L-YyNHhRjx2e_E6nn0vI-5Pb7WZjH9hb-YM,28846
3
+ pycti/api/opencti_api_client.py,sha256=Jhzsl17JL78IphkbkM1ujLP4Pa8PfIGtUNkEcNRjHxM,28980
4
4
  pycti/api/opencti_api_connector.py,sha256=fYF0Jy9KIMFNt1RC_A1rpWomVJ-oj5HiSsBem4W0J5U,3549
5
5
  pycti/api/opencti_api_playbook.py,sha256=Wcf-G__IHmR7LwtUFVUVx4Skg9e2mcb89n_HyfWC9YM,1383
6
6
  pycti/api/opencti_api_work.py,sha256=ow30gswv4k5zLlZGlvLAn47ZM07RLsYvEV-KwtwedQg,7109
@@ -19,7 +19,7 @@ pycti/entities/opencti_course_of_action.py,sha256=hHjMj8V7Shx275bdvXWAomzsGOz8mu
19
19
  pycti/entities/opencti_data_component.py,sha256=sysuoh_blUlP1ZKzD6VqHkWZW09-gWVl1Wh8y9vG9Uc,18582
20
20
  pycti/entities/opencti_data_source.py,sha256=YXhwvacEZCkHBUkW3eRaCwcGRKw1ZRgAjL4C1o-gbKU,17470
21
21
  pycti/entities/opencti_event.py,sha256=Pam3eeR_Ytl_the-kV9IxXcfJKs2vRqN61igyDAlVE4,16706
22
- pycti/entities/opencti_external_reference.py,sha256=IMyPTDjIygmxaMjE7rTHBjUwchmYtI7Jwss3TGcHdKY,13208
22
+ pycti/entities/opencti_external_reference.py,sha256=9Vz6ZIaE6im1f5hoEqizq5E31DQ7oFuqlXb-9JGy3Ao,13216
23
23
  pycti/entities/opencti_feedback.py,sha256=cWfrMkIz_hj34ndVvty5YhDvuIDqmazgFVIGPtX7Zao,31738
24
24
  pycti/entities/opencti_grouping.py,sha256=ESHKhmziy3pCNwPRKYStZi5p-TBE_u2D5j-v-4isYhQ,29320
25
25
  pycti/entities/opencti_identity.py,sha256=YKTQugOSwyxSoMRWSdMWZkagidTbYQzi-Q1aEWO1a_8,22879
@@ -42,8 +42,8 @@ pycti/entities/opencti_report.py,sha256=tSMSCsAGgZny94EjFtidEws7Uf0gBI-nPHwkqPg2
42
42
  pycti/entities/opencti_stix.py,sha256=uMheSg8i1f2Ozx2Mk0iShWzHHjj6MMWDtV5nDjVxKEE,2275
43
43
  pycti/entities/opencti_stix_core_object.py,sha256=QRiAk5_loi4JLJN4aXSq8DTwFFzOLhbA7Y-2R3aO8kw,48728
44
44
  pycti/entities/opencti_stix_core_relationship.py,sha256=cD825areOn2quv06M28YGE7A3bTQ8_Pxx1QW6JyoQBs,42895
45
- pycti/entities/opencti_stix_cyber_observable.py,sha256=nIBRwRzRyQ8pMUfMW7lsqPrqfmMFltWr6aRCeB9M5rc,104708
46
- pycti/entities/opencti_stix_domain_object.py,sha256=f8h0Mw0hje4W-3_wBBxhfSpqAibjr7y5usbTBJAs9_A,78735
45
+ pycti/entities/opencti_stix_cyber_observable.py,sha256=GzxaI3q28FURIPQFa6WapiPG90mNCR0zDlTar2UgEcE,104716
46
+ pycti/entities/opencti_stix_domain_object.py,sha256=xjU7-ew7nPbAf3U0uHC8TtC4n9leoMRklOHOUGIkdZk,78743
47
47
  pycti/entities/opencti_stix_nested_ref_relationship.py,sha256=2r1i7cUl-WWictlnC_MJrm9sTIt_yJe2uqTpQm-yo6o,12330
48
48
  pycti/entities/opencti_stix_object_or_stix_relationship.py,sha256=NOJdUU9cm_gMBne13EZPb8cfxOhTfgVVmv8A0yasQeI,14610
49
49
  pycti/entities/opencti_stix_sighting_relationship.py,sha256=AmX1LBS8cW5a_dlik_sx-nBDvUcqb193gs4m3pB9C5U,27584
@@ -57,12 +57,12 @@ pycti/entities/opencti_vulnerability.py,sha256=dzJ0fZB2XrkPwT-cANr6atzYOWXF5nk0a
57
57
  pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  pycti/utils/constants.py,sha256=mAAeNGXyHU89yp8lihXBKF9fKncQCKwyxD2PVz5D2wI,7915
59
59
  pycti/utils/opencti_logger.py,sha256=0dvB75V0SuPFGxL539dAQrxTt1N5Acx0A3Ogwl5WMJ8,2199
60
- pycti/utils/opencti_stix2.py,sha256=t54-0w0NvhJ-mG-kN5IANpBiE6YZCPjz2Y1puTqk5TI,110632
60
+ pycti/utils/opencti_stix2.py,sha256=iZXHqxXC4yklLBJ4t5alAG7Mw1ddp058eDQM2Ztn_HU,110732
61
61
  pycti/utils/opencti_stix2_splitter.py,sha256=Ht9Mp-W3gbwxIKEr7i_5NYpcDr3TA2gYdC4TzOz0G4c,4496
62
62
  pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
63
63
  pycti/utils/opencti_stix2_utils.py,sha256=_ijIz6SRP2OeIaWJcXJt8go510MUEGfWE3KY-I_9QZc,3725
64
- pycti-6.0.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
- pycti-6.0.2.dist-info/METADATA,sha256=A7VGsth93ozwjJN-FFpxDxQ7TvIbbKgsyeJf0bVLUys,5398
66
- pycti-6.0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
67
- pycti-6.0.2.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
68
- pycti-6.0.2.dist-info/RECORD,,
64
+ pycti-6.0.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
+ pycti-6.0.4.dist-info/METADATA,sha256=-ZAxUtZ7MzSXCvVNDpMSjnQ4mKexU0Y-e4UaMgkhMt4,5398
66
+ pycti-6.0.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
67
+ pycti-6.0.4.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
68
+ pycti-6.0.4.dist-info/RECORD,,
File without changes
File without changes