harbor run -t openthoughts/tasktrove-exp-rpt-pr-v2-pr-3062harbor download openthoughts/tasktrove-exp-rpt-pr-v2-pr-3062This task adds a compact Express-based API flow that emulates a two-step signed-payload workflow. The flow should: (1) receive an initial signed payload and return a STEP1 token, and (2) validate the signed payload with the STEP1 token to issue a final STEP2 JWT. Client credentials are read from configuration, enabling a local, JWT-authenticated API user workflow suitable for benchmarking.
local-jwt-authenticated-api-user-workflow--express--benchmark.Below is what you need to implement, described in behavior and outcomes (not as exact code patches).
# Placeholder — original code before the change
pass
Add or modify the following files to implement the flow:
/app/server.js (or /app/index.js)
/app/routes/stepAuth.js (or /app/controllers/authController.js)
/app/utils/jwtHelper.js (or equivalent)
/app/config/credentials.js (or use /app/.env)
Optional: /app/middleware/validatePayload.js
Optional: /app/health.js
Documentation within the codebase (README or in-code comments)
Manual flow:
Automated lite checks (optional but recommended):
Health checks:
If you need a starter skeleton or preferred file layout (e.g., all routes under /app/routes and utilities under /app/utils), indicate your preference and I can adapt the guidance accordingly.