Skip to content

#244 passwords containing url reserved characters cause invalid port number error - #249

Merged
nettrash merged 1 commit into
v1.0.27from
244-passwords-containing-url-reserved-characters-cause-invalid-port-number-error
Sep 6, 2026
Merged

nettrash merged 1 commit into
v1.0.27from
244-passwords-containing-url-reserved-characters-cause-invalid-port-number-error

Conversation

@nettrash

@nettrash nettrash commented Sep 6, 2026

Copy link
Copy Markdown
Owner

closes #244

@nettrash nettrash added this to the v1.0.27 milestone Sep 6, 2026
@nettrash nettrash self-assigned this Sep 6, 2026
Copilot AI lite review requested due to automatic review settings September 6, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change addresses the documented root cause by removing URL parsing from the credential path and adds targeted unit, live, and CI coverage to prevent regressions.

Pull request overview

Fixes issue #244 where passwords containing RFC 3986 URL-reserved characters (e.g., #, /, ?, %, @) caused pgc --command dump to fail during URL parsing (often surfaced as the misleading invalid port number) by eliminating URL-based connection construction and switching to sqlx::PgConnectOptions.

Changes:

  • Replace postgres://... string construction with DumpConfig::get_connect_options() returning PgConnectOptions and use connect_with(...) for database connections.
  • Update and expand unit/integration tests to assert credentials are not rewritten (including %41 not being percent-decoded).
  • Add a CI workflow step that exercises the reserved-character password scenario against a live PostgreSQL instance.
File summaries
File Description
CHANGELOG Documents the issue #244 fix and its impact/behavior change.
app/tests/live_database.rs Adds an ignored live-db test ensuring reserved-character passwords authenticate as typed.
app/src/dump/core.rs Switches connection setup to connect_with(PgConnectOptions) and improves config-error reporting.
app/src/config/tests/dump_config.rs Reworks tests to validate PgConnectOptions behavior and pins the legacy URL lossy behavior.
app/src/config/dump_config.rs Introduces get_connect_options() using PgConnectOptions::new_without_pgpass() with explicit port parsing.
.github/workflows/rust.yml Adds CI coverage for the reserved-character password case by creating a role and dumping as it.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nettrash
nettrash merged commit daba4eb into v1.0.27 Sep 6, 2026
17 checks passed
@nettrash
nettrash deleted the 244-passwords-containing-url-reserved-characters-cause-invalid-port-number-error branch September 6, 2026 08:23
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.

2 participants