Skip to content

fix(backend): mount auditLogsRouter in app.ts, add rate limit bucket,… - #693

Closed
kosisochukwu1234 wants to merge 1 commit into
codebestia:mainfrom
kosisochukwu1234:fix/mount-audit-logs-router
Closed

kosisochukwu1234 wants to merge 1 commit into
codebestia:mainfrom
kosisochukwu1234:fix/mount-audit-logs-router

Conversation

@kosisochukwu1234

Copy link
Copy Markdown

Description

Resolves an issue where GET /audit-logs was unreachable (returning 404 on the running Express server) because auditLogsRouter was defined in apps/backend/src/routes/auditLogs.ts but never mounted in apps/backend/src/app.ts.

Summary of Changes:

  1. Mount Route: Mounted app.use('/audit-logs', auditLogsRouter) in apps/backend/src/app.ts after the global rate limiter and security router.
  2. Rate Limiting: Added audit_logs bucket (30 / min) to apps/backend/src/config/rateLimits.ts and attached rateLimit('audit_logs') to auditLogsRouter.
  3. Query Parsing: Replaced hand-parsed action, limit, and cursor query parameters with AuditLogsQuerySchema (using Zod) while preserving existing 400 response formats for unknown action filters.
  4. Docs & Tests: Documented the new rate limit bucket in docs/security/rate-limits.md and added a test in apps/backend/src/__tests__/auditLog.test.ts requesting /audit-logs through app to verify reachability.

Closes #648

@github-actions

Copy link
Copy Markdown

👋 Hi @kosisochukwu1234, thanks for your contribution!

Pull requests from contributors must target the dev branch — only the repo maintainer merges into main.

This PR is being closed automatically. Please open a new PR (or retarget this one by reopening it after editing the base branch) against dev.

@github-actions github-actions Bot closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET /audit-logs is unreachable: auditLogsRouter is not mounted in app.ts

1 participant