Repository navigation
fix(backend): address issues #249, #250, #251, #252 - #439
Merged
Merged
Conversation
…rflexx#252 - arflexx#249: Mask phone numbers and include phoneHash on GET /api/v1/admin/users/:phone, and normalise phone lookup parameter - arflexx#250: Add Idempotency-Key support on POST /api/v1/trades with 24-hour response caching - arflexx#251: Require Redis in production, fail fast if Redis unavailable at startup, and persist velocity counters - arflexx#252: Require OTP verification on POST /api/v1/auth/recover/change-phone and invalidate recovery token immediately
|
@GF-Hunter 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! 🚀 |
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.
Summary
This PR addresses backend issues #249, #250, #251, and #252.
Changes Included
Issue [backend] - GET /api/v1/admin/users/:phone exposes full phone number without masking #249: Mask phone number on
GET /api/v1/admin/users/:phonephonein the response withmaskedPhoneusing the existingmaskPhonehelper function.phoneHash(first 8 characters of SHA-256 hex digest) to support non-PII lookups and indexing.:phoneroute parameter before DB query vianormalizePhoneto prevent enumeration and format discrepancies.Issue [backend] - No idempotency key support on POST /api/v1/trades — duplicate submissions create duplicate on-chain listings #250: Idempotency-Key support on
POST /api/v1/tradesIdempotency-Keyheader on trade creation.create_listingcontract call or inserting duplicate records.Issue [backend] - fraudDetection.checkVelocity uses in-memory cache which resets on restart, defeating rate-limiting across replicas #251: Shared Redis persistence and startup check for
fraudDetection.checkVelocityvalidateEnvto requireREDIS_URLin production.cache.checkReady()with PING test); if Redis is unavailable at startup, the server logsFATALand terminates with exit code 1.fatallog level to custom structured logger.Issue [backend] - POST /api/v1/auth/recover/change-phone issues session JWT without verifying new phone ownership via OTP #252: Require OTP verification on
POST /api/v1/auth/recover/change-phonePOST /api/v1/auth/verify-otpbefore receiving their session JWT.Closes #249
Closes #250
Closes #251
Closes #252