Skip to content

Make PostgreSQL ClickPipe TLS failures actionable - #540

Open
sdairs wants to merge 2 commits into
stack/449-validate-postgres-clickpipefrom
stack/446-clickpipe-tls-guidance
Open

Make PostgreSQL ClickPipe TLS failures actionable#540
sdairs wants to merge 2 commits into
stack/449-validate-postgres-clickpipefrom
stack/446-clickpipe-tls-guidance

Conversation

@sdairs

@sdairs sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • document secure PostgreSQL ClickPipe TLS defaults, conditional PEM CA use, hostname overrides, and source prerequisites in clap help and README examples
  • preserve API errors while adding narrow x509 hints for unknown authorities and hostname mismatches
  • pin rendered help, documentation, diagnostic matching, and subprocess error output

Tests

  • cargo test -p clickhousectl postgres_
  • cargo fmt --all --check
  • cargo clippy -p clickhousectl --all-targets -- -D warnings
  • env DO_NOT_TRACK=1 target/debug/clickhousectl cloud clickpipe create postgres --help

Closes #446

@sdairs

sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Carry-over review from PR #494 (old PR for #446). This PR is the better implementation (pure postgres_tls_error_hint() function, after_help visible in short help, README pinned by an include_str! test, negative cases pinned). One required fix that carries over directly from #494's one review thread:

  1. Restore --publication-name to the publicly trusted README example. On Make PostgreSQL ClickPipe TLS failures actionable #494, macroscope flagged (High) that the PostgreSQL examples omitted --publication-name, pushing users into the API's publication auto-create path which fails with only the documented privileges; sdairs accepted and confirmed the fix: "Fixed in e6befe5… Both PostgreSQL ClickPipe examples now pass --publication-name clickpipes, matching the publication named in the prerequisites." In this PR, the private-CA example includes it, but the publicly trusted example (README.md:~778-784 on the head branch) does not — while the new prerequisites still instruct the user to create a publication covering every mapped table. Add --publication-name to the first example (or document the auto-create privilege requirement) and extend the README pin test to assert it.

  2. Minor: subprocess coverage regressed slightly vs Make PostgreSQL ClickPipe TLS failures actionable #494 — only the unknown-authority path is exercised end-to-end; hostname-mismatch and no-hint cases are unit-only. Consider adding a subprocess case for hostname mismatch. Also note the IP-SAN match is now case-sensitive ("IP SANs") — correct against Go's current x509 string, but slightly less robust to upstream rewording.

@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch from 6e547ae to ef6581c Compare August 26, 2026 18:58
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch 2 times, most recently from 7e0b63c to 7d74870 Compare August 26, 2026 19:03
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch from 7d74870 to 842dae2 Compare August 26, 2026 19:07
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch 2 times, most recently from 71d456e to 8486a08 Compare August 26, 2026 19:12
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch from 8486a08 to e4f1f86 Compare August 26, 2026 19:20
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch from e4f1f86 to 77cc500 Compare August 26, 2026 19:24
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch 2 times, most recently from 6390d98 to c44fe7d Compare August 26, 2026 19:31
@sdairs
sdairs force-pushed the stack/446-clickpipe-tls-guidance branch from 7eec9da to e5e1c9e Compare August 27, 2026 10:51
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.

Make PostgreSQL ClickPipe TLS failures actionable

1 participant