UNPKG

@syntropysoft/praetorian

Version:

Praetorian CLI – A universal multi-environment configuration validator for DevSecOps teams. Validate, compare, and secure YAML/ENV files with ease.

58 lines 1.68 kB
import { PluginMetadata, ValidationRule } from '../../../shared/types'; /** * Base class for all Praetorian plugins * * Plugins extend this class to provide validation rules * and audit capabilities for specific domains. */ export declare abstract class BasePlugin { protected metadata: PluginMetadata; protected rules: ValidationRule[]; constructor(metadata: PluginMetadata); /** * Get plugin metadata */ getMetadata(): PluginMetadata; /** * Get all validation rules for this plugin */ getRules(): ValidationRule[]; /** * Get a specific rule by ID */ getRule(ruleId: string): ValidationRule | undefined; /** * Validate a configuration using this plugin's rules */ validate(config: Record<string, any>, context: any): Promise<any>; /** * Initialize plugin-specific rules * Override this method in subclasses */ protected abstract initializeRules(): void; /** * Execute a specific validation rule * Override this method in subclasses */ protected abstract executeRule(rule: ValidationRule, config: Record<string, any>, context: any): Promise<any>; /** * Add a validation rule to this plugin */ protected addRule(rule: ValidationRule): void; /** * Enable or disable a rule */ setRuleEnabled(ruleId: string, enabled: boolean): boolean; /** * Get plugin health status */ getHealth(): Promise<{ healthy: boolean; message?: string; }>; /** * Execute a rule safely with error handling */ private executeRuleSafely; } //# sourceMappingURL=BasePlugin.d.ts.map