/**
 * External Data Integration
 * Integrates with security ratings APIs, breach databases, and threat intelligence feeds
 *
 * Security Note: All external HTTP requests are made through the secureFetch wrapper
 * which provides SSRF protection including:
 * - URL scheme validation (HTTPS only in production)
 * - Private IP range blocking (RFC 1918, RFC 5737, RFC 6598)
 * - Link-local and localhost blocking
 * - DNS resolution validation to prevent rebinding attacks
 * - Request timeout enforcement
 * - Audit logging of all external requests
 */
import { SecurityRating, BreachRecord, CertificateInfo, SanctionEntry, ThreatIntelligence } from './types';
export interface DataSourceConfig {
    name: string;
    type: DataSourceType;
    enabled: boolean;
    apiEndpoint: string;
    apiKey?: string;
    rateLimit: RateLimitConfig;
    cacheConfig: CacheConfig;
    retryConfig: RetryConfig;
}
export type DataSourceType = 'security_rating' | 'breach_database' | 'certificate_transparency' | 'sanctions_list' | 'threat_feed' | 'dark_web' | 'dns_intelligence' | 'news_aggregator';
export interface RateLimitConfig {
    requestsPerMinute: number;
    requestsPerDay: number;
    burstLimit: number;
}
export interface CacheConfig {
    enabled: boolean;
    ttlSeconds: number;
    maxEntries: number;
}
export interface RetryConfig {
    maxRetries: number;
    backoffMs: number;
    backoffMultiplier: number;
}
export declare class DataSourceManager {
    private readonly config;
    private sources;
    private cache;
    private rateLimiter;
    constructor(config: DataSourceManagerConfig);
    private initializeSources;
    registerSource(source: DataSource): void;
    getSecurityRatings(domain: string): Promise<SecurityRating[]>;
    getBreachRecords(domain: string): Promise<BreachRecord[]>;
    getCertificateInfo(domain: string): Promise<CertificateInfo[]>;
    checkSanctions(entityName: string, entityType: string): Promise<SanctionEntry[]>;
    getThreatIntelligence(domain: string): Promise<ThreatIntelligence[]>;
    scanDarkWeb(domain: string): Promise<DarkWebMention[]>;
    private getSourcesByType;
    private fetchWithCache;
    getSourceStatus(): DataSourceStatus[];
}
export interface DataSourceManagerConfig {
    globalCacheConfig: CacheConfig;
    globalRateLimit: RateLimitConfig;
    sources: Record<string, DataSourceConfig>;
}
export interface DataSourceStatus {
    name: string;
    type: DataSourceType;
    enabled: boolean;
    healthy: boolean;
    lastCheck: Date;
    errorCount: number;
}
export declare abstract class DataSource {
    readonly name: string;
    readonly type: DataSourceType;
    protected config: DataSourceConfig;
    protected lastHealthCheck: Date;
    protected healthy: boolean;
    protected errorCount: number;
    constructor(name: string, type: DataSourceType, config: DataSourceConfig);
    isEnabled(): boolean;
    isHealthy(): boolean;
    getLastHealthCheck(): Date;
    getErrorCount(): number;
    getCacheTTL(): number;
    /**
     * Make a secure HTTP request to the data source API.
     *
     * Uses secureFetch for SSRF protection:
     * - Validates URL scheme (HTTPS required in production)
     * - Blocks private IP ranges and internal hostnames
     * - Performs DNS resolution to detect rebinding attacks
     * - Enforces request timeout
     * - Logs all external requests for audit
     *
     * @param endpoint - API endpoint path (appended to apiEndpoint)
     * @param options - Request options (method, headers, body)
     * @returns Parsed JSON response
     * @throws DataSourceError if request fails
     */
    protected makeRequest<T>(endpoint: string, options?: RequestOptions): Promise<T>;
    abstract healthCheck(): Promise<boolean>;
}
interface RequestOptions {
    method?: string;
    headers?: Record<string, string>;
    body?: unknown;
}
export declare class DataSourceError extends Error {
    readonly source: string;
    readonly statusCode?: number;
    constructor(source: string, message: string, statusCode?: number);
}
export interface DarkWebMention {
    id: string;
    source: string;
    domain: string;
    mentionType: 'credential_dump' | 'data_sale' | 'discussion' | 'exploit';
    content: string;
    discoveredAt: Date;
    confidence: number;
    url?: string;
}
export declare function createDataSourceManager(config: DataSourceManagerConfig): DataSourceManager;
export declare function getDefaultDataSourceConfig(): DataSourceManagerConfig;
export {};
//# sourceMappingURL=data-sources.d.ts.map