fix: resolve pgpass password app-side with original host#361
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughResolvePassword now uses pgpassOriginalHost (falling back to host and "localhost") and pgpassOriginalPort (falling back to connection.port) to call PgpassReader.resolve, returning the found password or an empty string. DatabaseManager injects pgpassOriginalHost/pgpassOriginalPort into additionalFields when usePgpass is true. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Summary
Fixes #356
.pgpasspasswords app-side usingPgpassReaderinstead of delegating to libpq's native pgpass handling, which may resolve hostnames to IPs before matchingadditionalFieldsbefore SSH tunnel rewrites it to127.0.0.1, so pgpass lookup uses the real server hostnameTest plan
.pgpass— should match and connect.pgpass— should match using original host, not127.0.0.1.pgpassentries (*) — should still match.pgpassentry — should fail with auth errorSummary by CodeRabbit