Skip to content

Commit 2ca4d83

Browse files
committed
Avoid having uses look at ImmutableHttpParams
Signed-off-by: Appu Goundan <[email protected]>
1 parent 7a7e168 commit 2ca4d83

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

sigstore-java/src/main/java/dev/sigstore/fulcio/client/FulcioClientGrpc.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import dev.sigstore.fulcio.v2.PublicKeyRequest;
2929
import dev.sigstore.http.GrpcChannels;
3030
import dev.sigstore.http.HttpParams;
31-
import dev.sigstore.http.ImmutableHttpParams;
3231
import dev.sigstore.trustroot.Service;
3332
import java.io.ByteArrayInputStream;
3433
import java.net.URI;
@@ -58,7 +57,7 @@ private FulcioClientGrpc(HttpParams httpParams, URI uri) {
5857

5958
public static class Builder {
6059
private Service service;
61-
private HttpParams httpParams = ImmutableHttpParams.builder().build();
60+
private HttpParams httpParams = HttpParams.builder().build();
6261

6362
private Builder() {}
6463

sigstore-java/src/main/java/dev/sigstore/http/HttpParams.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ protected void check() {
5353
Preconditions.checkState(getTimeout() > 0, "'timeout' should be greater than zero");
5454
Preconditions.checkState(!getUserAgent().isEmpty(), "'useragent' must not be empty");
5555
}
56+
57+
public static ImmutableHttpParams.Builder builder() {
58+
return ImmutableHttpParams.builder();
59+
}
5660
}

sigstore-java/src/main/java/dev/sigstore/oidc/client/GithubActionsOidcClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.api.client.util.Key;
2323
import dev.sigstore.http.HttpClients;
2424
import dev.sigstore.http.HttpParams;
25-
import dev.sigstore.http.ImmutableHttpParams;
2625
import io.grpc.Internal;
2726
import java.io.IOException;
2827
import java.util.Map;
@@ -55,7 +54,7 @@ private GithubActionsOidcClient(HttpParams httpParams, String audience) {
5554
}
5655

5756
public static class Builder {
58-
private HttpParams httpParams = ImmutableHttpParams.builder().build();
57+
private HttpParams httpParams = HttpParams.builder().build();
5958
private String audience = DEFAULT_AUDIENCE;
6059

6160
private Builder() {}

sigstore-java/src/main/java/dev/sigstore/oidc/client/WebOidcClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import com.google.api.client.util.store.MemoryDataStoreFactory;
3636
import dev.sigstore.http.HttpClients;
3737
import dev.sigstore.http.HttpParams;
38-
import dev.sigstore.http.ImmutableHttpParams;
3938
import dev.sigstore.trustroot.Service;
4039
import java.io.IOException;
4140
import java.util.Arrays;
@@ -72,7 +71,7 @@ public static WebOidcClient.Builder builder() {
7271
}
7372

7473
public static class Builder {
75-
private HttpParams httpParams = ImmutableHttpParams.builder().build();
74+
private HttpParams httpParams = HttpParams.builder().build();
7675
private String clientId = DEFAULT_CLIENT_ID;
7776
private Service issuer;
7877
private BrowserHandler browserHandler = null;

sigstore-java/src/main/java/dev/sigstore/rekor/client/RekorClientHttp.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.api.client.util.Preconditions;
2626
import dev.sigstore.http.HttpClients;
2727
import dev.sigstore.http.HttpParams;
28-
import dev.sigstore.http.ImmutableHttpParams;
2928
import dev.sigstore.trustroot.Service;
3029
import java.io.IOException;
3130
import java.net.URI;
@@ -53,12 +52,12 @@ private RekorClientHttp(HttpParams httpParams, URI uri) {
5352
}
5453

5554
public static class Builder {
56-
private HttpParams httpParams = ImmutableHttpParams.builder().build();
55+
private HttpParams httpParams = HttpParams.builder().build();
5756
private Service service;
5857

5958
private Builder() {}
6059

61-
/** Configure the http properties, see {@link HttpParams}, {@link ImmutableHttpParams}. */
60+
/** Configure the http properties, see {@link HttpParams}. */
6261
public Builder setHttpParams(HttpParams httpParams) {
6362
this.httpParams = httpParams;
6463
return this;

sigstore-java/src/main/java/dev/sigstore/timestamp/client/TimestampClientHttp.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.google.common.annotations.VisibleForTesting;
2424
import dev.sigstore.http.HttpClients;
2525
import dev.sigstore.http.HttpParams;
26-
import dev.sigstore.http.ImmutableHttpParams;
2726
import dev.sigstore.trustroot.Service;
2827
import java.io.IOException;
2928
import java.net.URI;
@@ -53,12 +52,12 @@ public static TimestampClientHttp.Builder builder() {
5352
}
5453

5554
public static class Builder {
56-
private HttpParams httpParams = ImmutableHttpParams.builder().build();
55+
private HttpParams httpParams = HttpParams.builder().build();
5756
private Service service;
5857

5958
private Builder() {}
6059

61-
/** Configure the http properties, see {@link HttpParams}, {@link ImmutableHttpParams}. */
60+
/** Configure the http properties, see {@link HttpParams}. */
6261
public Builder setHttpParams(HttpParams httpParams) {
6362
this.httpParams = httpParams;
6463
return this;

sigstore-java/src/main/java/dev/sigstore/tuf/HttpFetcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.google.api.client.http.GenericUrl;
1919
import com.google.api.client.json.gson.GsonFactory;
2020
import dev.sigstore.http.HttpClients;
21-
import dev.sigstore.http.ImmutableHttpParams;
21+
import dev.sigstore.http.HttpParams;
2222
import java.io.IOException;
2323
import java.net.MalformedURLException;
2424
import java.net.URL;
@@ -49,7 +49,7 @@ public byte[] fetchResource(String filename, int maxLength)
4949
throws IOException, FileExceedsMaxLengthException {
5050
GenericUrl fileUrl = new GenericUrl(mirror + filename);
5151
var req =
52-
HttpClients.newHttpTransport(ImmutableHttpParams.builder().build())
52+
HttpClients.newHttpTransport(HttpParams.builder().build())
5353
.createRequestFactory(
5454
request ->
5555
request.setParser(GsonFactory.getDefaultInstance().createJsonObjectParser()))

sigstore-java/src/test/java/dev/sigstore/fulcio/client/FulcioClientGrpcTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.google.common.io.Resources;
1919
import dev.sigstore.encryption.certificates.Certificates;
2020
import dev.sigstore.encryption.signers.Signers;
21-
import dev.sigstore.http.ImmutableHttpParams;
21+
import dev.sigstore.http.HttpParams;
2222
import dev.sigstore.testing.FakeCTLogServer;
2323
import dev.sigstore.testing.FulcioWrapper;
2424
import dev.sigstore.testing.MockOAuth2ServerExtension;
@@ -50,7 +50,7 @@ public void testSigningCert(
5050
// ask fulcio for a signing cert
5151
var client =
5252
FulcioClientGrpc.builder()
53-
.setHttpParams(ImmutableHttpParams.builder().allowInsecureConnections(true).build())
53+
.setHttpParams(HttpParams.builder().allowInsecureConnections(true).build())
5454
.setService(fulcioWrapper.getGrpcService())
5555
.build();
5656

@@ -80,7 +80,7 @@ public void testSigningCert_NoSct(
8080
// ask fulcio for a signing cert
8181
var client =
8282
FulcioClientGrpc.builder()
83-
.setHttpParams(ImmutableHttpParams.builder().allowInsecureConnections(true).build())
83+
.setHttpParams(HttpParams.builder().allowInsecureConnections(true).build())
8484
.setService(fulcioWrapper.getGrpcService())
8585
.build();
8686
var ex =

0 commit comments

Comments
 (0)