Repository navigation
feat: Account freeze functionality for security (#490) - #603
Closed
Ade-Pheebs wants to merge 3 commits into
Closed
Ade-Pheebs wants to merge 3 commits into
Ade-Pheebs wants to merge 3 commits into
Conversation
- Add replica_database_url config option read from REPLICA_DATABASE_URL env var - Add replica_database field to AppState - Create DatabaseRouter struct with read_with_fallback and write_with_primary methods - Update get_balances to use DatabaseRouter for replica-aware reads - Write operations (transfers, deposits, etc.) always go to primary database Co-Authored-By: Codebuff <noreply@codebuff.com>
…ion Act (closes The-Engineer-Network#499) - Add GET /v1/export endpoint producing machine-readable JSON archive of user data - Add POST /v1/deletion-request endpoint that anonymises personal data while keeping ledger history intact - Ledger balances remain reconciled after deletion (append-only postings) - Follows existing codebase patterns for formatting and authentication
…work#490) - Add frozen flag, reason, and actor to user_profiles table - Check freeze status in transfers endpoint - Check freeze status in withdrawals endpoint - Check freeze status in conversions endpoint - Check freeze status in naira/SEP-24 endpoints - Check freeze status in payment requests endpoint - Deposits still credited normally even when account frozen
|
@Ade-Pheebs is attempting to deploy a commit to the emmanuel adewunmi'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.
closes #490
Description
This PR implements account freeze functionality across all money-moving endpoints as required by issue #490.
Changes
Migration
0021_freeze.sql: Adds freeze fields touser_profilestable:frozenBOOLEAN (default false)frozen_reasonTEXT (optional reason)frozen_byUUID (references users table - actor who initiated freeze)frozenfor efficient lookupsFreeze checks added to all money-moving endpoints:
GET /v1/transfers- rejects if account is frozenPOST /v1/withdrawals- rejects if account is frozenPOST /v1/convert/quoteandexecute- rejects if account is frozenPOST /v1/naira/deposits- rejects if account is frozenPOST /v1/naira/withdrawals- rejects if account is frozenPOST /v1/payment-requests- rejects if account is frozenKey design decisions:
SELECT frozen FROM user_profiles WHERE id = $1query patternVerification
Implementation Details
The freeze feature allows administrators to stop a compromised account from moving funds across all endpoints while still allowing deposits to be credited. This addresses the security concern in issue #490 where there was "no way to stop a compromised account from moving funds."