Feature/rate limit hardening#675
Open
saidai-bhuvanesh wants to merge 6 commits into
Open
Conversation
added 6 commits
June 5, 2026 12:31
|
Someone is attempting to deploy a commit to the adithyansubramani1-1657's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
security: implement rate limiting, audit logging, validation hardening, and backend reliability improvements
Summary
This PR delivers a comprehensive backend security, reliability, and performance upgrade for Brownie-Bliss.
The changes focus on protecting critical APIs from abuse, strengthening authentication and OTP workflows, improving order integrity, adding audit traceability for administrative actions, optimizing database access patterns, and expanding automated test coverage.
Key Improvements
Security Hardening
Added centralized rate limiting for:
Enforced JWT verification using explicit HS256 algorithm validation.
Added structured request validation using Zod schemas.
Strengthened OTP verification with:
Order Integrity & Reliability
Audit Logging System
Added immutable AuditLog model.
Implemented centralized audit logging service.
Added audit events for:
Added protected audit log retrieval endpoint.
Implemented automatic retention cleanup using TTL indexes.
Database Performance
Added indexes for:
Refactored dashboard statistics endpoint to use a single $facet aggregation pipeline.
Reduced database round trips and improved query efficiency.
API Validation Improvements
Added Zod validation schemas for:
Improved validation error consistency.
Improved API safety against malformed requests.
Error Handling Improvements
Testing
Added backend integration tests covering:
Impact
Verification