Repository navigation
Conversation
…n decimal precision, and add overdraft protection
…aft-protection fix(security,api): harden auth tokens, resolve audit advisories, widen decimal precision, and add overdraft protection
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.
This pull request introduces several important improvements and security enhancements to the authentication system, schema precision, and exports. The main highlights are the implementation of a secure, single-use password reset flow with OTP attempt tracking and lockout, increased decimal precision for financial data, and new rate limiting for OTP verification. Additionally, the PDF export now limits the number of transactions exported. Comprehensive tests have been added to cover the new authentication logic.
Authentication Security & Features:
src/modules/auth/auth.service.ts,src/modules/auth/auth.otp.test.ts, [1] [2].src/modules/auth/auth.service.ts,src/modules/auth/auth.otp.test.ts, [1] [2]./verify-otpendpoint, keyed by IP and normalized email, with tests (src/modules/auth/auth.routes.ts,src/modules/auth/authRateLimit.ts,src/modules/auth/authRateLimit.test.ts, [1] [2] [3].ACCESS_TOKEN_SECRETandREFRESH_TOKEN_SECRET(src/config/env.ts, src/config/env.tsR20-R38).Database Schema Precision:
DECIMAL(10,2)toDECIMAL(16,2)to support larger balances and amounts (prisma/schema.prisma,prisma/migrations/202609300001_decimal_16_2_precision/migration.sql, [1] [2].Exports:
src/modules/exports/pdfService.ts, [1] [2].Other minor changes include test improvements and small code style adjustments.