feat(client): implement per-client storage and security controls

- Added storage quota, IP allowlisting, and expiration logic to client management APIs.
- Updated CSV storage manager to support auto-compression and improved partition file parsing.
- Integrated security checks into event ingestion and data retrieval routes.
This commit is contained in:
Team Dark Devil committed 2026-11-19 23:02:27 +06:00
1 parent 89e4d68690
commit 2873b9904a
32 files changed
+6075 -241

No files matched your search

+5 -2
View File
@@ -23,7 +23,10 @@ export async function GET(req: NextRequest) {
? CSVStorageManager.sanitizeClientId(clientId)
: undefined;
const allFiles = await CSVStorageManager.listAllFilesAsync();
const [allFiles, diskUsage] = await Promise.all([
CSVStorageManager.listAllFilesAsync(),
CSVStorageManager.getDiskUsageAsync(),
]);
let files = allFiles;
if (clientId) {
@@ -39,7 +42,7 @@ export async function GET(req: NextRequest) {
const stats = CSVStorageManager.formatStorageStats(files);
return NextResponse.json({ stats, files });
return NextResponse.json({ stats, files, diskUsage });
} catch (err: unknown) {
const message = err instanceof Error ? err.message : 'Storage stats failed';
return NextResponse.json({ error: message }, { status: 500 });