Skip to content

fix(secops-soar): improve error handling, marketplace imports, and packaging sync - #295

Open
dandye wants to merge 1 commit into
mainfrom
fix/soar-client-errors
Open

fix(secops-soar): improve error handling, marketplace imports, and packaging sync#295
dandye wants to merge 1 commit into
mainfrom
fix/soar-client-errors

Conversation

@dandye

@dandye dandye commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR addresses multiple stability, diagnostic, and packaging issues across server/secops-soar:

  1. Structured Exception Hierarchy & Clean Error Propagation:

    • Introduces typed exceptions in secops_soar_mcp/exceptions.py: SoarError, SoarConnectionError, SoarSSLError, SoarAuthError, and SoarHttpError.
    • HttpClient detects underlying SSL/TLS failures (walking the exception cause chain via is_ssl_cert_verification_error) and raises SoarSSLError, SoarAuthError, or SoarConnectionError directly.
    • Eliminates mutable state/side-channels (self.last_error) on the asynchronous client.
  2. Actionable macOS TLS / certifi Error Handling:

    • bindings._get_valid_scopes() catches SoarSSLError during startup and provides clear guidance for macOS python.org installer users (/Applications/Python 3.X/Install Certificates.command or SSL_CERT_FILE=$(python -m certifi)).
    • Distinguishes TLS certificate failures from authentication errors (401/403) and network connection drops.
  3. Dynamic Marketplace Module Import Resolution (Fixes [secops-soar] Dynamic marketplace tool import fails with ModuleNotFoundError when running installed package #293):

    • Updates secops_soar_mcp/server.py to resolve marketplace integration tools via secops_soar_mcp.marketplace.{module_stem} with fallback to marketplace.{module_stem}, preventing ModuleNotFoundError when the server is installed as a package.
  4. Synchronize python-dotenv in setup.py (Fixes [secops-soar] setup.py is missing python-dotenv dependency from install_requires #294):

    • Adds "python-dotenv>=1.0.0" to install_requires in server/secops-soar/setup.py to match pyproject.toml.
  5. Hermetic Unit Tests:

    • Adds 6 unit tests in tests/test_soar_unit.py covering SSL error detection, auth error translation, diagnostic message formatting, and marketplace path resolution.
    • Removes autouse=True from tests/conftest.py so unit tests can run hermetically without requiring live credentials in config.json.

Fixes #293
Fixes #294

Tests Run

  • uv run --with "mcp<2" --with pytest --with pytest-asyncio --with aiohttp --with python-dotenv pytest tests/test_soar_unit.py (6 passed)

…ckaging sync

- Add structured exception hierarchy (SoarError, SoarConnectionError, SoarSSLError, SoarAuthError, SoarHttpError)
- Add TLS/SSL certificate verification diagnostics with actionable macOS certifi guidance
- Fix dynamic marketplace tool import path to use secops_soar_mcp.marketplace
- Add python-dotenv to setup.py install_requires to match pyproject.toml
- Update test conftest so unit tests run hermetically without live credentials

Fixes #293
Fixes #294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant