- Add Foundry project configuration (foundry.toml, foundry.lock) - Add Solidity contracts (TokenFactory138, BridgeVault138, ComplianceRegistry, etc.) - Add API definitions (OpenAPI, GraphQL, gRPC, AsyncAPI) - Add comprehensive test suite (unit, integration, fuzz, invariants) - Add API services (REST, GraphQL, orchestrator, packet service) - Add documentation (ISO20022 mapping, runbooks, adapter guides) - Add development tools (RBC tool, Swagger UI, mock server) - Update OpenZeppelin submodules to v5.0.0
22 lines
597 B
TypeScript
22 lines
597 B
TypeScript
/**
|
|
* Idempotency middleware
|
|
* Ensures requests with same idempotency key are only processed once
|
|
*/
|
|
|
|
import { Request, Response, NextFunction } from 'express';
|
|
// import { redisClient } from '../services/redis';
|
|
|
|
export async function idempotencyMiddleware(req: Request, res: Response, next: NextFunction) {
|
|
const idempotencyKey = req.headers['idempotency-key'] as string;
|
|
|
|
if (!idempotencyKey) {
|
|
return next();
|
|
}
|
|
|
|
// TODO: Check Redis for existing response
|
|
// TODO: Store response in Redis for replay
|
|
// For now, pass through (will be implemented in Phase 6)
|
|
next();
|
|
}
|
|
|