[Agent] Issue #325: rate limiting is planned for post apigen #328

Closed
pook wants to merge 41 commits from agent-task/325 into main
Owner

Closes #325

Changes

feat: issue #325 rate-limiting-is-planned-for-post-apigen (agent task agent-ta)

Acceptance Criteria

Rate limiting is planned for POST /api/generate (issues #296, #303). In production behind a reverse proxy, req.ip returns the proxy IP, not the client IP, making all users share one rate limit bucket.

Implementation:

  1. In the Express app setup (likely src/index.ts or src/app.ts), add BEFORE any rate limiting middleware:
    typescript
    app.set('trust proxy', 1);

  2. Add comment: // Trust first proxy for accurate client IP in rate limiting behind nginx/Cloudflare

  3. Add a test verifying req.ip reflects X-Forwarded-For header when trust proxy is set

Acceptance criteria:

  • app.set('trust proxy', 1) added before rate limiting middleware registration
  • Test proves req.ip extracts from X-Forwarded-For
  • Only trusts first proxy hop (not blindly trusting all proxies)

Generated by CEO Planner (priority: 2)

Tokens: 14 in / 3175 out

Closes #325 ## Changes feat: issue #325 rate-limiting-is-planned-for-post-apigen (agent task agent-ta) ## Acceptance Criteria Rate limiting is planned for POST /api/generate (issues #296, #303). In production behind a reverse proxy, `req.ip` returns the proxy IP, not the client IP, making all users share one rate limit bucket. Implementation: 1. In the Express app setup (likely `src/index.ts` or `src/app.ts`), add BEFORE any rate limiting middleware: typescript app.set('trust proxy', 1); 2. Add comment: `// Trust first proxy for accurate client IP in rate limiting behind nginx/Cloudflare` 3. Add a test verifying `req.ip` reflects X-Forwarded-For header when trust proxy is set Acceptance criteria: - `app.set('trust proxy', 1)` added before rate limiting middleware registration - Test proves req.ip extracts from X-Forwarded-For - Only trusts first proxy hop (not blindly trusting all proxies) --- *Generated by CEO Planner (priority: 2)* Tokens: 14 in / 3175 out
feat: issue #325 rate-limiting-is-planned-for-post-apigen (agent task agent-ta)
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
bdaaee8c83
Author
Owner

Closed 2026-04-10 during pipeline triage.

Merge conflicts with current main were blocking the CEO agent's backlog view. Reopen / resubmit against current main if the work is still relevant — CEO now injects open issues/PRs into its prompt and avoids duplicating.

Closed 2026-04-10 during pipeline triage. Merge conflicts with current main were blocking the CEO agent's backlog view. Reopen / resubmit against current main if the work is still relevant — CEO now injects open issues/PRs into its prompt and avoids duplicating.
pook closed this pull request 2026-04-10 15:06:00 -04:00
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!328
No description provided.