Skip to content

fix(server): resolve DATABASE_URL via ConfigService with robust production guard (closes #172) - #243

Draft
s6pa1rta3n-lab wants to merge 1 commit into
Cylo-Traders:masterfrom
s6pa1rta3n-lab:fix-issue-172
Draft

fix(server): resolve DATABASE_URL via ConfigService with robust production guard (closes #172)#243
s6pa1rta3n-lab wants to merge 1 commit into
Cylo-Traders:masterfrom
s6pa1rta3n-lab:fix-issue-172

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Description

Addresses #172 by ensuring DATABASE_URL is resolved exclusively through ConfigService and validating that local file:-scheme URLs are blocked in production environments.

Payout Stipulations Checklist

  • DatabaseModule resolves DATABASE_URL exclusively through ConfigService, with no direct process.env read remaining.
  • A production-mode guard against the local-file default exists and prevents initializing PrismaClient against file: in production.
  • Unit tests cover assertDatabaseUrlAllowed validation across environments (production vs. development/test).
  • All server CI suites (lint, format check, typecheck, unit tests, build) pass with zero errors.

Changes

  • Updated DatabaseModule to inject ConfigService for DATABASE_URL resolution.
  • Hardened assertDatabaseUrlAllowed to guard against empty/undefined URLs and reject file: URLs in production.
  • Added comprehensive unit tests in server/src/database/database.module.spec.ts.

Verification

  • Ran npm run lint -> Passed
  • Ran npm run format:check -> Passed
  • Ran npm run typecheck -> Passed
  • Ran npm test -> 10/10 test suites passed (123 total tests)
  • Ran npm run build -> Passed

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant