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, 23 Sep 2026 06:43:34 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc4079734725@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/core/v3/OAuthHandshakeTest.java:93)
Every handshake here runs with `oauthAllowInsecureConnection=true`, and so does every OAuth success path in CI (`TestUtil.addOAuthProperties`). Mutation testing shows the consequence: forcing the flag to `true` in `ConnectionFactoryImpl`, or making `true` its default in `PGProperty`, passes every test.
Please add a handshake without the flag over plaintext that is refused with `CONNECTION_REJECTED` and whose backend receives no SASLInitialResponse. Please also add an integration test of the production configuration: `sslmode=verify-full` with the test certificates.
Other gaps in this class, each a surviving mutant or an untested sequence: a successful OAUTHBEARER exchange with `requireAuth=oauth`; a second AuthenticationSASLContinue after the error; a second AuthenticationSASL during SCRAM. In `refusesASecondSaslExchange`, `&password=secret` and the extra `authenticationSaslContinue()` do nothing, because the check fires before anything is read. `refusesSaslFinalAfterTheServerRejectedTheToken` hit its 30-second timeout once when run under load.