fix(docker): ship libpq-oauth-18.so and libcurl for PostgreSQL 18 OAuth#9952
Conversation
libpq 18 dlopens libpq-oauth-18.so (the SASL OAUTHBEARER flow plugin) when connecting to a server with an `oauth` pg_hba.conf rule. The container previously copied only libpq.so.5.18 from postgres:18-alpine and omitted both the plugin and its libcurl runtime dependency, so OAuth connections failed with "no OAuth flows are available (try installing the libpq-oauth package)" before any token exchange could begin. Add libpq-oauth-18.so to the existing pg18-builder COPY (it sits next to libpq.so.5.18 in /usr/local/lib in postgres:18-alpine) and install the libcurl apk package so the plugin can dlopen libcurl.so.4 at runtime. Closes pgadmin-org#9951
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Dockerfile is updated to enable PostgreSQL 18 SASL OAUTHBEARER authentication support in the final runtime image by adding the ChangesDocker Runtime Dependencies for PostgreSQL 18 OAuth Support
🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
dpage/pgadmin4container image shipslibpq.so.5.18but notlibpq-oauth-18.so, the SASLOAUTHBEARERflow plugin that libpq 18 dlopens when a server uses anoauthpg_hba.confrule. The plugin's runtime dependencylibcurl.so.4is also missing.no OAuth flows are available (try installing the libpq-oauth package)before the flow can begin.libpq-oauth-18.soto the existingCOPY --from=pg18-builderline (it sits next tolibpq.so.5.18in/usr/local/libinpostgres:18-alpine, built for the same Alpine/musl ABI) and installs thelibcurlapk package solibcurl.so.4is present for the plugin to dlopen at runtime.Scope is intentionally limited to the packaging gap that makes the plugin unloadable. libpq-oauth's only implemented flow is device-authorization (RFC 8628), and surfacing its
Visit https://… and enter the code: XXX-YYYprompt to the pgAdmin web UI is a separate, larger piece of work (PQauthDataHookplus front-end changes) outside the scope of this fix.Test plan
check-container-buildCI workflow builds the image successfully.ctypes.CDLL("/usr/lib/libpq-oauth-18.so")succeeds, and connecting to a PostgreSQL 18 server with anoauthpg_hba.confrule reaches the OAuth flow instead of failing with "no OAuth flows are available".Closes #9951
Summary by CodeRabbit