splunk-soar-sdk 1.6.3__tar.gz → 2.0.0__tar.gz
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.
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/PKG-INFO +1 -1
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/api_reference.rst +6 -6
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/app_structure/src_app.rst +3 -3
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/pyproject.toml +40 -55
- splunk_soar_sdk-2.0.0/release_notes.txt +20 -0
- splunk_soar_sdk-2.0.0/release_version.txt +1 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/action_results.py +3 -16
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app.py +14 -19
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/manifests/serializers.py +1 -9
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/decorators/__init__.py +2 -2
- splunk_soar_sdk-1.6.3/src/soar_sdk/decorators/generic_action.py → splunk_soar_sdk-2.0.0/src/soar_sdk/decorators/make_request.py +20 -20
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/params.py +2 -2
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_serializers.py +0 -16
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/app.json +4 -4
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/app.py +7 -5
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_actions_manager.py +1 -23
- splunk_soar_sdk-2.0.0/tests/test_make_request_action.py +173 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/uv.lock +1 -1
- splunk_soar_sdk-1.6.3/release_notes.txt +0 -21
- splunk_soar_sdk-1.6.3/release_version.txt +0 -1
- splunk_soar_sdk-1.6.3/tests/test_generic_action.py +0 -173
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/ISSUE_TEMPLATE/bug.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/pull_request_template.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/utils/github.js +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/utils/update_version.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/workflows/code_quality.yml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/workflows/commit_hygiene.yml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/workflows/generate_docs.yml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.github/workflows/semantic_release.yml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.gitignore +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.pre-commit-config.yaml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/.releaserc +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/LICENSE +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/README.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/commitlint.config.js +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/app_structure/index.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/app_structure/pre-commit-config.yaml.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/app_structure/pyproject.toml.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/changelog.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/cli_reference.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/conf.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/custom_views/index.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/custom_views/reusable_components.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/custom_views/templates.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/custom_views/view_handlers.md +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/getting_started/defining_asset.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/getting_started/first_action.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/getting_started/index.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/getting_started/init_app.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/getting_started/installation.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/getting_started/testing_and_building.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/docs/index.rst +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/abstract.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/actions_manager.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/apis/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/apis/artifact.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/apis/container.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/apis/utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/apis/vault.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_cli_runner.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_client.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_templates/basic_app/.gitignore +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_templates/basic_app/.pre-commit-config.yaml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_templates/basic_app/logo.svg +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_templates/basic_app/logo_dark.svg +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_templates/basic_app/src/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/app_templates/basic_app/uv.lock +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/asset.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/async_utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/init/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/init/cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/manifests/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/manifests/cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/manifests/deserializers.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/manifests/processors.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/package/cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/package/utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/path_utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/cli/utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/action_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/app_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/asset_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/templates/pyproject.toml.jinja +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/code_renderers/toml_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/colors.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/compat.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/crypto.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/decorators/action.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/decorators/on_poll.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/decorators/test_connectivity.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/decorators/view_handler.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/decorators/webhook.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/exceptions.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/input_spec.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/logging.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/actions.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/adapters.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/app.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/datatypes.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/dependencies.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/meta/webhooks.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/models/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/models/artifact.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/models/container.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/models/vault_attachment.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/models/view.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/paths.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/py.typed +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/action_result.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/app.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/base_connector.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/connector_result.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/consts.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/encryption_helper.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/install_info.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/json_keys.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/ph_ipc.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom/vault.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom_common/app_interface/app_interface.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/shims/phantom_common/encryption/encryption_manager_factory.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/base/base_template.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/base/error.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/base/header.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/base/logo_header.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/components/pie_chart.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/widgets/widget_resize_snippet.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/templates/widgets/widget_template.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/types.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/component_registry.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/components/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/components/pie_chart.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/template_filters.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/template_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/views/view_parser.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/webhooks/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/webhooks/models.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/src/soar_sdk/webhooks/routing.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/test.png +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/test.txt +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/datapath_parse.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/manifests/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/manifests/test_processors.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_assets/converted_app/actions.py.txt +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_convert_cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_deserializers.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_init_cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_manifests_cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_package_cli.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/cli/test_utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/code_renderers/test_action_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/conftest.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/example_asset.json +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/logo.svg +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/logo_dark.svg +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/pyproject.toml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/actions/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/actions/async_action.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/actions/generate_category.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/actions/reverse_string.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/src/ignoreme.txt +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/templates/reverse_string.html +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app/uv.lock +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/app.json +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/logo.svg +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/logo_dark.svg +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/pyproject.toml +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/src/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/src/app.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/example_app_with_webhook/uv.lock +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/interfaces/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/interfaces/test_artifact_interface.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/interfaces/test_container_interface.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/interfaces/test_vault_interface.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/meta/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/meta/test_actions.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/meta/test_adapters.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/meta/test_datatypes.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/meta/test_dependencies.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/meta/test_webhooks.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/mocks/__init__.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/mocks/dynamic_mocks.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/mocks/importable_action.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/stubs.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_action_results.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_app.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_app_action.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_app_action_params.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_app_action_results.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_app_client.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_app_runner.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_asset.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_assets/splunk-sdk-2.1.0.tar.gz +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_async_integration.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_async_utils.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_code_renderers.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_compat.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_container.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_custom_views.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_encryption.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_logging.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_on_poll.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_params.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_template_filters.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_template_renderer.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_test_connectivity.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/test_view_parser.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/webhooks/test_models.py +0 -0
- {splunk_soar_sdk-1.6.3 → splunk_soar_sdk-2.0.0}/tests/webhooks/test_routing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splunk-soar-sdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
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
|
|
@@ -114,11 +114,11 @@ On poll functions require a specific parameter class called `OnPollParams`. YYou
|
|
|
114
114
|
|
|
115
115
|
.. autoclass:: soar_sdk.params.OnPollParams
|
|
116
116
|
|
|
117
|
-
Parameters for the
|
|
117
|
+
Parameters for the Make Request Action
|
|
118
118
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
119
|
-
|
|
119
|
+
Make Request action functions require a specific parameter class called :class:`~soar_sdk.params.MakeRequestParams`. You should use this class as-is, instead of overriding it.
|
|
120
120
|
|
|
121
|
-
.. autoclass:: soar_sdk.params.
|
|
121
|
+
.. autoclass:: soar_sdk.params.MakeRequestParams
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
.. _action-output-label:
|
|
@@ -183,11 +183,11 @@ Defining Action Outputs
|
|
|
183
183
|
|
|
184
184
|
.. autofunction:: soar_sdk.action_results.OutputField
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
Make Request Action Output
|
|
187
187
|
^^^^^^^^^^^^^^^^^^^^^
|
|
188
|
-
For
|
|
188
|
+
For ``make request`` functions, we have provided a convenience class called :class:`~soar_sdk.action_results.MakeRequestOutput`. This class extends the :class:`~soar_sdk.action_results.ActionOutput` class and adds a ``status_code`` and ``response_body`` field. You can use this class to return the response from the ``make request`` action.
|
|
189
189
|
|
|
190
|
-
.. autoclass:: soar_sdk.action_results.
|
|
190
|
+
.. autoclass:: soar_sdk.action_results.MakeRequestOutput
|
|
191
191
|
|
|
192
192
|
.. _soar-client-label:
|
|
193
193
|
|
|
@@ -205,16 +205,16 @@ A successful ``test connectivity`` action should return ``None``, and a failure
|
|
|
205
205
|
|
|
206
206
|
``on poll`` is another special action that apps may choose to implement. This action always takes an :class:`~soar_sdk.params.OnPollParams` instance as its parameter. If defined, this action will be called in order to ingest new data into the Splunk Splunk SOAR platform. The action should yield :class:`~soar_sdk.models.container.Container` and/or :class:`~soar_sdk.models.artifact.Artifact` instances representing the new data to be ingested. The SDK will handle actually creating the containers and artifacts in the platform.
|
|
207
207
|
|
|
208
|
-
|
|
208
|
+
Make Request Action
|
|
209
209
|
^^^^^^^^^^^^^^
|
|
210
210
|
|
|
211
211
|
.. literalinclude:: ../../tests/example_app/src/app.py
|
|
212
|
-
:caption:
|
|
212
|
+
:caption: Make request action definition
|
|
213
213
|
:language: python
|
|
214
214
|
:lineno-match:
|
|
215
215
|
:pyobject: http_action
|
|
216
216
|
|
|
217
|
-
Apps may define a special "
|
|
217
|
+
Apps may define a special "make request" action, which can be used to interact with the underlying external service's REST API directly. Having this action available can be useful when there are parts of the REST API that don't have dedicated actions implemented in the app.
|
|
218
218
|
|
|
219
219
|
We create an action by decorating a function with the ``app.action`` decorator. The default ``action_type``
|
|
220
220
|
is ``generic``, so usually you will not have to provide this argument for the decorator. This is not the
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "splunk-soar-sdk"
|
|
3
|
-
version = "
|
|
3
|
+
version = "2.0.0"
|
|
4
4
|
description = "The official framework for developing and testing Splunk SOAR Apps"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.9, <3.14"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
|
-
keywords = [
|
|
10
|
-
"cisco",
|
|
11
|
-
"splunk",
|
|
12
|
-
"soar",
|
|
13
|
-
"phantom",
|
|
14
|
-
"app",
|
|
15
|
-
"connector",
|
|
16
|
-
"sdk",
|
|
17
|
-
]
|
|
9
|
+
keywords = ["cisco", "splunk", "soar", "phantom", "app", "connector", "sdk"]
|
|
18
10
|
|
|
19
11
|
authors = [
|
|
20
12
|
{ name = "Jacob Davis", email = "jacobd@splunk.com" },
|
|
@@ -23,7 +15,7 @@ authors = [
|
|
|
23
15
|
{ name = "Michael Nordby", email = "mnordby@splunk.com" },
|
|
24
16
|
{ name = "Scott Odle", email = "sodle@splunk.com" },
|
|
25
17
|
{ name = "Michał Posłuszny", email = "mposluszny@splunk.com" },
|
|
26
|
-
{ name = "Ian Rokas", email = "grokas@splunk.com" }
|
|
18
|
+
{ name = "Ian Rokas", email = "grokas@splunk.com" },
|
|
27
19
|
]
|
|
28
20
|
classifiers = [
|
|
29
21
|
"Development Status :: 5 - Production/Stable",
|
|
@@ -130,26 +122,22 @@ addopts = "--ignore=src/soar_sdk/app_templates --ignore=app_templates --cov-fail
|
|
|
130
122
|
|
|
131
123
|
[tool.coverage.run]
|
|
132
124
|
branch = true
|
|
133
|
-
concurrency = [
|
|
134
|
-
|
|
135
|
-
]
|
|
136
|
-
source = [
|
|
137
|
-
"src/soar_sdk"
|
|
138
|
-
]
|
|
125
|
+
concurrency = ["multiprocessing"]
|
|
126
|
+
source = ["src/soar_sdk"]
|
|
139
127
|
omit = [
|
|
140
|
-
"src/soar_sdk/shims/*",
|
|
141
|
-
"src/soar_sdk/code_renderers/templates/*"
|
|
128
|
+
"src/soar_sdk/shims/*", # shims for BaseConnector, should not need testing
|
|
129
|
+
"src/soar_sdk/code_renderers/templates/*", # jinja templates, not code
|
|
142
130
|
]
|
|
143
131
|
|
|
144
132
|
[tool.coverage.report]
|
|
145
133
|
show_missing = true
|
|
146
134
|
exclude_lines = [
|
|
147
135
|
'# pragma: no cover',
|
|
148
|
-
'if (typing\.)?TYPE_CHECKING:',
|
|
149
|
-
'if __name__ == "__main__":',
|
|
150
|
-
'raise NotImplementedError',
|
|
151
|
-
'^ *(pass|\.\.\.)( *#.+)?$',
|
|
152
|
-
'^ *def .+: \.\.\.( *#.+)?$',
|
|
136
|
+
'if (typing\.)?TYPE_CHECKING:', # ignore type checking blocks
|
|
137
|
+
'if __name__ == "__main__":', # ignore main blocks
|
|
138
|
+
'raise NotImplementedError', # ignore NotImplementedError
|
|
139
|
+
'^ *(pass|\.\.\.)( *#.+)?$', # ignore pass and ...
|
|
140
|
+
'^ *def .+: \.\.\.( *#.+)?$', # ignore def f(): ...
|
|
153
141
|
]
|
|
154
142
|
|
|
155
143
|
|
|
@@ -160,32 +148,32 @@ target-version = "py39"
|
|
|
160
148
|
|
|
161
149
|
[tool.ruff.lint]
|
|
162
150
|
select = [
|
|
163
|
-
"ERA",
|
|
164
|
-
"YTT",
|
|
165
|
-
"ANN",
|
|
166
|
-
"S",
|
|
167
|
-
"B",
|
|
168
|
-
"A",
|
|
169
|
-
"DTZ",
|
|
170
|
-
"T10",
|
|
171
|
-
"ISC",
|
|
172
|
-
"PT",
|
|
173
|
-
"SIM",
|
|
174
|
-
"PTH",
|
|
175
|
-
"E",
|
|
176
|
-
"F",
|
|
177
|
-
"W",
|
|
178
|
-
"PL",
|
|
179
|
-
"UP",
|
|
180
|
-
"RUF",
|
|
151
|
+
"ERA", # commented out code
|
|
152
|
+
"YTT", # bad use of sys.version_info
|
|
153
|
+
"ANN", # type annotations
|
|
154
|
+
"S", # security issues
|
|
155
|
+
"B", # bugbear
|
|
156
|
+
"A", # builtins
|
|
157
|
+
"DTZ", # datetime footguns
|
|
158
|
+
"T10", # breakpoints
|
|
159
|
+
"ISC", # implicit string concatenation
|
|
160
|
+
"PT", # pytest style
|
|
161
|
+
"SIM", # simplify
|
|
162
|
+
"PTH", # use pathlib
|
|
163
|
+
"E", # pycodestyle errors
|
|
164
|
+
"F", # pyflakes
|
|
165
|
+
"W", # pycodestyle warnings
|
|
166
|
+
"PL", # pylint
|
|
167
|
+
"UP", # pyupgrade
|
|
168
|
+
"RUF", # ruff's own rules
|
|
181
169
|
]
|
|
182
170
|
ignore = [
|
|
183
|
-
"E402",
|
|
184
|
-
"E501",
|
|
185
|
-
"PT006",
|
|
186
|
-
"PT007",
|
|
187
|
-
"PTH123",
|
|
188
|
-
"PLR",
|
|
171
|
+
"E402", # Module level import not at top of file.
|
|
172
|
+
"E501", # Line too long. Format covers this.
|
|
173
|
+
"PT006", # Opinions about types for pytest.parametrize
|
|
174
|
+
"PT007", # Opinions about types for pytest.parametrize
|
|
175
|
+
"PTH123", # Allow builtin open()
|
|
176
|
+
"PLR", # pylint refactors
|
|
189
177
|
]
|
|
190
178
|
|
|
191
179
|
# Allow unused variables when underscore-prefixed.
|
|
@@ -193,11 +181,11 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
|
193
181
|
|
|
194
182
|
[tool.ruff.lint.per-file-ignores]
|
|
195
183
|
"tests/**/*" = [
|
|
196
|
-
"ANN",
|
|
197
|
-
"S",
|
|
184
|
+
"ANN", # Disable flake8-annotations rules for test files
|
|
185
|
+
"S", # Disable flake8-bandit rules for test files
|
|
198
186
|
]
|
|
199
187
|
"src/**/*" = [
|
|
200
|
-
"PT",
|
|
188
|
+
"PT", # Disable pytest rules for src files
|
|
201
189
|
]
|
|
202
190
|
|
|
203
191
|
[tool.ruff.lint.pyupgrade]
|
|
@@ -222,10 +210,7 @@ no_implicit_optional = true
|
|
|
222
210
|
show_error_context = true
|
|
223
211
|
strict_equality = true
|
|
224
212
|
check_untyped_defs = true
|
|
225
|
-
exclude = [
|
|
226
|
-
'tests/.*',
|
|
227
|
-
'dist/.*',
|
|
228
|
-
]
|
|
213
|
+
exclude = ['tests/.*', 'dist/.*']
|
|
229
214
|
|
|
230
215
|
[[tool.mypy.overrides]]
|
|
231
216
|
module = "phantom.*"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# [2.0.0](https://github.com/phantomcyber/splunk-soar-sdk/compare/1.6.3...2.0.0) (2025-09-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
* feat!: remove deprecated generate_action_summary_message ([33e9f34](https://github.com/phantomcyber/splunk-soar-sdk/commit/33e9f344d950c0ab556730bb506cad1e14042746))
|
|
5
|
+
* feat!: renames generic action to make request ([ddad00e](https://github.com/phantomcyber/splunk-soar-sdk/commit/ddad00ebb1ae9eaccb7bc3ea630806aeeebc9ea7))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* rename generic action to make request ([3ddddfc](https://github.com/phantomcyber/splunk-soar-sdk/commit/3ddddfc9897a3a5d21674994a182a2e6d75b7d58))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* generate_action_summary_message is replaced by soar.set_message
|
|
16
|
+
* renames the generic_action decorator to make_request
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.0
|
|
@@ -150,19 +150,6 @@ class ActionOutput(BaseModel):
|
|
|
150
150
|
Nested ActionOutput classes are supported for complex data structures.
|
|
151
151
|
"""
|
|
152
152
|
|
|
153
|
-
def generate_action_summary_message(self) -> str:
|
|
154
|
-
"""Generate a summary message for the action output.
|
|
155
|
-
|
|
156
|
-
This method provides a human-readable summary of the action results,
|
|
157
|
-
which appears when running the action in a SOAR playbook or container.
|
|
158
|
-
|
|
159
|
-
Returns:
|
|
160
|
-
A string summarizing the action output.
|
|
161
|
-
|
|
162
|
-
.. deprecated:: 1.3.0
|
|
163
|
-
"""
|
|
164
|
-
return "Action completed successfully."
|
|
165
|
-
|
|
166
153
|
@classmethod
|
|
167
154
|
def _to_json_schema(
|
|
168
155
|
cls, parent_datapath: str = "action_result.data.*"
|
|
@@ -237,13 +224,13 @@ class ActionOutput(BaseModel):
|
|
|
237
224
|
yield schema_field
|
|
238
225
|
|
|
239
226
|
|
|
240
|
-
class
|
|
241
|
-
"""Output class for
|
|
227
|
+
class MakeRequestOutput(ActionOutput):
|
|
228
|
+
"""Output class for ``make request`` action.
|
|
242
229
|
|
|
243
230
|
This class extends the `ActionOutput` class and adds a status_code and response_body field. You can use this class as is or extend it to add more fields.
|
|
244
231
|
|
|
245
232
|
Example:
|
|
246
|
-
>>> class
|
|
233
|
+
>>> class CustomMakeRequestOutput(MakeRequestOutput):
|
|
247
234
|
... error: str = OutputField(example_values=["Invalid credentials"])
|
|
248
235
|
|
|
249
236
|
Note:
|
|
@@ -12,7 +12,6 @@ from soar_sdk.input_spec import InputSpecification
|
|
|
12
12
|
from soar_sdk.compat import (
|
|
13
13
|
MIN_PHANTOM_VERSION,
|
|
14
14
|
PythonVersion,
|
|
15
|
-
remove_when_soar_newer_than,
|
|
16
15
|
)
|
|
17
16
|
from soar_sdk.shims.phantom_common.app_interface.app_interface import SoarRestClient
|
|
18
17
|
from soar_sdk.shims.phantom_common.encryption.encryption_manager_factory import (
|
|
@@ -39,7 +38,7 @@ from soar_sdk.decorators import (
|
|
|
39
38
|
ViewHandlerDecorator,
|
|
40
39
|
OnPollDecorator,
|
|
41
40
|
WebhookDecorator,
|
|
42
|
-
|
|
41
|
+
MakeRequestDecorator,
|
|
43
42
|
)
|
|
44
43
|
|
|
45
44
|
|
|
@@ -516,33 +515,33 @@ class App:
|
|
|
516
515
|
"""
|
|
517
516
|
return ViewHandlerDecorator(self, template=template)
|
|
518
517
|
|
|
519
|
-
def
|
|
518
|
+
def make_request(
|
|
520
519
|
self, output_class: Optional[type[ActionOutput]] = None
|
|
521
|
-
) ->
|
|
522
|
-
"""Decorator for registering a
|
|
520
|
+
) -> MakeRequestDecorator:
|
|
521
|
+
"""Decorator for registering a ``make request`` action function.
|
|
523
522
|
|
|
524
|
-
This decorator marks a function as the
|
|
525
|
-
Only one
|
|
523
|
+
This decorator marks a function as the ``make request`` action for the app. ``make request`` is used to call any endpoint of the underlying API service this app implements.
|
|
524
|
+
Only one ``make request`` action is allowed per app. The function you define needs to accept at least one parameter of type :class:`~soar_sdk.params.MakeRequestParams` and can accept any other parameters you need.
|
|
526
525
|
Other useful parameters to accept are the SOARClient and the asset.
|
|
527
526
|
|
|
528
527
|
Returns:
|
|
529
|
-
|
|
528
|
+
MakeRequestActionDecorator: A decorator instance that handles ``make request`` action registration.
|
|
530
529
|
|
|
531
530
|
Example:
|
|
532
|
-
>>> @app.
|
|
531
|
+
>>> @app.make_request()
|
|
533
532
|
... def http_action(
|
|
534
|
-
... self, params:
|
|
535
|
-
... ) ->
|
|
533
|
+
... self, params: MakeRequestParams, asset: Asset
|
|
534
|
+
... ) -> MakeRequestOutput:
|
|
536
535
|
... logger.info(f"testing connectivity against {asset.base_url}")
|
|
537
|
-
... return
|
|
536
|
+
... return MakeRequestOutput(
|
|
538
537
|
... status_code=200,
|
|
539
538
|
... response_body=f"Base url is {asset.base_url}",
|
|
540
539
|
... )
|
|
541
540
|
|
|
542
541
|
Note:
|
|
543
|
-
The
|
|
542
|
+
The ``make request`` action function should return either a :class:`~soar_sdk.action_results.MakeRequestOutput` object or of an output class derived from it.
|
|
544
543
|
"""
|
|
545
|
-
return
|
|
544
|
+
return MakeRequestDecorator(self, output_class=output_class)
|
|
546
545
|
|
|
547
546
|
@staticmethod
|
|
548
547
|
def _validate_params_class(
|
|
@@ -652,11 +651,7 @@ class App:
|
|
|
652
651
|
param_dict = action_params.dict() if action_params else None
|
|
653
652
|
|
|
654
653
|
if not message:
|
|
655
|
-
|
|
656
|
-
"7.0.0",
|
|
657
|
-
'Setting action_result.message in this way was deprecated in SDK 1.3.0. Developers must use SOARClient.set_message instead. We should replace the following method call with a static "Action succeeded" message.',
|
|
658
|
-
)
|
|
659
|
-
message = result.generate_action_summary_message()
|
|
654
|
+
message = "Action completed successfully"
|
|
660
655
|
|
|
661
656
|
result = ActionResult(
|
|
662
657
|
status=True,
|
|
@@ -47,15 +47,7 @@ class OutputsSerializer:
|
|
|
47
47
|
outputs_class: type[ActionOutput],
|
|
48
48
|
summary_class: Optional[type[ActionOutput]] = None,
|
|
49
49
|
) -> list[OutputFieldSpecification]:
|
|
50
|
-
"""Serializes the data paths of an
|
|
51
|
-
if (
|
|
52
|
-
outputs_class.generate_action_summary_message
|
|
53
|
-
!= ActionOutput.generate_action_summary_message
|
|
54
|
-
):
|
|
55
|
-
logger.warning(
|
|
56
|
-
f"Overriding ActionOutput.generate_action_summary_message is deprecated. Please call SOARClient.set_message from your action handler instead. [in {outputs_class.__name__}]"
|
|
57
|
-
)
|
|
58
|
-
|
|
50
|
+
"""Serializes the data paths of an action to JSON schema."""
|
|
59
51
|
status = OutputFieldSpecification(
|
|
60
52
|
data_path="action_result.status",
|
|
61
53
|
data_type="string",
|
|
@@ -5,12 +5,12 @@ from .test_connectivity import ConnectivityTestDecorator
|
|
|
5
5
|
from .view_handler import ViewHandlerDecorator
|
|
6
6
|
from .on_poll import OnPollDecorator
|
|
7
7
|
from .webhook import WebhookDecorator
|
|
8
|
-
from .
|
|
8
|
+
from .make_request import MakeRequestDecorator
|
|
9
9
|
|
|
10
10
|
__all__ = [
|
|
11
11
|
"ActionDecorator",
|
|
12
12
|
"ConnectivityTestDecorator",
|
|
13
|
-
"
|
|
13
|
+
"MakeRequestDecorator",
|
|
14
14
|
"OnPollDecorator",
|
|
15
15
|
"ViewHandlerDecorator",
|
|
16
16
|
"WebhookDecorator",
|
|
@@ -2,9 +2,9 @@ import inspect
|
|
|
2
2
|
|
|
3
3
|
from soar_sdk.abstract import SOARClient
|
|
4
4
|
from soar_sdk.action_results import ActionResult
|
|
5
|
-
from soar_sdk.params import
|
|
5
|
+
from soar_sdk.params import MakeRequestParams
|
|
6
6
|
from soar_sdk.meta.actions import ActionMeta
|
|
7
|
-
from soar_sdk.action_results import ActionOutput,
|
|
7
|
+
from soar_sdk.action_results import ActionOutput, MakeRequestOutput
|
|
8
8
|
from soar_sdk.types import Action, action_protocol
|
|
9
9
|
from soar_sdk.exceptions import ActionFailure
|
|
10
10
|
from soar_sdk.async_utils import run_async_if_needed
|
|
@@ -18,8 +18,8 @@ if TYPE_CHECKING:
|
|
|
18
18
|
from soar_sdk.app import App
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class
|
|
22
|
-
"""Class-based decorator for
|
|
21
|
+
class MakeRequestDecorator:
|
|
22
|
+
"""Class-based decorator for ``make request`` action functionality."""
|
|
23
23
|
|
|
24
24
|
def __init__(
|
|
25
25
|
self,
|
|
@@ -30,32 +30,32 @@ class GenericActionDecorator:
|
|
|
30
30
|
self.output_class = output_class
|
|
31
31
|
|
|
32
32
|
def __call__(self, function: Callable) -> Action:
|
|
33
|
-
"""Decorator for the
|
|
33
|
+
"""Decorator for the ``make request`` HTTP API action.
|
|
34
34
|
|
|
35
|
-
The decorated function implements a
|
|
35
|
+
The decorated function implements a ``make request`` action that can be used to call any endpoint of the underlying API service this app implements.
|
|
36
36
|
|
|
37
37
|
Usage:
|
|
38
|
-
This decorated function automatically gets all the parameters from the
|
|
38
|
+
This decorated function automatically gets all the parameters from the :class:`~soar_sdk.params.MakeRequestParams` class and passes them to the function. ``MakeRequestParams`` represents the parameters required for most http requests.
|
|
39
39
|
You should use your existing asset interface to make this request.
|
|
40
40
|
"""
|
|
41
|
-
if self.app.actions_manager.get_action("
|
|
41
|
+
if self.app.actions_manager.get_action("make_request"):
|
|
42
42
|
raise TypeError(
|
|
43
|
-
"The '
|
|
43
|
+
"The 'make_request' decorator can only be used once per App instance."
|
|
44
44
|
)
|
|
45
45
|
|
|
46
|
-
# Validate function signature - must have at least one parameter of type
|
|
46
|
+
# Validate function signature - must have at least one parameter of type MakeRequestParams
|
|
47
47
|
signature = inspect.signature(function)
|
|
48
48
|
params = list(signature.parameters.values())
|
|
49
49
|
|
|
50
|
-
if not any(param.annotation ==
|
|
50
|
+
if not any(param.annotation == MakeRequestParams for param in params):
|
|
51
51
|
raise TypeError(
|
|
52
|
-
f"
|
|
52
|
+
f"Make request action function must have at least one parameter of type MakeRequestParams, got {params[0].annotation}"
|
|
53
53
|
)
|
|
54
54
|
|
|
55
|
-
action_identifier = "
|
|
56
|
-
action_name = "
|
|
57
|
-
# for
|
|
58
|
-
validated_params_class =
|
|
55
|
+
action_identifier = "make_request"
|
|
56
|
+
action_name = "make request"
|
|
57
|
+
# for make request action use MakeRequestParams
|
|
58
|
+
validated_params_class = MakeRequestParams
|
|
59
59
|
|
|
60
60
|
return_type = inspect.signature(function).return_annotation
|
|
61
61
|
if return_type is not inspect.Signature.empty:
|
|
@@ -68,10 +68,10 @@ class GenericActionDecorator:
|
|
|
68
68
|
)
|
|
69
69
|
|
|
70
70
|
if not issubclass(validated_output_class, ActionOutput) and not isinstance(
|
|
71
|
-
validated_output_class,
|
|
71
|
+
validated_output_class, MakeRequestOutput
|
|
72
72
|
):
|
|
73
73
|
raise TypeError(
|
|
74
|
-
"Return type for action function must be either
|
|
74
|
+
"Return type for action function must be either MakeRequestOutput or derived from ActionOutput or MakeRequestOutput class."
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
logger = getLogger()
|
|
@@ -79,7 +79,7 @@ class GenericActionDecorator:
|
|
|
79
79
|
@action_protocol
|
|
80
80
|
@wraps(function)
|
|
81
81
|
def inner(
|
|
82
|
-
params:
|
|
82
|
+
params: MakeRequestParams,
|
|
83
83
|
soar: SOARClient = self.app.soar_client,
|
|
84
84
|
*args: Any, # noqa: ANN401
|
|
85
85
|
**kwargs: Any, # noqa: ANN401
|
|
@@ -122,7 +122,7 @@ class GenericActionDecorator:
|
|
|
122
122
|
action=action_name,
|
|
123
123
|
identifier=action_identifier,
|
|
124
124
|
description=inspect.getdoc(function) or action_name,
|
|
125
|
-
verbose="
|
|
125
|
+
verbose="'make request' action for the app. Used to handle arbitrary HTTP requests with the app's asset",
|
|
126
126
|
type="generic",
|
|
127
127
|
parameters=validated_params_class,
|
|
128
128
|
output=validated_output_class,
|
|
@@ -170,8 +170,8 @@ class OnPollParams(Params):
|
|
|
170
170
|
)
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
class
|
|
174
|
-
"""Canonical parameters for the special
|
|
173
|
+
class MakeRequestParams(Params):
|
|
174
|
+
"""Canonical parameters for the special make request action."""
|
|
175
175
|
|
|
176
176
|
http_method: str = Param(
|
|
177
177
|
description="The HTTP method to use for the request.",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from soar_sdk.cli.manifests.serializers import ParamsSerializer, OutputsSerializer
|
|
3
2
|
from soar_sdk.params import Param, Params
|
|
4
3
|
from soar_sdk.action_results import ActionOutput, OutputField
|
|
@@ -298,18 +297,3 @@ def test_outputs_serialize_with_parameters_class():
|
|
|
298
297
|
"example_values": [1],
|
|
299
298
|
},
|
|
300
299
|
]
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
def test_serializer_with_custom_message_prints_warning(caplog):
|
|
304
|
-
class CustomOutput(ActionOutput):
|
|
305
|
-
def generate_action_summary_message(self) -> str:
|
|
306
|
-
return f"Custom message: {self.result}"
|
|
307
|
-
|
|
308
|
-
with caplog.at_level(logging.WARNING):
|
|
309
|
-
OutputsSerializer.serialize_datapaths(Params, CustomOutput)
|
|
310
|
-
|
|
311
|
-
assert (
|
|
312
|
-
"Overriding ActionOutput.generate_action_summary_message is deprecated."
|
|
313
|
-
in caplog.text
|
|
314
|
-
)
|
|
315
|
-
assert "[in CustomOutput]" in caplog.text
|
|
@@ -236,13 +236,13 @@
|
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
|
-
"action": "
|
|
240
|
-
"identifier": "
|
|
241
|
-
"description": "
|
|
239
|
+
"action": "make request",
|
|
240
|
+
"identifier": "make_request",
|
|
241
|
+
"description": "make request",
|
|
242
242
|
"type": "generic",
|
|
243
243
|
"read_only": false,
|
|
244
244
|
"versions": "EQ(*)",
|
|
245
|
-
"verbose": "
|
|
245
|
+
"verbose": "'make request' action for the app. Used to handle arbitrary HTTP requests with the app's asset",
|
|
246
246
|
"parameters": {
|
|
247
247
|
"http_method": {
|
|
248
248
|
"order": 0,
|
|
@@ -5,10 +5,10 @@ from zoneinfo import ZoneInfo
|
|
|
5
5
|
from soar_sdk.abstract import SOARClient
|
|
6
6
|
from soar_sdk.app import App
|
|
7
7
|
from soar_sdk.asset import AssetField, BaseAsset
|
|
8
|
-
from soar_sdk.params import OnPollParams,
|
|
8
|
+
from soar_sdk.params import OnPollParams, MakeRequestParams, Params
|
|
9
9
|
from soar_sdk.models.container import Container
|
|
10
10
|
from soar_sdk.models.artifact import Artifact
|
|
11
|
-
from soar_sdk.action_results import ActionOutput,
|
|
11
|
+
from soar_sdk.action_results import ActionOutput, MakeRequestOutput
|
|
12
12
|
from soar_sdk.logging import getLogger
|
|
13
13
|
|
|
14
14
|
logger = getLogger()
|
|
@@ -45,6 +45,8 @@ def test_connectivity(soar: SOARClient, asset: Asset) -> None:
|
|
|
45
45
|
soar.get("rest/version")
|
|
46
46
|
container_id = soar.get_executing_container_id()
|
|
47
47
|
logger.info(f"current executing container's container_id is: {container_id}")
|
|
48
|
+
asset_id = soar.get_asset_id()
|
|
49
|
+
logger.info(f"current executing container's asset_id is: {asset_id}")
|
|
48
50
|
logger.info(f"testing connectivity against {asset.base_url}")
|
|
49
51
|
logger.debug("hello")
|
|
50
52
|
logger.warning("this is a warning")
|
|
@@ -67,10 +69,10 @@ app.register_action(
|
|
|
67
69
|
)
|
|
68
70
|
|
|
69
71
|
|
|
70
|
-
@app.
|
|
71
|
-
def http_action(params:
|
|
72
|
+
@app.make_request()
|
|
73
|
+
def http_action(params: MakeRequestParams, asset: Asset) -> MakeRequestOutput:
|
|
72
74
|
logger.info(f"HTTP action triggered with params: {params}")
|
|
73
|
-
return
|
|
75
|
+
return MakeRequestOutput(
|
|
74
76
|
status_code=200,
|
|
75
77
|
response_body=f"Base url is {asset.base_url}",
|
|
76
78
|
)
|
|
@@ -177,25 +177,6 @@ def test_action_called_with_default_message_set(
|
|
|
177
177
|
assert "success" in example_app.actions_manager.get_results()[0].message
|
|
178
178
|
|
|
179
179
|
|
|
180
|
-
def test_action_called_with_custom_message_set(
|
|
181
|
-
example_app: App, simple_action_input: InputSpecification
|
|
182
|
-
):
|
|
183
|
-
class CustomActionOutput(ActionOutput):
|
|
184
|
-
result: int
|
|
185
|
-
|
|
186
|
-
def generate_action_summary_message(self) -> str:
|
|
187
|
-
return f"The result is {self.result}"
|
|
188
|
-
|
|
189
|
-
@example_app.action()
|
|
190
|
-
def test_action(params: Params) -> CustomActionOutput:
|
|
191
|
-
return CustomActionOutput(result=42)
|
|
192
|
-
|
|
193
|
-
example_app.handle(simple_action_input.json())
|
|
194
|
-
|
|
195
|
-
assert len(example_app.actions_manager.get_results()) == 1
|
|
196
|
-
assert example_app.actions_manager.get_results()[0].message == "The result is 42"
|
|
197
|
-
|
|
198
|
-
|
|
199
180
|
def test_action_called_with_timezone_asset(example_app: App):
|
|
200
181
|
class AssetWithTimezones(BaseAsset):
|
|
201
182
|
timezone: ZoneInfo
|
|
@@ -223,10 +204,7 @@ def test_action_called_with_timezone_asset(example_app: App):
|
|
|
223
204
|
example_app.handle(action_input.json())
|
|
224
205
|
|
|
225
206
|
assert len(example_app.actions_manager.get_results()) == 1
|
|
226
|
-
assert (
|
|
227
|
-
example_app.actions_manager.get_results()[0].message
|
|
228
|
-
== "Action completed successfully."
|
|
229
|
-
)
|
|
207
|
+
assert "success" in example_app.actions_manager.get_results()[0].message
|
|
230
208
|
|
|
231
209
|
|
|
232
210
|
def test_actions_provider_running_undefined_action(
|