pgsql: oauth: Add TLS support for oauth_validator tests

From: Jacob Champion <jchampion(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: oauth: Add TLS support for oauth_validator tests
Date: 2026-03-05 18:12:03
Message-ID: E1vyDB5-002YEk-0M@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

oauth: Add TLS support for oauth_validator tests

The oauth_validator tests don't currently support HTTPS, which makes
testing PGOAUTHCAFILE difficult. Add a localhost certificate to
src/test/ssl and make use of it in oauth_server.py.

In passing, explain the hardcoded use of IPv4 in our issuer identifier,
after intermittent failures on NetBSD led to commit 8d9d5843b. (The new
certificate is still set up for IPv6, to make it easier to improve that
behavior in the future.)

Patch by Jonathan Gonzalez V., with some additional tests and tweaks by
me.

Author: Jonathan Gonzalez V. <jonathan(dot)abdiel(at)gmail(dot)com>
Discussion: https://postgr.es/m/8a296a2c128aba924bff0ae48af2b88bf8f9188d.camel@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a6483f5ac9680801da0c8ad207c2870c0d6a61c2

Modified Files
--------------
src/test/modules/oauth_validator/Makefile | 1 +
src/test/modules/oauth_validator/meson.build | 1 +
src/test/modules/oauth_validator/t/001_server.pl | 51 ++++++++++++++++++----
src/test/modules/oauth_validator/t/OAuth/Server.pm | 7 ++-
src/test/modules/oauth_validator/t/oauth_server.py | 22 +++++++++-
.../ssl/conf/server-localhost-alt-names.config | 20 +++++++++
src/test/ssl/ssl/server-localhost-alt-names.crt | 20 +++++++++
src/test/ssl/ssl/server-localhost-alt-names.key | 28 ++++++++++++
src/test/ssl/sslfiles.mk | 1 +
9 files changed, 136 insertions(+), 15 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-03-05 19:43:39 pgsql: Exit after fatal errors in client-side compression code.
Previous Message Alexander Korotkov 2026-03-05 18:08:13 pgsql: Fix handling of updated tuples in the MERGE statement