using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace MarketAlly.AIPlugin.Analysis.Infrastructure
{
///
/// Input validation and security service for analysis operations
///
public class InputValidator
{
private readonly ILogger? _logger;
private static readonly HashSet AllowedFileExtensions = new(StringComparer.OrdinalIgnoreCase)
{
".cs", ".csproj", ".sln", ".json", ".xml", ".config", ".md", ".txt",
".dll", ".exe", ".pdb", ".nuspec", ".props", ".targets"
};
private static readonly Regex SafePathRegex = new(@"^[a-zA-Z0-9\\\/:._\-\s]+$", RegexOptions.Compiled);
private static readonly Regex DangerousPatternRegex = new(@"(\.\.[\\/]|