From 061448209da05ddfc75b40aae495c33d0ee7f1ee Mon Sep 17 00:00:00 2001
From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com>
Date: Thu, 18 Mar 2021 13:58:00 -0700
Subject: [PATCH 1/3] fix: fix service account credentials createScopedRequired
(#601)
* fix: fix service account credentials createScopedRequired
* Update oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java
---
.../com/google/auth/oauth2/ServiceAccountCredentials.java | 6 ++++++
.../google/auth/oauth2/ServiceAccountCredentialsTest.java | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java b/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java
index aa9043611..741a4b27d 100644
--- a/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java
+++ b/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java
@@ -561,6 +561,12 @@ public static ServiceAccountCredentials fromStream(
fileType, SERVICE_ACCOUNT_FILE_TYPE));
}
+ /** Returns whether the scopes are empty, meaning createScoped must be called before use. */
+ @Override
+ public boolean createScopedRequired() {
+ return scopes.isEmpty();
+ }
+
/**
* Refreshes the OAuth2 access token by getting a new access token using a JSON Web Token (JWT).
*/
diff --git a/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java b/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java
index 904093154..604f68c60 100644
--- a/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java
+++ b/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java
@@ -479,12 +479,12 @@ public void createdScoped_defaultScopes() throws IOException {
}
@Test
- public void createScopedRequired_emptyScopes_false() throws IOException {
+ public void createScopedRequired_emptyScopes() throws IOException {
GoogleCredentials credentials =
ServiceAccountCredentials.fromPkcs8(
CLIENT_ID, CLIENT_EMAIL, PRIVATE_KEY_PKCS8, PRIVATE_KEY_ID, EMPTY_SCOPES);
- assertFalse(credentials.createScopedRequired());
+ assertTrue(credentials.createScopedRequired());
}
@Test
From 11c2f10b9418ce89c72f9684d5980ebea102bf4a Mon Sep 17 00:00:00 2001
From: "release-please[bot]"
<55107282+release-please[bot]@users.noreply.github.com>
Date: Thu, 18 Mar 2021 14:04:41 -0700
Subject: [PATCH 2/3] chore: release 0.25.1 (#602)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
---
CHANGELOG.md | 7 +++++++
README.md | 6 +++---
appengine/pom.xml | 2 +-
bom/pom.xml | 2 +-
credentials/pom.xml | 2 +-
oauth2_http/pom.xml | 2 +-
pom.xml | 2 +-
versions.txt | 12 ++++++------
8 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 41c26310a..69a5f3322 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog
+### [0.25.1](https://www.github.com/googleapis/google-auth-library-java/compare/v0.25.0...v0.25.1) (2021-03-18)
+
+
+### Bug Fixes
+
+* fix service account credentials createScopedRequired ([#601](https://www.github.com/googleapis/google-auth-library-java/issues/601)) ([0614482](https://www.github.com/googleapis/google-auth-library-java/commit/061448209da05ddfc75b40aae495c33d0ee7f1ee))
+
## [0.25.0](https://www.github.com/googleapis/google-auth-library-java/compare/v0.24.1...v0.25.0) (2021-03-16)
diff --git a/README.md b/README.md
index b328b59a4..1ed73ece9 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ If you are using Maven, add this to your pom.xml file (notice that you can repla
com.google.auth
google-auth-library-oauth2-http
- 0.25.0
+ 0.25.1
```
[//]: # ({x-version-update-end})
@@ -42,7 +42,7 @@ If you are using Gradle, add this to your dependencies
[//]: # ({x-version-update-start:google-auth-library-oauth2-http:released})
```Groovy
-compile 'com.google.auth:google-auth-library-oauth2-http:0.25.0'
+compile 'com.google.auth:google-auth-library-oauth2-http:0.25.1'
```
[//]: # ({x-version-update-end})
@@ -50,7 +50,7 @@ If you are using SBT, add this to your dependencies
[//]: # ({x-version-update-start:google-auth-library-oauth2-http:released})
```Scala
-libraryDependencies += "com.google.auth" % "google-auth-library-oauth2-http" % "0.25.0"
+libraryDependencies += "com.google.auth" % "google-auth-library-oauth2-http" % "0.25.1"
```
[//]: # ({x-version-update-end})
diff --git a/appengine/pom.xml b/appengine/pom.xml
index ba04ef140..a94c4136d 100644
--- a/appengine/pom.xml
+++ b/appengine/pom.xml
@@ -5,7 +5,7 @@
com.google.auth
google-auth-library-parent
- 0.25.1-SNAPSHOT
+ 0.25.1
../pom.xml
diff --git a/bom/pom.xml b/bom/pom.xml
index 31e4b5c7a..d0fc50ab9 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.auth
google-auth-library-bom
- 0.25.1-SNAPSHOT
+ 0.25.1
pom
Google Auth Library for Java BOM
diff --git a/credentials/pom.xml b/credentials/pom.xml
index 606ea6805..16cc45664 100644
--- a/credentials/pom.xml
+++ b/credentials/pom.xml
@@ -4,7 +4,7 @@
com.google.auth
google-auth-library-parent
- 0.25.1-SNAPSHOT
+ 0.25.1
../pom.xml
diff --git a/oauth2_http/pom.xml b/oauth2_http/pom.xml
index 782c0cae0..8e3fa8ff2 100644
--- a/oauth2_http/pom.xml
+++ b/oauth2_http/pom.xml
@@ -5,7 +5,7 @@
com.google.auth
google-auth-library-parent
- 0.25.1-SNAPSHOT
+ 0.25.1
../pom.xml
diff --git a/pom.xml b/pom.xml
index bcd8695a0..6b48cf952 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.auth
google-auth-library-parent
- 0.25.1-SNAPSHOT
+ 0.25.1
pom
Google Auth Library for Java
Client libraries providing authentication and
diff --git a/versions.txt b/versions.txt
index 864c45da3..fcb8e9d22 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,9 +1,9 @@
# Format:
# module:released-version:current-version
-google-auth-library:0.25.0:0.25.1-SNAPSHOT
-google-auth-library-bom:0.25.0:0.25.1-SNAPSHOT
-google-auth-library-parent:0.25.0:0.25.1-SNAPSHOT
-google-auth-library-appengine:0.25.0:0.25.1-SNAPSHOT
-google-auth-library-credentials:0.25.0:0.25.1-SNAPSHOT
-google-auth-library-oauth2-http:0.25.0:0.25.1-SNAPSHOT
+google-auth-library:0.25.1:0.25.1
+google-auth-library-bom:0.25.1:0.25.1
+google-auth-library-parent:0.25.1:0.25.1
+google-auth-library-appengine:0.25.1:0.25.1
+google-auth-library-credentials:0.25.1:0.25.1
+google-auth-library-oauth2-http:0.25.1:0.25.1
From bf3507c9bea8dcc2dd0204846857acd20dfda9f3 Mon Sep 17 00:00:00 2001
From: "release-please[bot]"
<55107282+release-please[bot]@users.noreply.github.com>
Date: Thu, 18 Mar 2021 21:12:02 +0000
Subject: [PATCH 3/3] chore: release 0.25.2-SNAPSHOT (#603)
:robot: I have created a release \*beep\* \*boop\*
---
### Updating meta-information for bleeding-edge SNAPSHOT release.
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
---
appengine/pom.xml | 2 +-
bom/pom.xml | 2 +-
credentials/pom.xml | 2 +-
oauth2_http/pom.xml | 2 +-
pom.xml | 2 +-
versions.txt | 12 ++++++------
6 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/appengine/pom.xml b/appengine/pom.xml
index a94c4136d..cb91a6ef0 100644
--- a/appengine/pom.xml
+++ b/appengine/pom.xml
@@ -5,7 +5,7 @@
com.google.auth
google-auth-library-parent
- 0.25.1
+ 0.25.2-SNAPSHOT
../pom.xml
diff --git a/bom/pom.xml b/bom/pom.xml
index d0fc50ab9..2113f1616 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.auth
google-auth-library-bom
- 0.25.1
+ 0.25.2-SNAPSHOT
pom
Google Auth Library for Java BOM
diff --git a/credentials/pom.xml b/credentials/pom.xml
index 16cc45664..7bb20419f 100644
--- a/credentials/pom.xml
+++ b/credentials/pom.xml
@@ -4,7 +4,7 @@
com.google.auth
google-auth-library-parent
- 0.25.1
+ 0.25.2-SNAPSHOT
../pom.xml
diff --git a/oauth2_http/pom.xml b/oauth2_http/pom.xml
index 8e3fa8ff2..43de232b7 100644
--- a/oauth2_http/pom.xml
+++ b/oauth2_http/pom.xml
@@ -5,7 +5,7 @@
com.google.auth
google-auth-library-parent
- 0.25.1
+ 0.25.2-SNAPSHOT
../pom.xml
diff --git a/pom.xml b/pom.xml
index 6b48cf952..a2c3e8b62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.auth
google-auth-library-parent
- 0.25.1
+ 0.25.2-SNAPSHOT
pom
Google Auth Library for Java
Client libraries providing authentication and
diff --git a/versions.txt b/versions.txt
index fcb8e9d22..f626a7938 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,9 +1,9 @@
# Format:
# module:released-version:current-version
-google-auth-library:0.25.1:0.25.1
-google-auth-library-bom:0.25.1:0.25.1
-google-auth-library-parent:0.25.1:0.25.1
-google-auth-library-appengine:0.25.1:0.25.1
-google-auth-library-credentials:0.25.1:0.25.1
-google-auth-library-oauth2-http:0.25.1:0.25.1
+google-auth-library:0.25.1:0.25.2-SNAPSHOT
+google-auth-library-bom:0.25.1:0.25.2-SNAPSHOT
+google-auth-library-parent:0.25.1:0.25.2-SNAPSHOT
+google-auth-library-appengine:0.25.1:0.25.2-SNAPSHOT
+google-auth-library-credentials:0.25.1:0.25.2-SNAPSHOT
+google-auth-library-oauth2-http:0.25.1:0.25.2-SNAPSHOT