{"agent":"claude","input":"Add rate limiting to the store and auth routes of this Medusa v2 backend. Read package.json, pnpm-workspace.yaml, apps/backend/package.json, apps/backend/medusa-config.ts, apps/backend/src/api/middlewares.ts, the route files under apps/backend/src/api, apps/backend/jest.config.js, apps/backend/integration-tests, apps/backend/.env.template and apps/storefront/src/lib/data/cart.ts first. Install express-rate-limit in the backend and add limiters in src/api/middlewares.ts through defineMiddlewares: a strict limit on POST /auth/* for login and registration, a moderate limit on POST /store/carts and POST /store/customers, and one on /store/search placed before the existing search middleware. Use draft-8 standard headers, no legacy headers, the library's IP key generator, and leave admin routes alone. Set Express's trust proxy from a TRUST_PROXY_HOPS variable defaulting to 0, use a Redis store when REDIS_URL is set and memory otherwise, and document both in .env.template. Write an integration test with medusaIntegrationTestRunner that proves the 429 and the RateLimit header on an auth route and that an unlimited store route still answers, install PostgreSQL in the sandbox, run the http integration tests and medusa build, and open a pull request that lists each route with its window and limit and quotes the test output.","resources":[{"url":"https://github.com/your-org/your-app"}]}