From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4251: OAuth implementation
Date: Wed, 09 Sep 2026 15:45:36 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc3970363361@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4251@github.com>
References: <gh-pgjdbc-pgjdbc-4251@github.com>
(on pgjdbc/src/test/java/org/postgresql/test/jdbc4/OAuthTest.java:210)
`requireAuthForbidsOAuth` twenty lines up carries the rule for this file: "Assert only on the SQL state: the message is localized via GT.tr and varies by JVM locale." This assertion breaks it, and so does the one in `OAuthAuthenticatorTest` line 115. Both pass today only because the strings have not reached any `.po` file yet, and the matrix runs tests under `de_DE`, `fr_FR`, `ru_RU` and `tr_TR`. On my machine the neighbouring translated message already comes back as `Метод аутентификации запрещён настройкой requireAuth`.
`requireAuthForbidsOAuth` has the opposite problem: `CONNECTION_REJECTED` is returned by three other refusals on this path, including the transport check and `none of them configured or supported by the driver`, so on a host where `sslmode=prefer` gets no TLS it would stay green with the `AuthMethod.isAllowed` check deleted. A unit test over `AuthMethod.isAllowed` pins that behavior without a server and without depending on message text.