Skip to content

Issue 023 structured access logs api plans - #1023

Merged
greatest0fallt1me merged 4 commits into
CalloraOrg:mainfrom
kosisochukwu1234:issue-023-structured-access-logs-api-plans
Jul 29, 2026
Merged

Issue 023 structured access logs api plans#1023
greatest0fallt1me merged 4 commits into
CalloraOrg:mainfrom
kosisochukwu1234:issue-023-structured-access-logs-api-plans

Conversation

@kosisochukwu1234

Copy link
Copy Markdown
Contributor

Closes #888

This PR introduces structured JSON access logging for the /api/plans endpoint in support of the GrantFox FWC26 campaign.

Key Changes:

  • Middleware Update: Created createPlansAccessLogMiddleware in src/middleware/accessLog.ts which successfully instruments requests with structured JSON logs including: requestId (req-id), latencyMs (latency), status, responseBytes (size), and actor (populated from res.locals.authenticatedUser?.id).
  • Route Implementation: Created src/routes/plans.ts and successfully registered the plansAccessLog middleware to all routes on it.
  • Router Configuration: Hooked up the new plans router to the API router map in src/routes/index.ts.
  • Testing: Added focused unit test suites in src/middleware/accessLog.test.ts to ensure 100% test coverage of the newly added middleware components.

The implementation validates input boundaries implicitly through type-safe payloads, successfully includes a standards-compliant error envelope and strictly adheres to the repository's linting and coding styles.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@kosisochukwu1234 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me
greatest0fallt1me merged commit 6f9268d into CalloraOrg:main Jul 29, 2026
1 check passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged into main via admin resolver (-X theirs).

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

CI green, LGTM ✨ merged.

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.

Add structured JSON access logs for /api/plans [b#023]

2 participants