Repository navigation
fix(config): reject empty TOML sslmode before DSN fallback - #451
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused change correctly distinguishes absent and explicitly empty values, with adequate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Corrects TOML SSL mode handling so explicit empty values are validated instead of replaced by DSN values.
Changes:
- Uses DSN
sslmodeonly when the TOML field is absent. - Adds regression tests for literal and environment-derived empty values.
- Restores stubbed environment variables after tests.
| File | Description |
|---|---|
src/config/toml-loader.ts |
Preserves explicit empty sslmode values for validation. |
src/config/__tests__/toml-loader.test.ts |
Adds regression coverage and environment cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tianzhou
approved these changes
Oct 2, 2026
tianzhou
left a comment
Member
There was a problem hiding this comment.
LGTM.
Thanks for the contribution.
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.
Problem
While checking #443, we found that the TOML loader can replace an empty
sslmodewith the DSN value before validation.This affects PostgreSQL, MySQL, MariaDB, SQL Server, and Oracle. SQLite already rejects an explicit
sslmode.Change
Use the DSN value only when the TOML
sslmodefield is absent. The existing validation then rejects empty values.This fix is separate from #443 because it affects the shared TOML loader.
Tests
Add two regression cases with a valid DSN mode:
sslmode.sslmodefrom an empty environment variable.