🔒 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:
@@ -45,19 +45,19 @@ public class ProductService : IProductService
|
||||
AltText = ph.AltText,
|
||||
SortOrder = ph.SortOrder
|
||||
}).ToList(),
|
||||
MultiBuys = p.MultiBuys.OrderBy(v => v.SortOrder).Select(v => new ProductMultiBuyDto
|
||||
MultiBuys = p.MultiBuys.Select(mb => new ProductMultiBuyDto
|
||||
{
|
||||
Id = v.Id,
|
||||
ProductId = v.ProductId,
|
||||
Name = v.Name,
|
||||
Description = v.Description,
|
||||
Quantity = v.Quantity,
|
||||
Price = v.Price,
|
||||
PricePerUnit = v.PricePerUnit,
|
||||
SortOrder = v.SortOrder,
|
||||
IsActive = v.IsActive,
|
||||
CreatedAt = v.CreatedAt,
|
||||
UpdatedAt = v.UpdatedAt
|
||||
Id = mb.Id,
|
||||
ProductId = mb.ProductId,
|
||||
Name = mb.Name,
|
||||
Description = mb.Description,
|
||||
Quantity = mb.Quantity,
|
||||
Price = mb.Price,
|
||||
PricePerUnit = mb.PricePerUnit,
|
||||
SortOrder = mb.SortOrder,
|
||||
IsActive = mb.IsActive,
|
||||
CreatedAt = mb.CreatedAt,
|
||||
UpdatedAt = mb.UpdatedAt
|
||||
}).ToList()
|
||||
})
|
||||
.ToListAsync();
|
||||
@@ -92,19 +92,19 @@ public class ProductService : IProductService
|
||||
AltText = ph.AltText,
|
||||
SortOrder = ph.SortOrder
|
||||
}).ToList(),
|
||||
MultiBuys = p.MultiBuys.OrderBy(v => v.SortOrder).Select(v => new ProductMultiBuyDto
|
||||
MultiBuys = p.MultiBuys.Select(mb => new ProductMultiBuyDto
|
||||
{
|
||||
Id = v.Id,
|
||||
ProductId = v.ProductId,
|
||||
Name = v.Name,
|
||||
Description = v.Description,
|
||||
Quantity = v.Quantity,
|
||||
Price = v.Price,
|
||||
PricePerUnit = v.PricePerUnit,
|
||||
SortOrder = v.SortOrder,
|
||||
IsActive = v.IsActive,
|
||||
CreatedAt = v.CreatedAt,
|
||||
UpdatedAt = v.UpdatedAt
|
||||
Id = mb.Id,
|
||||
ProductId = mb.ProductId,
|
||||
Name = mb.Name,
|
||||
Description = mb.Description,
|
||||
Quantity = mb.Quantity,
|
||||
Price = mb.Price,
|
||||
PricePerUnit = mb.PricePerUnit,
|
||||
SortOrder = mb.SortOrder,
|
||||
IsActive = mb.IsActive,
|
||||
CreatedAt = mb.CreatedAt,
|
||||
UpdatedAt = mb.UpdatedAt
|
||||
}).ToList()
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user