Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Ap6pack_malwar /src /malwar /plugins /base.py
| """Abstract base class for detector plugins.""" | |
| from __future__ import annotations | |
| from abc import abstractmethod | |
| from dataclasses import dataclass, field | |
| from malwar.scanner.base import BaseDetector | |
| class PluginMetadata: | |
| """Immutable metadata describing a detector plugin.""" | |
| name: str | |
| version: str | |
| author: str | |
| description: str | |
| layer_name: str | |
| tags: list[str] = field(default_factory=list) | |
| class DetectorPlugin(BaseDetector): | |
| """Abstract base class that third-party detector plugins must extend. | |
| Subclasses **must** implement: | |
| - ``plugin_metadata`` (class-level property returning ``PluginMetadata``) | |
| - ``detect`` (inherited from ``BaseDetector``) | |
| The ``layer_name`` and ``order`` required by ``BaseDetector`` are derived | |
| automatically from ``plugin_metadata``. | |
| """ | |
| def plugin_metadata(self) -> PluginMetadata: | |
| """Return metadata describing this plugin.""" | |
| ... | |
| # -- BaseDetector interface wired to metadata -------------------------- | |
| def layer_name(self) -> str: | |
| return self.plugin_metadata.layer_name | |
| def order(self) -> int: | |
| """Plugins run after the built-in layers (order >= 100).""" | |
| return 100 | |
Xet Storage Details
- Size:
- 1.31 kB
- Xet hash:
- 17378b13405c0391584fdda53cda82e2e3d6fa168a8a3843d56ac7f3ec169452
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.