Skip to content

Add authenticated admin auth guard for DLQ and deploy operator endpoints #283

@mikewheeleer

Description

@mikewheeleer

Description

Operator surfaces such as the DLQ in src/api/jobs.ts and any deploy-status endpoints must require admin authentication. Add an auth guard with API-key/JWT verification so unauthenticated callers cannot inspect or replay webhook payloads.

Requirements and context

  • Verify API key or JWT (jsonwebtoken) with constant-time key comparison; reject with safe 401/403.
  • Apply to DLQ list/replay and deploy/status routes registered in router.ts/app.ts.
  • Redact credentials in logs via redact.ts; document required env and key rotation.
  • Acceptance: integration tests cover missing, invalid, and valid credentials for each protected route.

Suggested execution

  • Fork the repo and create a branch:
    • git checkout -b security/admin-auth-guard
  • Implement changes:
    • src/api/jobs.ts
    • Tests: src/api/jobs.dlq.test.ts
    • Docs: docs/api-keys.md
    • Include TSDoc/NatSpec-style doc comments
    • Validate security assumptions (input validation, auth, signature verification, secret redaction, idempotency)

Test and commit

  • Run tests: npm test (coverage: npm run test:ci)
  • Cover edge cases
  • Include test output and security notes in the PR

Example commit message

feat(security): require admin auth on DLQ and deploy endpoints

Guidelines

  • Minimum 95% line coverage on new/changed code
  • No secrets in repo; use .env + deployment secrets only
  • Clear documentation
  • Timeframe: 96 hours from assignment

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions