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

Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>

From: "Jonathan Gonzalez V." <jonathan.abdiel@gmail.com>
To: Jacob Champion <jacob.champion@enterprisedb.com>, Zsolt Parragi <zsolt.parragi@percona.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Chao Li <li.evan.chao@gmail.com>
Date: 2026-03-13T07:18:57Z
Lists: pgsql-hackers
Hello!

On Tue, 2026-03-10 at 09:32 -0700, Jacob Champion wrote:
> On Fri, Mar 6, 2026 at 4:27 PM Jacob Champion
> <jacob.champion@enterprisedb.com> wrote:
> > I'll cherry-pick some of the -1 handling backwards in the patchset
> > to
> > handle this.
> 
> Done in v7-0001. Some of the improvements in the WIP patch were also
> cherry-picked, and I fixed a stray comment bug. -0001 and -0002 are
> next up for commit.
> 

While rebasing this patch[1] I notice that the test where wailing, that
was due to the following missing dependency in the test, small patch
here:

```
diff --git a/src/test/modules/oauth_validator/meson.build
b/src/test/modules/oauth_validator/meson.build
index 915603cbd29..7e52aef7829 100644
--- a/src/test/modules/oauth_validator/meson.build
+++ b/src/test/modules/oauth_validator/meson.build
@@ -97,6 +97,6 @@ tests += {
       'cert_dir': meson.project_source_root() / 'src/test/ssl/ssl',
       'flow_module_path': oauth_flow.full_path(),
     },
-    'deps': [oauth_hook_client],
+    'deps': [oauth_hook_client,oauth_flow],
   },
 }
```



Regards!
[1]
https://www.postgresql.org/message-id/flat/16a91d02795cb991963326a902afa764e4d721db.camel@gmail.com
-- 
Jonathan Gonzalez V. 
EDB: https://www.enterprisedb.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