Skip to content

refactor(backend): refactor middleware stack for composability and te…#415

Open
vstudio79 wants to merge 2 commits into
Smartdevs17:mainfrom
vstudio79:refactor/middleware-composability
Open

refactor(backend): refactor middleware stack for composability and te…#415
vstudio79 wants to merge 2 commits into
Smartdevs17:mainfrom
vstudio79:refactor/middleware-composability

Conversation

@vstudio79
Copy link
Copy Markdown

Closes: #364

…st coverage

- Extract inline trace middleware from index.ts into dedicated trace.ts
- Extract inline cache-control middleware into dedicated cache-control.ts
- Create compose.ts utility for async-safe middleware composition
- Create barrel index.ts exporting all middleware from single entry point
- Refactor deprecation.ts to use structured pino logging (instead of console.warn)
- Refactor session.ts to use AppError for centralized error handling
- Create comprehensive test files: requestId, errorHandler, session, slaTracking, validate, requireFlag, idempotency, compose, trace, cache-control
- Each middleware now has single responsibility with centralized error handling
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@vstudio79 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@vstudio79 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

Resolve conflicts in backend/src/index.ts:
- Keep both traceMiddleware and correlationMiddleware/httpLogger
- Remove console wrapping (per main branch)
- Keep cacheControlNoStore after sessionMiddleware
@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 31, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
15742864 Triggered Generic Password a8f1ef7 .github/workflows/migrations.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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.

Refactor backend middleware stack for composability and testability

1 participant