Refactor SASL exchange in preparation for OAuth Bearer

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Subject: Refactor SASL exchange in preparation for OAuth Bearer
Date: 2024-02-23 10:30:19
Message-ID: F51F8777-FAF5-49F2-BC5E-8F9EB423ECE0@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached two patches are smaller refactorings to the SASL exchange and init
codepaths which are required for the OAuthbearer work [0]. Regardless of the
future of that patchset, these refactorings are nice cleanups and can be
considered in isolation. Another goal is of course to reduce scope of the
OAuth patchset to make it easier to review.

The first patch change state return from the exchange call to use a tri-state
return value instead of the current output parameters. This makes it possible
to introduce async flows, but it also makes the code a lot more readable due to
using descriptve names IMHO.

The second patch sets password_needed during SASL init on the SCRAM exchanges.
This was implicit in the code but since not all future exchanges may require
password, do it explicitly per mechanism instead.

--
Daniel Gustafsson

[0] d1b467a78e0e36ed85a09adf979d04cf124a9d4b(dot)camel(at)vmware(dot)com

Attachment Content-Type Size
v1-0002-Explicitly-require-password-for-SCRAM-exchange.patch application/octet-stream 2.9 KB
v1-0001-Refactor-SASL-exchange-to-return-tri-state-status.patch application/octet-stream 9.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-02-23 10:44:24 Re: Potential issue in ecpg-informix decimal converting functions
Previous Message Alexander Pyhalov 2024-02-23 10:21:14 ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack