"""
AIPTX Key Validation Module
===========================

Automatic API key validation and exploitation framework.

This module provides:
- Detection of API keys in scan findings and text
- Validation against cloud and SaaS provider APIs
- Permission enumeration for valid keys
- Risk assessment and exploitation potential
- AI thinking display during validation
- Report generation (JSON, HTML, Markdown)

Usage:
    from aipt_v2.post_exploit.key_validation import (
        KeyDetector,
        KeyValidationBridge,
        KeyValidationConfig,
        APIKeyInfo,
        ValidationResult,
        KeyType,
    )

    # Quick validation
    bridge = KeyValidationBridge()
    results = await bridge.validate_from_text("ghp_xxxxxxxxxxxx")

    # Or from scan findings
    async def on_finding(finding):
        results = await bridge.on_finding(finding)
        for result in results:
            if result.is_valid:
                print(f"Valid {result.key_info.key_type}: {result.permissions}")

    # Generate report
    from aipt_v2.post_exploit.key_validation import KeyValidationReportGenerator
    report_gen = KeyValidationReportGenerator()
    report = report_gen.generate_html_report(bridge.validation_results)
"""

from .base import (
    KeyType,
    RiskLevel,
    APIKeyInfo,
    ValidationResult,
    BaseKeyValidator,
)
from .detector import KeyDetector, KeyPattern
from .bridge import KeyValidationBridge, KeyValidationConfig, validate_key
from .thinking import KeyValidationThinking, get_thinking, set_thinking_enabled
from .report_generator import KeyValidationReportGenerator, ReportConfig

# Validators
from .validators import (
    AWSKeyValidator,
    GCPKeyValidator,
    AzureKeyValidator,
    GitHubKeyValidator,
    GitLabKeyValidator,
    SlackKeyValidator,
    StripeKeyValidator,
    TwilioKeyValidator,
    SendGridKeyValidator,
    AtlassianKeyValidator,
)
from .validators.s3_scanner import S3BucketScanner, S3ScanResult

__all__ = [
    # Enums
    "KeyType",
    "RiskLevel",
    # Data classes
    "APIKeyInfo",
    "ValidationResult",
    "KeyPattern",
    "S3ScanResult",
    # Base class
    "BaseKeyValidator",
    # Detection
    "KeyDetector",
    # Bridge
    "KeyValidationBridge",
    "KeyValidationConfig",
    "validate_key",
    # Thinking
    "KeyValidationThinking",
    "get_thinking",
    "set_thinking_enabled",
    # Reporting
    "KeyValidationReportGenerator",
    "ReportConfig",
    # Cloud Validators
    "AWSKeyValidator",
    "GCPKeyValidator",
    "AzureKeyValidator",
    # SaaS Validators
    "GitHubKeyValidator",
    "GitLabKeyValidator",
    "SlackKeyValidator",
    "StripeKeyValidator",
    "TwilioKeyValidator",
    "SendGridKeyValidator",
    "AtlassianKeyValidator",
    # S3 Scanner
    "S3BucketScanner",
]
