chore: sync submodule state (parent ref update)

Made-with: Cursor
This commit is contained in:
defiQUG
2026-03-02 12:14:07 -08:00
parent 6c4555cebd
commit 89b82cdadb
883 changed files with 78752 additions and 18180 deletions

View File

@@ -0,0 +1,29 @@
/**
* Admin Central API auth middleware
* Used for service-to-service calls from orchestration portal, token-aggregation, multi-chain-execution.
* Expects X-Admin-Central-Key header to match ADMIN_CENTRAL_API_KEY env.
*/
import { Request, Response, NextFunction } from 'express';
export function requireAdminCentralKey(req: Request, res: Response, next: NextFunction): void {
const key = req.headers['x-admin-central-key'] as string | undefined;
const expected = process.env.ADMIN_CENTRAL_API_KEY;
if (!expected) {
// If not configured, allow (dev) or deny (prod). Prefer deny for security.
return res.status(501).json({
success: false,
error: { code: 'NOT_CONFIGURED', message: 'Admin central API key not configured' },
});
}
if (!key || key !== expected) {
return res.status(401).json({
success: false,
error: { code: 'UNAUTHORIZED', message: 'Invalid or missing X-Admin-Central-Key' },
});
}
next();
}