postgresql/src/test/modules/oauth_validator
Thomas Munro 8d9d5843b5 oauth: Use IPv4-only issuer in oauth_validator tests
The test authorization server implemented in oauth_server.py does not
listen on IPv6. Most of the time, libcurl happily falls back to IPv4
after failing its initial connection, but on NetBSD, something is
consistently showing up on the unreserved IPv6 port and causing a test
failure.

Rather than deal with dual-stack details across all test platforms,
change the issuer to enforce the use of IPv4 only. (This elicits more
punishing timeout behavior from libcurl, so it's a useful change from
the testing perspective as well.)

Author: Jacob Champion <jacob.champion@enterprisedb.com>
Reported-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CAOYmi%2Bn4EDOOUL27_OqYT2-F2rS6S%2B3mK-ppWb2Ec92UEoUbYA%40mail.gmail.com
2025-03-19 16:45:01 +13:00
..
t oauth: Use IPv4-only issuer in oauth_validator tests 2025-03-19 16:45:01 +13:00
.gitignore Add missing entry to oauth_validator test .gitignore 2025-02-20 21:29:21 +01:00
fail_validator.c
magic_validator.c
Makefile
meson.build
oauth_hook_client.c
README
validator.c

Test programs and libraries for OAuth
-------------------------------------

This folder contains tests for the client- and server-side OAuth
implementations. Most tests are run end-to-end to test both simultaneously. The
tests in t/001_server use a mock OAuth authorization server, implemented jointly
by t/OAuth/Server.pm and t/oauth_server.py, to run the libpq Device
Authorization flow. The tests in t/002_client exercise custom OAuth flows and
don't need an authorization server.

Tests in this folder require 'oauth' to be present in PG_TEST_EXTRA, since
HTTPS servers listening on localhost with TCP/IP sockets will be started. A
Python installation is required to run the mock authorization server.