Skip to content

Commit 23347a7

Browse files
authored
Update google-auth-library to 0.16.1 and import using new bom (#5413)
* Update google-auth-library to 0.16.0 and import using new bom * Use the right project properties * Update google-http-client version and pin objc2-annotations Necessary for dependency conversion. * Remove dependency on apache httpclient. We were only using it for an HTTP status code constant. * Use google-auth-library 0.16.1
1 parent 6f9d239 commit 23347a7

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

google-cloud-clients/google-cloud-storage/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<artifactId>google-api-services-storage</artifactId>
3232
<scope>compile</scope>
3333
</dependency>
34-
<dependency>
35-
<groupId>org.apache.httpcomponents</groupId>
36-
<artifactId>httpclient</artifactId>
37-
<version>${apache.httpclient.version}</version>
38-
</dependency>
3934

4035
<!-- Test dependencies -->
4136
<dependency>

google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@
8181
import java.util.LinkedList;
8282
import java.util.List;
8383
import java.util.Map;
84-
import org.apache.http.HttpStatus;
8584

8685
public class HttpStorageRpc implements StorageRpc {
8786
public static final String DEFAULT_PROJECTION = "full";
8887
public static final String NO_ACL_PROJECTION = "noAcl";
8988
private static final String ENCRYPTION_KEY_PREFIX = "x-goog-encryption-";
9089
private static final String SOURCE_ENCRYPTION_KEY_PREFIX = "x-goog-copy-source-encryption-";
9190

91+
// declare this HttpStatus code here as it's not included in java.net.HttpURLConnection
92+
private static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
93+
9294
private final StorageOptions options;
9395
private final Storage storage;
9496
private final Tracer tracer = Tracing.getTracer();
@@ -688,7 +690,7 @@ public Tuple<String, byte[]> read(
688690
} catch (IOException ex) {
689691
span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage()));
690692
StorageException serviceException = translate(ex);
691-
if (serviceException.getCode() == HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) {
693+
if (serviceException.getCode() == SC_REQUESTED_RANGE_NOT_SATISFIABLE) {
692694
return Tuple.of(null, new byte[0]);
693695
}
694696
throw serviceException;

google-cloud-clients/pom.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@
158158
<!-- make sure to keep gax version in sync with google-cloud-bom -->
159159
<gax.version>1.45.0</gax.version>
160160
<api.common.java.version>1.8.1</api.common.java.version>
161-
<google.auth.version>0.15.0</google.auth.version>
161+
<google.auth.version>0.16.1</google.auth.version>
162162
<grpc.version>1.21.0</grpc.version>
163163
<!-- We are currently using the *-android version to support JDK7. -->
164164
<guava.version>27.1-android</guava.version>
165-
<http-client-bom.version>1.29.2</http-client-bom.version>
166-
<oauth-client.version>1.29.2</oauth-client.version>
165+
<http-client-bom.version>1.30.1</http-client-bom.version>
166+
<oauth-client.version>1.30.1</oauth-client.version>
167167
<protobuf.version>3.7.1</protobuf.version>
168168
<!-- make sure to keep opencensus version in sync with grpc -->
169169
<opencensus.version>0.21.0</opencensus.version>
@@ -212,6 +212,13 @@
212212
<type>pom</type>
213213
<scope>import</scope>
214214
</dependency>
215+
<dependency>
216+
<groupId>com.google.auth</groupId>
217+
<artifactId>google-auth-library-bom</artifactId>
218+
<version>${google.auth.version}</version>
219+
<type>pom</type>
220+
<scope>import</scope>
221+
</dependency>
215222
<dependency>
216223
<groupId>com.google.apis</groupId>
217224
<artifactId>google-api-services-bigquery</artifactId>
@@ -233,6 +240,13 @@
233240
<version>v1-rev20190418-1.28.0</version>
234241
</dependency>
235242

243+
<!-- TODO(chingor): Remove this when http-client and guava converge -->
244+
<dependency>
245+
<groupId>com.google.j2objc</groupId>
246+
<artifactId>j2objc-annotations</artifactId>
247+
<version>1.3</version>
248+
</dependency>
249+
236250
<!-- TODO(chingor): Remove this when grpc and guava converge -->
237251
<dependency>
238252
<groupId>org.codehaus.mojo</groupId>
@@ -337,16 +351,6 @@
337351
<artifactId>auto-value</artifactId>
338352
<version>1.4</version>
339353
</dependency>
340-
<dependency>
341-
<groupId>com.google.auth</groupId>
342-
<artifactId>google-auth-library-credentials</artifactId>
343-
<version>${google.auth.version}</version>
344-
</dependency>
345-
<dependency>
346-
<groupId>com.google.auth</groupId>
347-
<artifactId>google-auth-library-oauth2-http</artifactId>
348-
<version>${google.auth.version}</version>
349-
</dependency>
350354
<dependency>
351355
<groupId>io.opencensus</groupId>
352356
<artifactId>opencensus-api</artifactId>

0 commit comments

Comments
 (0)