Skip to content

Commit 116e4e8

Browse files
committed
chore: Address code comments
1 parent 615a258 commit 116e4e8

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPostQuantumCryptography.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.google.api.client.http.javanet.NetHttpTransport;
2323
import com.google.api.gax.core.NoCredentialsProvider;
2424
import com.google.api.gax.httpjson.HttpJsonMetadata;
25-
import com.google.api.gax.httpjson.HttpJsonTransportUtils;
25+
import com.google.api.gax.httpjson.HttpJsonConscryptUtils;
2626
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
2727
import com.google.showcase.v1beta1.EchoClient;
2828
import com.google.showcase.v1beta1.EchoRequest;
@@ -178,7 +178,7 @@ void testHttpJsonPqc_withExplicitClassicalGroupsNoPqc() throws Exception {
178178
// This test explicitly configures non-PQC classical groups (X25519, SecP256r1) on Conscrypt
179179
// to verify that the client falls back gracefully to classical TLS key exchange.
180180
NetHttpTransport transport =
181-
HttpJsonTransportUtils.configureConscryptSecurityProvider(new NetHttpTransport.Builder())
181+
HttpJsonConscryptUtils.configureConscryptSecurityProvider(new NetHttpTransport.Builder())
182182
.setSslSocketConfigurator(
183183
socket -> {
184184
if (Conscrypt.isConscrypt(socket)) {

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonTransportUtils.java renamed to sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonConscryptUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838

3939
/** Utility class for creating and configuring {@link NetHttpTransport} instances. */
4040
@InternalApi
41-
public class HttpJsonTransportUtils {
41+
public class HttpJsonConscryptUtils {
4242

43-
private static final Logger LOG = Logger.getLogger(HttpJsonTransportUtils.class.getName());
43+
private static final Logger LOG = Logger.getLogger(HttpJsonConscryptUtils.class.getName());
4444

4545
/**
4646
* Default TLS 1.3 Post-Quantum Cryptography (PQC) named groups configured when Conscrypt security
@@ -125,9 +125,9 @@ public static NetHttpTransport.Builder configureConscryptSecurityProvider(
125125
*
126126
* @return the Conscrypt provider or null
127127
*/
128-
public static Provider getConscryptProvider() {
128+
static Provider getConscryptProvider() {
129129
return ConscryptProviderHolder.INSTANCE;
130130
}
131131

132-
private HttpJsonTransportUtils() {}
132+
private HttpJsonConscryptUtils() {}
133133
}

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public TransportChannelProvider withCredentials(Credentials credentials) {
197197
HttpTransport createHttpTransport() throws IOException, GeneralSecurityException {
198198
NetHttpTransport.Builder builder = new NetHttpTransport.Builder();
199199
configureMtls(builder);
200-
HttpJsonTransportUtils.configureConscryptSecurityProvider(builder);
200+
HttpJsonConscryptUtils.configureConscryptSecurityProvider(builder);
201201
return builder.build();
202202
}
203203

@@ -210,7 +210,7 @@ private NetHttpTransport.Builder configureMtls(NetHttpTransport.Builder builder)
210210
if (mtlsKeyStore == null) {
211211
return builder;
212212
}
213-
Provider conscryptProvider = HttpJsonTransportUtils.getConscryptProvider();
213+
Provider conscryptProvider = HttpJsonConscryptUtils.getConscryptProvider();
214214
if (conscryptProvider == null) {
215215
// Fall back to standard JDK JSSE if Conscrypt provider is unavailable
216216
builder.trustCertificates(null, mtlsKeyStore, "");

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private ManagedHttpJsonChannel(
7373
this.endpoint = endpoint;
7474
this.httpTransport =
7575
httpTransport == null
76-
? HttpJsonTransportUtils.configureConscryptSecurityProvider(
76+
? HttpJsonConscryptUtils.configureConscryptSecurityProvider(
7777
new NetHttpTransport.Builder())
7878
.build()
7979
: httpTransport;
@@ -234,7 +234,7 @@ public ManagedHttpJsonChannel build() {
234234

235235
if (httpTransport == null) {
236236
httpTransport =
237-
HttpJsonTransportUtils.configureConscryptSecurityProvider(
237+
HttpJsonConscryptUtils.configureConscryptSecurityProvider(
238238
new NetHttpTransport.Builder())
239239
.build();
240240
}

sdk-platform-java/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProviderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void testCreateHttpTransport_returnsValidTransport() throws Exception {
213213

214214
@Test
215215
void testDefaultPqcGroups_containsExpectedGroups() {
216-
assertThat(HttpJsonTransportUtils.DEFAULT_PQC_GROUPS)
216+
assertThat(HttpJsonConscryptUtils.DEFAULT_PQC_GROUPS)
217217
.asList()
218218
.containsExactly("X25519MLKEM768", "SecP256r1MLKEM768", "X25519")
219219
.inOrder();
@@ -223,7 +223,7 @@ void testDefaultPqcGroups_containsExpectedGroups() {
223223
void testConfigureConscryptSecurityProvider_returnsConfiguredBuilder() {
224224
NetHttpTransport.Builder builder = new NetHttpTransport.Builder();
225225
NetHttpTransport.Builder result =
226-
HttpJsonTransportUtils.configureConscryptSecurityProvider(builder);
226+
HttpJsonConscryptUtils.configureConscryptSecurityProvider(builder);
227227
assertThat(result).isSameInstanceAs(builder);
228228
}
229229
}

sdk-platform-java/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import com.google.api.client.http.javanet.NetHttpTransport;
2626
import com.google.api.gax.core.GaxProperties;
2727
import com.google.api.gax.httpjson.HttpHeadersUtils;
28+
import com.google.api.gax.httpjson.HttpJsonConscryptUtils;
2829
import com.google.api.gax.httpjson.HttpJsonStatusCode;
29-
import com.google.api.gax.httpjson.HttpJsonTransportUtils;
3030
import com.google.api.gax.rpc.ApiClientHeaderProvider;
3131
import com.google.api.gax.rpc.EndpointContext;
3232
import com.google.api.gax.rpc.HeaderProvider;
@@ -70,7 +70,7 @@ public HttpTransport create() {
7070
}
7171
}
7272

73-
return HttpJsonTransportUtils.configureConscryptSecurityProvider(
73+
return HttpJsonConscryptUtils.configureConscryptSecurityProvider(
7474
new NetHttpTransport.Builder())
7575
.build();
7676
}

0 commit comments

Comments
 (0)