Initial project setup: Add contracts, API definitions, tests, and documentation
- 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
This commit is contained in:
21
api/services/rest-api/src/middleware/idempotency.ts
Normal file
21
api/services/rest-api/src/middleware/idempotency.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user