🔒 SECURITY: Emergency fixes and hardening

EMERGENCY FIXES:
 DELETE MockSilverPayService.cs - removed fake payment system
 REMOVE mock service registration - no fake payments possible
 GENERATE new JWT secret - replaced hardcoded key
 FIX HttpClient disposal - proper resource management

SECURITY HARDENING:
 ADD production guards - prevent mock services in production
 CREATE environment configs - separate dev/prod settings
 ADD config validation - fail fast on misconfiguration

IMPACT:
- Mock payment system completely eliminated
- JWT authentication now uses secure keys
- Production deployment now validated on startup
- Resource leaks fixed in TeleBot currency API

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-22 05:45:49 +01:00
parent 5138242a99
commit 622bdcf111
41 changed files with 6797 additions and 341 deletions

View File

@@ -28,6 +28,7 @@ public class LittleShopContext : DbContext
public DbSet<PushSubscription> PushSubscriptions { get; set; }
public DbSet<Review> Reviews { get; set; }
public DbSet<BotContact> BotContacts { get; set; }
public DbSet<SystemSetting> SystemSettings { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -302,5 +303,12 @@ public class LittleShopContext : DbContext
entity.HasIndex(e => new { e.ProductId, e.IsApproved, e.IsActive });
entity.HasIndex(e => new { e.CustomerId, e.ProductId }).IsUnique(); // One review per customer per product
});
// SystemSetting entity
modelBuilder.Entity<SystemSetting>(entity =>
{
entity.HasKey(e => e.Key);
entity.HasIndex(e => e.Key).IsUnique();
});
}
}