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

Commit 652d2eb

Browse files
committed
[client] Enhance default values for connector helper
1 parent 7663c22 commit 652d2eb

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -968,29 +968,24 @@ def __init__(self, config: Dict, playbook_compatible=False) -> None:
968968
"CONNECTOR_LIVE_STREAM_ID",
969969
["connector", "live_stream_id"],
970970
config,
971-
False,
972-
None,
973971
)
974972
self.connect_live_stream_listen_delete = get_config_variable(
975973
"CONNECTOR_LIVE_STREAM_LISTEN_DELETE",
976974
["connector", "live_stream_listen_delete"],
977975
config,
978-
False,
979-
True,
976+
default=True,
980977
)
981978
self.connect_live_stream_no_dependencies = get_config_variable(
982979
"CONNECTOR_LIVE_STREAM_NO_DEPENDENCIES",
983980
["connector", "live_stream_no_dependencies"],
984981
config,
985-
False,
986-
False,
982+
default=True,
987983
)
988984
self.connect_live_stream_with_inferences = get_config_variable(
989985
"CONNECTOR_LIVE_STREAM_WITH_INFERENCES",
990986
["connector", "live_stream_with_inferences"],
991987
config,
992-
False,
993-
False,
988+
default=False,
994989
)
995990
self.connect_live_stream_recover_iso_date = get_config_variable(
996991
"CONNECTOR_LIVE_STREAM_RECOVER_ISO_DATE",
@@ -1010,21 +1005,19 @@ def __init__(self, config: Dict, playbook_compatible=False) -> None:
10101005
"CONNECTOR_SCOPE", ["connector", "scope"], config
10111006
)
10121007
self.connect_auto = get_config_variable(
1013-
"CONNECTOR_AUTO", ["connector", "auto"], config, False, False
1008+
"CONNECTOR_AUTO", ["connector", "auto"], config, default=False
10141009
)
10151010
self.bundle_send_to_queue = get_config_variable(
10161011
"CONNECTOR_SEND_TO_QUEUE",
10171012
["connector", "send_to_queue"],
10181013
config,
1019-
False,
1020-
True,
1014+
default=True,
10211015
)
10221016
self.bundle_send_to_directory = get_config_variable(
10231017
"CONNECTOR_SEND_TO_DIRECTORY",
10241018
["connector", "send_to_directory"],
10251019
config,
1026-
False,
1027-
False,
1020+
default=False,
10281021
)
10291022
self.bundle_send_to_directory_path = get_config_variable(
10301023
"CONNECTOR_SEND_TO_DIRECTORY_PATH",
@@ -1035,15 +1028,14 @@ def __init__(self, config: Dict, playbook_compatible=False) -> None:
10351028
"CONNECTOR_SEND_TO_DIRECTORY_RETENTION",
10361029
["connector", "send_to_directory_retention"],
10371030
config,
1038-
True,
1039-
7,
1031+
isNumber=True,
1032+
default=7,
10401033
)
10411034
self.connect_only_contextual = get_config_variable(
10421035
"CONNECTOR_ONLY_CONTEXTUAL",
10431036
["connector", "only_contextual"],
10441037
config,
1045-
False,
1046-
False,
1038+
default=False,
10471039
)
10481040
self.log_level = get_config_variable(
10491041
"CONNECTOR_LOG_LEVEL", ["connector", "log_level"], config, default="INFO"
@@ -1052,27 +1044,28 @@ def __init__(self, config: Dict, playbook_compatible=False) -> None:
10521044
"CONNECTOR_RUN_AND_TERMINATE",
10531045
["connector", "run_and_terminate"],
10541046
config,
1055-
False,
1056-
False,
1047+
default=False,
10571048
)
10581049
self.connect_validate_before_import = get_config_variable(
10591050
"CONNECTOR_VALIDATE_BEFORE_IMPORT",
10601051
["connector", "validate_before_import"],
10611052
config,
1062-
False,
1063-
False,
1053+
default=False,
10641054
)
10651055
self.scheduler = sched.scheduler(time.time, time.sleep)
10661056
# Start up the server to expose the metrics.
10671057
expose_metrics = get_config_variable(
10681058
"CONNECTOR_EXPOSE_METRICS",
10691059
["connector", "expose_metrics"],
10701060
config,
1071-
False,
1072-
False,
1061+
default=False,
10731062
)
10741063
metrics_port = get_config_variable(
1075-
"CONNECTOR_METRICS_PORT", ["connector", "metrics_port"], config, True, 9095
1064+
"CONNECTOR_METRICS_PORT",
1065+
["connector", "metrics_port"],
1066+
config,
1067+
isNumber=True,
1068+
default=9095,
10761069
)
10771070
# Initialize ConnectorInfo instance
10781071
self.connector_info = ConnectorInfo()

0 commit comments

Comments
 (0)