From: davecramer (@davecramer) <noreply+davecramer@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4251: OAuth implementation
Date: Sat, 08 Aug 2026 12:23:09 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-c5226084105@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4251@github.com>
References: <gh-pgjdbc-pgjdbc-4251@github.com>
Latest review from aI
---
Comment 1 (on the platform: linux/amd64 line in docker/postgres-server/docker-compose.yml):
This pins the architecture unconditionally on the pgdb service, but the TODO right above it makes clear the constraint comes entirely from pg_oidc_validator's amd64-only
nightly builds. As written, every containerized test run inherits the pin, so anyone using docker/bin/postgres-server for ordinary non-OAuth testing on arm64 (Apple Silicon,
etc.) now gets full Postgres emulation, which is slow and can mask arch-specific behaviour. Since the amd64 requirement is purely an OAuth artifact, could this ride the same
OAUTH/oauth profile condition as the rest of the OAuth infra rather than applying to all local runs? On the CI runners it's a no-op either way, so this only costs local arm64
users.
---
Comment 2 (general PR comment, nits):
A few minor things, none blocking:
1. testkit/.../TestUtil.java, addOAuthProperties: new Properties(props) installs props as the defaults map rather than copying its entries. It works here because the driver
reads via propertyNames(), which walks defaults, but it's the classic Properties footgun (entrySet()/stringPropertyNames() treat defaults differently) and reads as if it were
a shallow copy. new Properties(); putAll(props) would express the intent without the subtlety.
2. pgjdbc/.../jdbc4/OAuthTest.java: the new String(provider.getToken(...)) calls create an immortal heap copy of the token, defeating the char[]-wipe guarantee the SPI and
driver otherwise maintain. Test-only so the risk is nil, but a short comment noting it's acceptable only because this is test code would keep users from copying the pattern.
3. pgjdbc/.../core/v3/ConnectionFactoryImpl.java, OAuth AUTH_REQ_SASL branch: since the branch requires isOAuthConfigured and resolveOAuthToken never returns null/empty, the
if (oauthToken != null) guards, sendDummyResponse(), and the discovery path are inert until the follow-up discovery PR. Consistent with the staged plan; a one-line
"scaffolding for discovery" note would save a future reader some hunting.
---