"""Abstract base class for meshulash-guard scanners.

Subclasses must implement:
- BaseScanner.to_guardline_spec() --- translate scanner config into a guardline
  spec dict for /api/security/scan.
"""

from abc import ABC, abstractmethod


class BaseScanner(ABC):
    """Base class for all scanners.

    Each scanner translates its configuration into a guardline spec the
    security server understands. The Guard class calls to_guardline_spec()
    to build the guardline_specs payload for /api/security/scan.
    """

    @abstractmethod
    def to_guardline_spec(self) -> dict:
        """Translate scanner config into a guardline_spec dict.

        Returns:
            dict: A single guardline spec suitable for inclusion in the
                  guardline_specs payload sent to /api/security/scan.
        """
