splunk-soar-sdk 1.5.0__py3-none-any.whl → 1.5.1__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.
- soar_sdk/actions_manager.py +2 -4
- soar_sdk/app_cli_runner.py +3 -8
- soar_sdk/params.py +0 -2
- soar_sdk/shims/phantom/action_result.py +3 -0
- soar_sdk/views/template_filters.py +5 -2
- {splunk_soar_sdk-1.5.0.dist-info → splunk_soar_sdk-1.5.1.dist-info}/METADATA +1 -1
- {splunk_soar_sdk-1.5.0.dist-info → splunk_soar_sdk-1.5.1.dist-info}/RECORD +10 -10
- {splunk_soar_sdk-1.5.0.dist-info → splunk_soar_sdk-1.5.1.dist-info}/WHEEL +0 -0
- {splunk_soar_sdk-1.5.0.dist-info → splunk_soar_sdk-1.5.1.dist-info}/entry_points.txt +0 -0
- {splunk_soar_sdk-1.5.0.dist-info → splunk_soar_sdk-1.5.1.dist-info}/licenses/LICENSE +0 -0
soar_sdk/actions_manager.py
CHANGED
|
@@ -84,11 +84,9 @@ class ActionsManager(BaseConnector):
|
|
|
84
84
|
if handler := self.get_action(action_id):
|
|
85
85
|
try:
|
|
86
86
|
params = handler.meta.parameters.parse_obj(param)
|
|
87
|
-
except (ValueError, ValidationError):
|
|
88
|
-
# FIXME: Consider adding more details to this error, but be aware
|
|
89
|
-
# of possible PIIs.
|
|
87
|
+
except (ValueError, ValidationError) as e:
|
|
90
88
|
self.save_progress(
|
|
91
|
-
"Validation Error - the params data for action could not be parsed"
|
|
89
|
+
f"Validation Error - the params data for action could not be parsed: {e!s}"
|
|
92
90
|
)
|
|
93
91
|
return
|
|
94
92
|
handler(params)
|
soar_sdk/app_cli_runner.py
CHANGED
|
@@ -257,20 +257,15 @@ class AppCliRunner:
|
|
|
257
257
|
)
|
|
258
258
|
print(f"Parsed webhook request: {args.webhook_request}")
|
|
259
259
|
|
|
260
|
-
def run(self) -> None:
|
|
260
|
+
def run(self, argv: Optional[list[str]] = None) -> None:
|
|
261
261
|
"""Run the app CLI."""
|
|
262
|
-
args = self.parse_args()
|
|
262
|
+
args = self.parse_args(argv=argv)
|
|
263
263
|
|
|
264
264
|
logger = PhantomLogger()
|
|
265
265
|
|
|
266
266
|
if input_data := getattr(args, "raw_input_data", None):
|
|
267
267
|
self.app.handle(input_data)
|
|
268
|
-
|
|
269
|
-
# yet, because the test will need to be rewritten. We shouldn't be posting our results
|
|
270
|
-
# into ActionResult.param...
|
|
271
|
-
for (
|
|
272
|
-
result
|
|
273
|
-
) in self.app.actions_manager.get_action_results(): # pragma: no cover
|
|
268
|
+
for result in self.app.actions_manager.get_action_results():
|
|
274
269
|
params_pretty = json.dumps(result.param, indent=2, ensure_ascii=False)
|
|
275
270
|
data_pretty = json.dumps(
|
|
276
271
|
result.get_data(), indent=2, ensure_ascii=False
|
soar_sdk/params.py
CHANGED
|
@@ -28,8 +28,6 @@ def Param(
|
|
|
28
28
|
Use this function to define the default value for an action parameter that requires
|
|
29
29
|
extra metadata for the manifest. This function is a thin wrapper around pydantic.Field.
|
|
30
30
|
|
|
31
|
-
:param order: The order key, starting at 0, allows the app
|
|
32
|
-
author to control the display order of the controls in the UI.
|
|
33
31
|
:param description: A short description of this parameter.
|
|
34
32
|
The description is shown in the user interface when running an action manually.
|
|
35
33
|
:param default: To set the default value of a variable in the UI, use this key.
|
|
@@ -10,7 +10,7 @@ import uuid
|
|
|
10
10
|
import humanize
|
|
11
11
|
import bleach # type: ignore[import-untyped]
|
|
12
12
|
from datetime import datetime, timedelta
|
|
13
|
-
from typing import Optional, Union
|
|
13
|
+
from typing import Optional, TypeVar, Union
|
|
14
14
|
from collections.abc import Iterable
|
|
15
15
|
from collections.abc import Iterator
|
|
16
16
|
from jinja2 import Environment
|
|
@@ -47,7 +47,10 @@ def sorteditems(dictionary: dict) -> list:
|
|
|
47
47
|
return sorted(dictionary.items())
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
T = TypeVar("T")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def batch(iterable: Iterable[T], count: int) -> Iterator[list[T]]:
|
|
51
54
|
"""Batch items into groups of specified count."""
|
|
52
55
|
result = []
|
|
53
56
|
for item in iterable:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splunk-soar-sdk
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.1
|
|
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,9 +1,9 @@
|
|
|
1
1
|
soar_sdk/__init__.py,sha256=RzAng-ARqpK01SY82lNy4uYJFVG0yW6Q3CccEqbToJ4,726
|
|
2
2
|
soar_sdk/abstract.py,sha256=ExsLCY99aoPRFHsUfw7yIVdWJeZjq1ahQCVwQmZyYh8,7798
|
|
3
3
|
soar_sdk/action_results.py,sha256=gAQwHjXbkkzOJTmQnLwBjKjwbuz8mSPyqIVcirVS598,10114
|
|
4
|
-
soar_sdk/actions_manager.py,sha256=
|
|
4
|
+
soar_sdk/actions_manager.py,sha256=wJCyfzkI_6OKZ-Kmll4vRJpGvYdL93Uw-JyEEGnKcw0,5779
|
|
5
5
|
soar_sdk/app.py,sha256=9zI8RM6uo4V0Bj4cgCvJzSOjIBPrvt2meXVAMaPhVrE,32882
|
|
6
|
-
soar_sdk/app_cli_runner.py,sha256=
|
|
6
|
+
soar_sdk/app_cli_runner.py,sha256=fJoozhyAt7QUMuc02nE5RL_InpsjQBpr6U4rF9sey3E,11627
|
|
7
7
|
soar_sdk/app_client.py,sha256=UVCMFYweaYcFk7WrtoVsCoprYZ7JlzMBR108ZQRV8SE,6051
|
|
8
8
|
soar_sdk/asset.py,sha256=deS8_B5hr7W2fED8_6wUpVriRgiQ5r8TkGVHiasIaro,10666
|
|
9
9
|
soar_sdk/async_utils.py,sha256=gND8ZiVTqDYLQ88Ua6SN1mInJaEcfa168eOaRoURt3E,1441
|
|
@@ -13,7 +13,7 @@ soar_sdk/crypto.py,sha256=qiBMHUQqgn5lPI1DbujSj700s89FuLJrkQgCO9_eBn4,392
|
|
|
13
13
|
soar_sdk/exceptions.py,sha256=CxJ_Q6N1jlknO_3ItDQNhHEw2pNWZr3sMLqutYmr5HA,1863
|
|
14
14
|
soar_sdk/input_spec.py,sha256=BAa36l8IKDvM8SVMjgZ1XcnWZ2F7O052n2415tLeKK8,4690
|
|
15
15
|
soar_sdk/logging.py,sha256=lSz8PA6hOCw2MHGE0ZSKbw-FzSr1WdbfQ7BHnXBUUY0,11440
|
|
16
|
-
soar_sdk/params.py,sha256=
|
|
16
|
+
soar_sdk/params.py,sha256=vUicPw6cdepEbwgg5A2DgIjSSUbhnlOXz_U1jxFH45Q,7491
|
|
17
17
|
soar_sdk/paths.py,sha256=XhpanQCAiTXaulRx440oKu36mnll7P05TethHXgMpgQ,239
|
|
18
18
|
soar_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
soar_sdk/types.py,sha256=uMFnNOHpmCLrbAhQOgmXjScXiGE67sM8ySN04MhkC3U,602
|
|
@@ -67,7 +67,7 @@ soar_sdk/models/artifact.py,sha256=MWEjMNxPVCCEyAin8NW646bm8xGDmc7NAJGLZFyKCSw,1
|
|
|
67
67
|
soar_sdk/models/container.py,sha256=TWdTB0Wy3CzOYmBOxCtEi2zn90N_lRDuor0MxkGBprA,1622
|
|
68
68
|
soar_sdk/models/vault_attachment.py,sha256=_ARh74nv6iD9nH0dN3uayUYA7O8wIIiIKW98w4FUVQc,1107
|
|
69
69
|
soar_sdk/models/view.py,sha256=fgPEdUNxu-Kbi4J0nOk16lkD0uof-PkxDumBcaQqKTE,832
|
|
70
|
-
soar_sdk/shims/phantom/action_result.py,sha256=
|
|
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
72
|
soar_sdk/shims/phantom/base_connector.py,sha256=s8sHCXX2LbnsSjfbzRm4UMsHRZNsx-jcvjIT80kye-I,4490
|
|
73
73
|
soar_sdk/shims/phantom/connector_result.py,sha256=T6eDXdMyblWB0Xa3RW4ojuhy9wJmWZTpY8Oojl5sYYk,641
|
|
@@ -88,7 +88,7 @@ soar_sdk/templates/widgets/widget_resize_snippet.html,sha256=nGAXhYLlnyrEtdDqSjz
|
|
|
88
88
|
soar_sdk/templates/widgets/widget_template.html,sha256=aQTVtU-96QLwRyA2yYskJeq4a2otqlDa6V0EamHBDEY,3751
|
|
89
89
|
soar_sdk/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
90
|
soar_sdk/views/component_registry.py,sha256=cN2F2XHGSR5Ddv6hihloCe0_4MD83BMpdNPod7nbu3A,119
|
|
91
|
-
soar_sdk/views/template_filters.py,sha256=
|
|
91
|
+
soar_sdk/views/template_filters.py,sha256=8GEl2ghmsZOkhJhLmjDL8JrPO-M5ZkWavi7ywqr6YUA,5453
|
|
92
92
|
soar_sdk/views/template_renderer.py,sha256=t1elD9Y7wn4k7W4RBE1Mt6gaqXMGAo68c5KUYxl-UNs,5402
|
|
93
93
|
soar_sdk/views/view_parser.py,sha256=IlRr_d_Ol4VjovKv7drmHPNXutJi_khfNtY1E05l8n4,3956
|
|
94
94
|
soar_sdk/views/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -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-1.5.
|
|
100
|
-
splunk_soar_sdk-1.5.
|
|
101
|
-
splunk_soar_sdk-1.5.
|
|
102
|
-
splunk_soar_sdk-1.5.
|
|
103
|
-
splunk_soar_sdk-1.5.
|
|
99
|
+
splunk_soar_sdk-1.5.1.dist-info/METADATA,sha256=_gOg3kisT5fgH-hw-QwB2xbX5SbaiC_VmZzX-4l2tyM,7355
|
|
100
|
+
splunk_soar_sdk-1.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
101
|
+
splunk_soar_sdk-1.5.1.dist-info/entry_points.txt,sha256=CgBjo2ZWpYNkt9TgvToL26h2Tg1yt8FbvYTb5NVgNuc,51
|
|
102
|
+
splunk_soar_sdk-1.5.1.dist-info/licenses/LICENSE,sha256=gNCGrGhrSQb1PUzBOByVUN1tvaliwLZfna-QU2r2hQ8,11345
|
|
103
|
+
splunk_soar_sdk-1.5.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|