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-rc3970363287@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4251@github.com>
References: <gh-pgjdbc-pgjdbc-4251@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/OAuthAuthenticator.java)
`ScramAuthenticator` next door is a package-private `final class`, and this one is `public` only because `OAuthAuthenticatorTest` sits in `org.postgresql.test.core.v3` rather than in `org.postgresql.core.v3`, where its sibling `ScramAuthenticatorChannelBindingTest` sits in the same module. Moving the test into that package lets the class go back to package-private and keeps a new type out of the published surface of `org.postgresql.core.v3`.
The class comment is also the place to say what the constructor does, since it is the one that enforces the transport requirement and throws. Something like: `Writes the client side of the OAUTHBEARER SASL exchange (RFC 7628) onto a PGStream. One instance serves one authentication attempt, and the constructor enforces the encryption requirement, so a caller holding an instance may send the token.`