🔒 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:
32
LittleShop/AddMultiBuysTable.csx
Normal file
32
LittleShop/AddMultiBuysTable.csx
Normal file
@@ -0,0 +1,32 @@
|
||||
#r "nuget: Microsoft.Data.Sqlite, 9.0.1"
|
||||
|
||||
using Microsoft.Data.Sqlite;
|
||||
|
||||
var connectionString = @"Data Source=C:\Production\Source\LittleShop\LittleShop\littleshop.db";
|
||||
|
||||
using (var connection = new SqliteConnection(connectionString))
|
||||
{
|
||||
connection.Open();
|
||||
|
||||
var sql = @"
|
||||
CREATE TABLE IF NOT EXISTS ProductMultiBuys (
|
||||
Id TEXT PRIMARY KEY NOT NULL,
|
||||
ProductId TEXT NOT NULL,
|
||||
Name TEXT NOT NULL,
|
||||
Description TEXT NOT NULL DEFAULT '',
|
||||
Quantity INTEGER NOT NULL,
|
||||
Price REAL NOT NULL,
|
||||
PricePerUnit REAL NOT NULL,
|
||||
SortOrder INTEGER NOT NULL DEFAULT 0,
|
||||
IsActive INTEGER NOT NULL DEFAULT 1,
|
||||
CreatedAt TEXT NOT NULL,
|
||||
UpdatedAt TEXT NOT NULL,
|
||||
FOREIGN KEY (ProductId) REFERENCES Products(Id) ON DELETE CASCADE
|
||||
)";
|
||||
|
||||
using (var command = new SqliteCommand(sql, connection))
|
||||
{
|
||||
command.ExecuteNonQuery();
|
||||
Console.WriteLine("ProductMultiBuys table created successfully!");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user