Skip to content

Commit

Permalink
Merge branch 'main' into renovate/org.hamcrest-hamcrest-core-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
alicejli committed Aug 19, 2022
2 parents 724f409 + ead58b2 commit 5967ee6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bom/pom.xml
Expand Up @@ -83,7 +83,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<configuration>
<skip>true</skip>
</configuration>
Expand Down
8 changes: 6 additions & 2 deletions oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java
Expand Up @@ -315,10 +315,14 @@ public void revokeAuthorization(String userId) throws IOException {
OAuth2Utils.validateOptionalString(tokenJson, "refresh_token", TOKEN_STORE_ERROR);
// If both tokens are present, either can be used
String revokeToken = (refreshToken != null) ? refreshToken : accessTokenValue;

GenericUrl revokeUrl = new GenericUrl(OAuth2Utils.TOKEN_REVOKE_URI);
revokeUrl.put("token", revokeToken);
GenericData genericData = new GenericData();
genericData.put("token", revokeToken);
UrlEncodedContent content = new UrlEncodedContent(genericData);

HttpRequestFactory requestFactory = transportFactory.create().createRequestFactory();
HttpRequest tokenRequest = requestFactory.buildGetRequest(revokeUrl);
HttpRequest tokenRequest = requestFactory.buildPostRequest(revokeUrl, content);
tokenRequest.execute();

if (deleteTokenException != null) {
Expand Down
8 changes: 8 additions & 0 deletions oauth2_http/javatests/com/google/auth/oauth2/IdTokenTest.java
Expand Up @@ -49,6 +49,8 @@ public class IdTokenTest extends BaseSerializationTest {
"eyJhbGciOiJSUzI1NiIsImtpZCI6IjM0OTRiMWU3ODZjZGFkMDkyZTQyMzc2NmJiZTM3ZjU0ZWQ4N2IyMmQiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiJodHRwczovL2Zvby5iYXIiLCJhenAiOiJzdmMtMi00MjlAbWluZXJhbC1taW51dGlhLTgyMC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInN1YiI6IjEwMDE0NzEwNjk5Njc2NDQ3OTA4NSIsImVtYWlsIjoic3ZjLTItNDI5QG1pbmVyYWwtbWludXRpYS04MjAuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaWF0IjoxNTY1Mzg3NTM4LCJleHAiOjE1NjUzOTExMzh9.foo";
private static final String TOKEN_2 =
"eyJhbGciOiJSUzI1NiIsImtpZCI6IjM0OTRiMWU3ODZjZGFkMDkyZTQyMzc2NmJiZTM3ZjU0ZWQ4N2IyMmQiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiJodHRwczovL2Jhci5mb28iLCJhenAiOiJzdmMtMi00MjlAbWluZXJhbC1taW51dGlhLTgyMC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInN1YiI6IjEwMDE0NzEwNjk5Njc2NDQ3OTA4NSIsImVtYWlsIjoic3ZjLTItNDI5QG1pbmVyYWwtbWludXRpYS04MjAuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaWF0IjoxNTY1Mzg4NjM0LCJleHAiOjE1NjUzOTIyMzR9.foo";
private static final String TOKEN_WITH_0x20 =
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE2NjAxNjMxNjAsImV4cCI6MTY5MTY5OTE2MCwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6ImFibTHag3M0x20ifQ.foo";
private static final Date EXPIRATION_DATE = new Date((long) 1565391138 * 1000);

@Test
Expand Down Expand Up @@ -99,4 +101,10 @@ public void serialize() throws IOException, ClassNotFoundException {
assertEquals(accessToken.hashCode(), deserializedAccessToken.hashCode());
assertEquals(accessToken.toString(), deserializedAccessToken.toString());
}

@Test
public void token_with_0x20() throws IOException {
IdToken accessToken = IdToken.create(TOKEN_WITH_0x20);
assertEquals(TOKEN_WITH_0x20, accessToken.getTokenValue());
}
}
Expand Up @@ -257,7 +257,7 @@ public LowLevelHttpResponse execute() throws IOException {
return new MockLowLevelHttpRequest(url) {
@Override
public LowLevelHttpResponse execute() throws IOException {
Map<String, String> parameters = TestUtils.parseQuery(query);
Map<String, String> parameters = TestUtils.parseQuery(this.getContentAsString());
String token = parameters.get("token");
if (token == null) {
throw new IOException("Token to revoke not found.");
Expand Down
2 changes: 1 addition & 1 deletion oauth2_http/pom.xml
Expand Up @@ -151,7 +151,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.6.1</version>
<version>4.7.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Expand Up @@ -62,7 +62,7 @@
<project.google.http.version>1.42.2</project.google.http.version>
<project.junit.version>4.13.2</project.junit.version>
<project.guava.version>31.0.1-android</project.guava.version>
<project.appengine.version>2.0.5</project.appengine.version>
<project.appengine.version>2.0.6</project.appengine.version>
<project.findbugs.version>3.0.2</project.findbugs.version>
<deploy.autorelease>false</deploy.autorelease>
<project.autovalue.version>1.8.2</project.autovalue.version>
Expand Down Expand Up @@ -165,7 +165,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<configuration>
<source>7</source>
<failOnError>false</failOnError>
Expand Down Expand Up @@ -318,7 +318,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<reportSets>
<reportSet>
<id>html</id>
Expand Down Expand Up @@ -386,7 +386,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -486,7 +486,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<configuration>
<doclet>com.microsoft.doclet.DocFxDoclet</doclet>
<useStandardDocletOptions>false</useStandardDocletOptions>
Expand Down
4 changes: 2 additions & 2 deletions samples/snippets/pom.xml
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.0.0</version>
<version>26.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -50,7 +50,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-iam-admin</artifactId>
<version>1.2.1</version>
<version>1.2.3</version>
</dependency>

<!-- GCloud dependency-->
Expand Down

0 comments on commit 5967ee6

Please sign in to comment.