Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?)

Jacob Champion <jacob.champion@enterprisedb.com>

From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Zsolt Parragi <zsolt.parragi@percona.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Chao Li <li.evan.chao@gmail.com>
Date: 2026-03-03T22:08:21Z
Lists: pgsql-hackers

Attachments

On Fri, Feb 27, 2026 at 11:42 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> 0001 should be ready to go. I meant to put 0002 up in its own thread
> at the beginning of the week but got sidetracked, so I'll go do that
> now.

Done at [1].

v5 incorporates that version of the patch in -0002 and makes some
minor test updates for better coverage in -0003.

> 0003 has to wait on Valgrind, and 0004-5 have to wait on 0002.

v5-0006 is my experiment in Valgrind (and also AddressSanitizer, and
also generic pointer poisoning). I think it's interesting, and it
seems clean enough for some subset to be committable for 19. The
weak-symbol support for ASan is the most suspect; I have no idea if it
links correctly across all platforms. It's probably better for me to
propose generic ASan support in utils/memdebug.h at some point in the
future, and drop it from this patch.

I don't plan to block the other patches on -0006, since -0004 is
blocking PGOAUTHCAFILE.

--Jacob

[1] https://postgr.es/m/CAOYmi%2B%3DMHD%2BWKD4rsTn0v8220mYfyLGhEc5EfhmtqrAb7SmC5g%40mail.gmail.com

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. libpq: Allow developers to reimplement libpq-oauth

  2. libpq: Poison the v2 part of a v1 Bearer request

  3. libpq-oauth: Never link against libpq's encoding functions

  4. libpq-oauth: Use the PGoauthBearerRequestV2 API

  5. libpq: Introduce PQAUTHDATA_OAUTH_BEARER_TOKEN_V2

  6. libpq: Add PQgetThreadLock() to mirror PQregisterThreadLock()

  7. oauth: Report cleanup errors as warnings on stderr

  8. oauth_validator: Avoid races in log_check()

  9. libpq-oauth: use correct c_args in meson.build

  10. libpq-fe.h: Don't claim SOCKTYPE in the global namespace