splunk-soar-sdk 2.3.5__py3-none-any.whl → 2.3.7__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.
@@ -1,5 +1,7 @@
1
1
  from typing import Optional, Any
2
+ import os
2
3
 
4
+ from soar_sdk.compat import remove_when_soar_newer_than
3
5
  from soar_sdk.input_spec import InputSpecification
4
6
  from soar_sdk.shims.phantom.base_connector import BaseConnector
5
7
 
@@ -7,6 +9,7 @@ from soar_sdk.meta.actions import ActionMeta
7
9
  from soar_sdk.types import Action
8
10
  from pydantic import ValidationError
9
11
  from soar_sdk.shims.phantom.action_result import ActionResult as PhantomActionResult
12
+ from soar_sdk.shims.phantom.install_info import is_onprem_broker_install
10
13
  from soar_sdk.logging import getLogger
11
14
 
12
15
 
@@ -139,6 +142,20 @@ class ActionsManager(BaseConnector):
139
142
  """Public method for setting the CSRF token in connector."""
140
143
  self._set_csrf_info(token, referer)
141
144
 
145
+ def get_app_dir(self) -> str:
146
+ """Override get_app_dir to fix path issue on automation brokers < 7.1.0.
147
+
148
+ Returns APP_HOME directly on brokers, which contains the correct SDK app path.
149
+ """
150
+ # Remove when 7.1.0 is the min supported broker version
151
+ remove_when_soar_newer_than("7.1.1")
152
+ # On AB, APP_HOME is set by spawn to the full app path at runtime
153
+ if is_onprem_broker_install():
154
+ return os.getenv("APP_HOME", "")
155
+
156
+ # For non-broker just proceed as we did before
157
+ return super().get_app_dir()
158
+
142
159
  @classmethod
143
160
  def get_soar_base_url(cls) -> str:
144
161
  """Get the base URL of the Splunk SOAR instance this app is running on."""
@@ -5,8 +5,11 @@ try:
5
5
  except ImportError:
6
6
  _soar_is_available = False
7
7
 
8
+ from pathlib import Path
8
9
  from typing import TYPE_CHECKING
9
10
 
11
+ from soar_sdk.compat import remove_when_soar_newer_than
12
+
10
13
  if TYPE_CHECKING or not _soar_is_available:
11
14
  import json
12
15
  import abc
@@ -132,5 +135,10 @@ if TYPE_CHECKING or not _soar_is_available:
132
135
  def initialize(self) -> bool:
133
136
  return True
134
137
 
138
+ def get_app_dir(self) -> str:
139
+ # Remove when 7.1.0 is the min supported broker version
140
+ remove_when_soar_newer_than("7.1.1")
141
+ return Path.cwd().as_posix()
142
+
135
143
 
136
144
  __all__ = ["BaseConnector"]
@@ -1,5 +1,9 @@
1
1
  try:
2
- from phantom_common.install_info import get_verify_ssl_setting, get_product_version
2
+ from phantom_common.install_info import (
3
+ get_verify_ssl_setting,
4
+ get_product_version,
5
+ is_onprem_broker_install,
6
+ )
3
7
 
4
8
  _soar_is_available = True
5
9
  except ImportError:
@@ -17,6 +21,10 @@ if TYPE_CHECKING or not _soar_is_available:
17
21
  """Mock function to simulate the behavior of get_product_version."""
18
22
  return "6.4.1"
19
23
 
24
+ def is_onprem_broker_install() -> bool:
25
+ """Mock function to simulate the behavior of is_onprem_broker_install."""
26
+ return False
27
+
20
28
 
21
29
  def is_soar_available() -> bool:
22
30
  """
@@ -25,4 +33,9 @@ def is_soar_available() -> bool:
25
33
  return _soar_is_available
26
34
 
27
35
 
28
- __all__ = ["get_product_version", "get_verify_ssl_setting", "is_soar_available"]
36
+ __all__ = [
37
+ "get_product_version",
38
+ "get_verify_ssl_setting",
39
+ "is_onprem_broker_install",
40
+ "is_soar_available",
41
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splunk-soar-sdk
3
- Version: 2.3.5
3
+ Version: 2.3.7
4
4
  Summary: The official framework for developing and testing Splunk SOAR Apps
5
5
  Project-URL: Homepage, https://github.com/phantomcyber/splunk-soar-sdk
6
6
  Project-URL: Documentation, https://github.com/phantomcyber/splunk-soar-sdk
@@ -1,7 +1,7 @@
1
1
  soar_sdk/__init__.py,sha256=RzAng-ARqpK01SY82lNy4uYJFVG0yW6Q3CccEqbToJ4,726
2
2
  soar_sdk/abstract.py,sha256=AU5ssJWytMp_RmYOxt_sKBqaFN63UfdMmzmAn0HQE_g,7940
3
3
  soar_sdk/action_results.py,sha256=NQTcQ3NJcYB6h-YNRqO0bCG_hILmTidv2D4FdvCzyDE,11092
4
- soar_sdk/actions_manager.py,sha256=wJCyfzkI_6OKZ-Kmll4vRJpGvYdL93Uw-JyEEGnKcw0,5779
4
+ soar_sdk/actions_manager.py,sha256=IoNWiUzY4N76C9xwkNsyteSG6kt6EiunQODRq4QNZmg,6494
5
5
  soar_sdk/app.py,sha256=WywDS9Eqy52u2lOQyuF6EfLHhLqCVjPTbFzIX06hiAs,33200
6
6
  soar_sdk/app_cli_runner.py,sha256=fJoozhyAt7QUMuc02nE5RL_InpsjQBpr6U4rF9sey3E,11627
7
7
  soar_sdk/app_client.py,sha256=GZmpenBl25-UQVVpELxWRJanmXBWNIQBRphcSAbnZlU,6253
@@ -69,11 +69,11 @@ soar_sdk/models/vault_attachment.py,sha256=_ARh74nv6iD9nH0dN3uayUYA7O8wIIiIKW98w
69
69
  soar_sdk/models/view.py,sha256=fgPEdUNxu-Kbi4J0nOk16lkD0uof-PkxDumBcaQqKTE,832
70
70
  soar_sdk/shims/phantom/action_result.py,sha256=jCZPljCcW5RMFA_Pp0OQ2Dg9c9c_PjDM9bm7Jj3wJrg,1635
71
71
  soar_sdk/shims/phantom/app.py,sha256=PpNj9FoXjyj6r5w9S2fpElKFS6EcBIqsnpaTSvnIzyI,303
72
- soar_sdk/shims/phantom/base_connector.py,sha256=s8sHCXX2LbnsSjfbzRm4UMsHRZNsx-jcvjIT80kye-I,4490
72
+ soar_sdk/shims/phantom/base_connector.py,sha256=6A98WNLoatuk96_CPuLXs6PrzB_kdk5_9J-6zmN7s0Q,4769
73
73
  soar_sdk/shims/phantom/connector_result.py,sha256=T6eDXdMyblWB0Xa3RW4ojuhy9wJmWZTpY8Oojl5sYYk,641
74
74
  soar_sdk/shims/phantom/consts.py,sha256=eq6AIuDhb2Z-CJORwv98D3JbcIOW8CC673zx5dNPFKU,404
75
75
  soar_sdk/shims/phantom/encryption_helper.py,sha256=kiZNwBMgrhvVtNjKVP7ZswEn4DXxH8gTC-9tuxjVzTc,1386
76
- soar_sdk/shims/phantom/install_info.py,sha256=DaU9heIZk-TmlqMubdzXM00ZMO_KqocVCz3UnY2_TvQ,740
76
+ soar_sdk/shims/phantom/install_info.py,sha256=hR3W8pKlNUVlE1jOwGT_o2f6uTGQknPG3GLRDHrGSUQ,994
77
77
  soar_sdk/shims/phantom/json_keys.py,sha256=QgDO5qGlcNNqJBsolJQs0UOW1sa8xMYIubqfCXeP4C4,528
78
78
  soar_sdk/shims/phantom/ph_ipc.py,sha256=hl2hOPUXS7CIOpdW2E-nZojvOy8RSfRp5XDU1Fgsaak,1397
79
79
  soar_sdk/shims/phantom/vault.py,sha256=JLNvUkhCtB_qUgI2tgnjl82xOJH--snZXJQBgH1JLOU,14257
@@ -96,8 +96,8 @@ soar_sdk/views/components/pie_chart.py,sha256=LVTeHVJN6nf2vjUs9y7PDBhS0U1fKW750l
96
96
  soar_sdk/webhooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  soar_sdk/webhooks/models.py,sha256=-rjuFA9cRX5zTLp7cHSHVTkt5eVJD6BdESGbj_qkyHI,4540
98
98
  soar_sdk/webhooks/routing.py,sha256=BKbURSrBPdOTS5UFL-mHzFEr-Fj04mJMx9KeiPrZ2VQ,6872
99
- splunk_soar_sdk-2.3.5.dist-info/METADATA,sha256=sgaCCpc7wMKW5h2Ii8WgOJF1wgVLB1P2MxKbvCKZ3Pg,7361
100
- splunk_soar_sdk-2.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
- splunk_soar_sdk-2.3.5.dist-info/entry_points.txt,sha256=CgBjo2ZWpYNkt9TgvToL26h2Tg1yt8FbvYTb5NVgNuc,51
102
- splunk_soar_sdk-2.3.5.dist-info/licenses/LICENSE,sha256=gNCGrGhrSQb1PUzBOByVUN1tvaliwLZfna-QU2r2hQ8,11345
103
- splunk_soar_sdk-2.3.5.dist-info/RECORD,,
99
+ splunk_soar_sdk-2.3.7.dist-info/METADATA,sha256=h4lVk3Go0IUwM8PvzUGOAw-LrZ9IurDsUCZNoXhHQmE,7361
100
+ splunk_soar_sdk-2.3.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
+ splunk_soar_sdk-2.3.7.dist-info/entry_points.txt,sha256=CgBjo2ZWpYNkt9TgvToL26h2Tg1yt8FbvYTb5NVgNuc,51
102
+ splunk_soar_sdk-2.3.7.dist-info/licenses/LICENSE,sha256=gNCGrGhrSQb1PUzBOByVUN1tvaliwLZfna-QU2r2hQ8,11345
103
+ splunk_soar_sdk-2.3.7.dist-info/RECORD,,