Repository navigation
Add resilience, performance, integrity, and MFA controls - #233
Merged
OsagieCynthia merged 1 commit intoNov 23, 2026
Merged
OsagieCynthia merged 1 commit into
OsagieCynthia merged 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@k-deejah 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! 🚀 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
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.
📝 Description
Adds deterministic resilience coverage, critical-path performance gates, database integrity checks, and optional TOTP/SMS two-factor authentication to address the four reported validation and authentication gaps.
🎯 Type of Change
🔗 Related Issues
Closes #142
Closes #141
Closes #140
Closes #126
📋 Changes Made
🧪 Testing
Test Coverage
Passed:
pnpm --dir backend exec jest --runInBand src/modules/auth/auth.comprehensive.spec.ts src/modules/auth/services/mfa.service.spec.ts src/modules/auth/guards/mfa-enforcement.guard.spec.ts src/modules/auth/rbac.spec.ts src/modules/auth/__tests__/auth-endpoint-security.spec.ts src/modules/notifications/sms-gateway.service.spec.ts src/modules/payments/payment.controller.spec.ts src/database/consistency-checker.spec.ts src/common/resilience/retry.service.spec.ts src/common/resilience/circuit-breaker.service.spec.ts— 10 suites, 122 tests.pnpm --dir backend run test:chaos:unit— 3 suites, 15 tests.pnpm --dir backend run test:perf-critical— 7 tests.pnpm --dir backend exec eslint src/database/consistency-checker.ts src/database/consistency-checker.spec.ts src/modules/auth/auth.controller.ts src/modules/auth/auth.service.ts src/modules/auth/dto/enable-mfa.dto.ts src/modules/auth/dto/request-mfa-sms-code.dto.ts src/modules/auth/entities/mfa-device.entity.ts src/modules/auth/guards/admin.guard.ts src/modules/auth/guards/mfa-enforcement.guard.ts src/modules/auth/guards/mfa-enforcement.guard.spec.ts src/modules/auth/guards/roles.guard.ts src/modules/auth/rbac.spec.ts src/modules/auth/__tests__/auth-endpoint-security.spec.ts src/modules/auth/services/mfa.service.ts src/modules/auth/services/mfa.service.spec.ts src/modules/auth/strategies/jwt.strategy.ts src/modules/notifications/notifications.module.ts src/modules/notifications/sms-gateway.service.ts src/modules/notifications/sms-gateway.service.spec.ts src/modules/payments/payment.controller.ts src/modules/payments/payment.controller.spec.ts src/modules/payments/payment.module.ts migrations/1950000000000-AddPendingMfaStatus.ts test/chaos-resilience.e2e-spec.ts test/database-consistency.e2e-spec.ts src/common/resilience/retry.service.spec.ts src/common/resilience/circuit-breaker.service.spec.ts— passed with no warnings.Not passing or not run:
pnpm --dir backend run build— fails on pre-existing TypeScript parse/type errors in untouched files, includingsrc/app.module.ts,src/health/health.controller.ts,src/main.ts, andsrc/modules/disputes/disputes.service.ts.pnpm --dir backend run lint— fails on pre-existing parse/type errors in untouched files (and reports existing warnings).backend/,pnpm exec jest --config ./test/jest-e2e.json --runInBand --runTestsByPath test/database-consistency.e2e-spec.ts— blocked because the dedicated PostgreSQL service refused connections atlocalhost:5433; no schema was created.BENCHMARK_BASE_URLis not configured in this environment. CI runs them when that variable is configured; authenticated scenarios also requireBENCHMARK_TOKEN.📊 Checklist
Code Quality
Testing
make check/cargo test)Documentation
Database (Backend only)
Security
Performance
Breaking Changes
📸 Screenshots/Demo
Not applicable; this change adds backend services, checks, and CI workflows.
🚀 Deployment Notes
Apply the pending MFA migration. Configure
SECURITY_ENCRYPTION_KEYfor TOTP,SMS_GATEWAY_URLandSMS_GATEWAY_API_KEYfor SMS, andHIGH_VALUE_PAYMENT_THRESHOLDas needed. For scheduled production integrity checks, set repository variablePRODUCTION_DATABASE_CHECK_ENABLED=trueand secretPRODUCTION_DATABASE_URL. To run live performance benchmarks in CI, configureBENCHMARK_BASE_URL,BENCHMARK_TOKEN, and optionallyBENCHMARK_BASELINE_FILE.📖 Additional Context
SECURITY_ENCRYPTION_KEYis used for AES-256-GCM TOTP storage; existing CBC-encrypted MFA secrets remain readable. The payment invariant is lease-term-aware because valid multi-month leases contain monthly rent installments.🔄 Reviewer Checklist