| From: | Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?) |
| Date: | 2026-01-27 17:36:11 |
| Message-ID: | CAOYmi+m8+gH2SpkiR6qJR3qwbqdkBEw0QsFbiioz4eVDDrbQsg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Jan 26, 2026 at 4:06 AM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
> Wouldn't it be simpler to do all that validation at the server side,
> and for libpq to simply compare that what the user specified for the
> connection and what the server sent are the same?
No, I don't think so. That opens up the possibility of a third-party
server implementation breaking the OAUTHBEARER rules and libpq failing
to call them out on it.
> My question should have been: shouldn't the plugin api work at the
> SASL level instead of a specific OAuth level?
IMO, yes, but I don't imagine that most people want to pick a SASL
plugin to switch OAuth flows. They just want their flow to match the
use case and move on.
> Or even if the first
> iteration of the internal API would only allow it to modify the OAuth
> flow, shouldn't the public facing configuration (env var / connection
> string / anything) be something more generic?
I think these are two different use cases that _could_ be handled with
the same knob but probably _should_ not be (see above).
> How, and when would I use this (oauth limited, differently configured)
> plugin API instead of the authdata hook? And I can't think of any good
> use cases outside the command line tools included with postgres.
That's exactly the use case. (Also, library clients of postgres that
should not install application hooks, other monolithic utilities that
link against libpq, etc.) Who wants to recompile their clients just to
switch how they get a token?
--Jacob
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2026-01-27 17:38:40 | Re: Report bytes and transactions actually sent downtream |
| Previous Message | Laurenz Albe | 2026-01-27 17:21:11 | Re: Add SECURITY_INVOKER_VIEWS option to CREATE DATABASE |