From 370bfb572cb1a5d601bf66b33fab591e0f9dd81c Mon Sep 17 00:00:00 2001 From: Miroslav Genov Date: Sat, 11 Jun 2016 10:31:54 +0300 Subject: [PATCH 01/63] gogole-auth-client: check for empty or null userId When userId is not specified no requests need to be send to backed, cause it's obvious that user is unknown. --- .../api/client/auth/oauth2/AuthorizationCodeFlow.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index dcdea3e1c..cb0e85718 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -32,6 +32,8 @@ import java.util.Collection; import java.util.Collections; +import static com.google.api.client.util.Strings.isNullOrEmpty; + /** * Thread-safe OAuth 2.0 authorization code flow that manages and persists end-user credentials. * @@ -242,6 +244,12 @@ public Credential createAndStoreCredential(TokenResponse response, String userId */ @SuppressWarnings("deprecation") public Credential loadCredential(String userId) throws IOException { + + // No requests need to be performed when userId is not specified. + if (isNullOrEmpty(userId)) { + return null; + } + if (credentialDataStore == null && credentialStore == null) { return null; } From 6c7455c554bfe95d0494785ebaa30989b33e4c63 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Tue, 16 Aug 2016 14:17:14 -0700 Subject: [PATCH 02/63] Bump parent version of sample This was missed from the bump to 1.23-SNAPSHOT --- samples/dailymotion-cmdline-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/dailymotion-cmdline-sample/pom.xml b/samples/dailymotion-cmdline-sample/pom.xml index 358e25210..e96d2edcd 100644 --- a/samples/dailymotion-cmdline-sample/pom.xml +++ b/samples/dailymotion-cmdline-sample/pom.xml @@ -4,7 +4,7 @@ com.google.oauth-client google-oauth-client-parent - 1.22.0-SNAPSHOT + 1.23.0-SNAPSHOT ../../pom.xml dailymotion-simple-cmdline-sample From 5cdfe9c393500ec280308c5e54a4070f46d917f1 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Mon, 22 Aug 2016 22:40:11 -0400 Subject: [PATCH 03/63] Implement customizable landing pages after login --- google-oauth-client-jetty/pom.xml | 5 + .../auth/oauth2/LocalServerReceiver.java | 34 ++++- .../auth/oauth2/LocalServerReceiverTest.java | 125 ++++++++++++++++++ 3 files changed, 160 insertions(+), 4 deletions(-) create mode 100644 google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java diff --git a/google-oauth-client-jetty/pom.xml b/google-oauth-client-jetty/pom.xml index 2d0ab379b..ca2428d52 100644 --- a/google-oauth-client-jetty/pom.xml +++ b/google-oauth-client-jetty/pom.xml @@ -76,5 +76,10 @@ org.mortbay.jetty jetty + + junit + junit + test + diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index d24d33f4a..94a891a14 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -68,6 +68,18 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { /** Host name to use. */ private final String host; + /** + * URL to an HTML page to be shown (via redirect) after successful login. If null, a canned + * default landing page will be shown (via direct response). + */ + private String successLandingPageUrl; + + /** + * URL to an HTML page to be shown (via redirect) after failed login. If null, a canned + * default landing page will be shown (via direct response). + */ + private String failureLandingPageUrl; + /** * Constructor that starts the server on {@code "localhost"} selects an unused port. * @@ -79,6 +91,12 @@ public LocalServerReceiver() { this("localhost", -1); } + public LocalServerReceiver(String successLandingPageUrl, String failureLandingPageUrl) { + this("localhost", -1); + this.successLandingPageUrl = successLandingPageUrl; + this.failureLandingPageUrl = failureLandingPageUrl; + } + /** * Constructor. * @@ -216,14 +234,22 @@ public void handle( if (!CALLBACK_PATH.equals(target)) { return; } - writeLandingHtml(response); - response.flushBuffer(); + ((Request) request).setHandled(true); lock.lock(); try { error = request.getParameter("error"); code = request.getParameter("code"); gotAuthorizationResponse.signal(); + + if (error == null && successLandingPageUrl != null) { + response.sendRedirect(successLandingPageUrl); + } else if (error != null && failureLandingPageUrl != null) { + response.sendRedirect(failureLandingPageUrl); + } else { + writeLandingHtml(response); + } + response.flushBuffer(); } finally { lock.unlock(); } @@ -237,9 +263,9 @@ private void writeLandingHtml(HttpServletResponse response) throws IOException { doc.println(""); doc.println("OAuth 2.0 Authentication Token Received"); doc.println(""); - doc.println("Received verification code. You may now close this window..."); + doc.println("Received verification code. You may now close this window."); doc.println(""); - doc.println(""); + doc.println(""); doc.flush(); } } diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java new file mode 100644 index 000000000..b0f8d6650 --- /dev/null +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.api.client.extensions.jetty.auth.oauth2; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +public class LocalServerReceiverTest { + + private int responseCode; + private StringBuilder responseOutput = new StringBuilder(); + private String redirectedLandingPageUrl; + + @Test + public void testSuccessLandingPage() throws IOException, InterruptedException { + String successLandingPageUrl = "https://www.example.com/my-success-landing-page"; + LocalServerReceiver receiver = new LocalServerReceiver(successLandingPageUrl, null); + + try { + sendSuccessLoginResult(receiver.getRedirectUri()); + verifyRedirectedLandingPageUrl(successLandingPageUrl); + } finally { + receiver.stop(); + } + } + + @Test + public void testFailureLandingPage() throws IOException { + String failureLandingPageUrl = "https://www.example.com/my-failure-landing-page"; + LocalServerReceiver receiver = new LocalServerReceiver(null, failureLandingPageUrl); + + try { + sendFailureLoginResult(receiver.getRedirectUri()); + verifyRedirectedLandingPageUrl(failureLandingPageUrl); + } finally { + receiver.stop(); + } + } + + @Test + public void testDefaultSuccessLandingPage() throws IOException { + LocalServerReceiver receiver = new LocalServerReceiver(null, null); + + try { + sendSuccessLoginResult(receiver.getRedirectUri()); + verifyDefaultLandingPage(); + } finally { + receiver.stop(); + } + } + + @Test + public void testDefaultFailureLandingPage() throws IOException { + LocalServerReceiver receiver = new LocalServerReceiver(null, null); + + try { + sendFailureLoginResult(receiver.getRedirectUri()); + verifyDefaultLandingPage(); + } finally { + receiver.stop(); + } + } + + private void verifyRedirectedLandingPageUrl(String landingPageUrlMatch) { + Assert.assertEquals(302, responseCode); + Assert.assertEquals(landingPageUrlMatch, redirectedLandingPageUrl); + Assert.assertTrue(responseOutput.toString().isEmpty()); + } + + private void verifyDefaultLandingPage() { + Assert.assertEquals(200, responseCode); + Assert.assertNull(redirectedLandingPageUrl); + Assert.assertTrue(responseOutput.toString().contains("")); + Assert.assertTrue(responseOutput.toString().contains("")); + } + + private void sendSuccessLoginResult(String serverEndpoint) throws IOException { + sendLoginResult(serverEndpoint, "?code=some-authorization-code"); + } + + private void sendFailureLoginResult(String serverEndpoint) throws IOException { + sendLoginResult(serverEndpoint, "?error=some-error"); + } + + private void sendLoginResult(final String serverEndpoint, final String parameters) + throws IOException { + HttpURLConnection connection = null; + + try { + URL url = new URL(serverEndpoint + parameters); + connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(2000 /* ms */); + connection.setReadTimeout(2000 /* ms */); + responseCode = connection.getResponseCode(); + redirectedLandingPageUrl = connection.getHeaderField("Location"); + + InputStreamReader reader = new InputStreamReader(connection.getInputStream(), "UTF-8"); + for (int ch = reader.read(); ch != -1; ch = reader.read()) { + responseOutput.append((char) ch); + } + } finally { + if (connection != null) { + connection.disconnect(); + } + } + } +} From eb07ced18e5643947efdd5391c6469f9304347f9 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Mon, 22 Aug 2016 23:12:19 -0400 Subject: [PATCH 04/63] Use "127.0.0.1" instead of "localhost" --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 94a891a14..006b8bdd4 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -88,11 +88,11 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { *

*/ public LocalServerReceiver() { - this("localhost", -1); + this("127.0.0.1", -1); } public LocalServerReceiver(String successLandingPageUrl, String failureLandingPageUrl) { - this("localhost", -1); + this(); this.successLandingPageUrl = successLandingPageUrl; this.failureLandingPageUrl = failureLandingPageUrl; } From c47267f0cc50d35d2c80fc42265d7ef77e3d5dbc Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Mon, 22 Aug 2016 23:18:33 -0400 Subject: [PATCH 05/63] Use "127.0.0.1" instead of "localhost" --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 006b8bdd4..b6780f2c6 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -81,7 +81,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { private String failureLandingPageUrl; /** - * Constructor that starts the server on {@code "localhost"} selects an unused port. + * Constructor that starts the server on {@code "127.0.0.1"} selects an unused port. * *

* Use {@link Builder} if you need to specify any of the optional parameters. @@ -188,7 +188,7 @@ private static int getUnusedPort() throws IOException { public static final class Builder { /** Host name to use. */ - private String host = "localhost"; + private String host = "127.0.0.1"; /** Port to use or {@code -1} to select an unused port. */ private int port = -1; From 08eca13a8216cff51f360d38afcc96ab056c41e7 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Mon, 22 Aug 2016 23:21:15 -0400 Subject: [PATCH 06/63] Add unit test for "127.0.0.1" --- .../jetty/auth/oauth2/LocalServerReceiverTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java index b0f8d6650..1f9e4ffb2 100644 --- a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -29,6 +29,11 @@ public class LocalServerReceiverTest { private StringBuilder responseOutput = new StringBuilder(); private String redirectedLandingPageUrl; + @Test + public void testNumericLocalhost() { + Assert.assertEquals("127.0.0.1", new LocalServerReceiver().getHost()); + } + @Test public void testSuccessLandingPage() throws IOException, InterruptedException { String successLandingPageUrl = "https://www.example.com/my-success-landing-page"; From aebcaa5524cdef84d488c0f3d4fa0ae0c9085f85 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Mon, 22 Aug 2016 23:22:01 -0400 Subject: [PATCH 07/63] Remove unused import --- .../extensions/jetty/auth/oauth2/LocalServerReceiverTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java index 1f9e4ffb2..84cd6fab4 100644 --- a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -18,7 +18,6 @@ import org.junit.Test; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; From 7b6341afe50e3392fd997de93228321558fcc2b6 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Tue, 23 Aug 2016 18:22:14 -0400 Subject: [PATCH 08/63] Fix comment --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index b6780f2c6..13769ca80 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -81,7 +81,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { private String failureLandingPageUrl; /** - * Constructor that starts the server on {@code "127.0.0.1"} selects an unused port. + * Constructor that starts the server on {@code "127.0.0.1"} and an unused port. * *

* Use {@link Builder} if you need to specify any of the optional parameters. From 4d6538c97addf7828b33efe8947a42c1c412090c Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Thu, 1 Sep 2016 13:23:13 -0400 Subject: [PATCH 09/63] Use named constant for "127.0.0.1" --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 13769ca80..12401c937 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -45,6 +45,8 @@ */ public final class LocalServerReceiver implements VerificationCodeReceiver { + private static final String LOCALHOST = "127.0.0.1"; + private static final String CALLBACK_PATH = "/Callback"; /** Server or {@code null} before {@link #getRedirectUri()}. */ @@ -88,7 +90,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { *

*/ public LocalServerReceiver() { - this("127.0.0.1", -1); + this(LOCALHOST, -1); } public LocalServerReceiver(String successLandingPageUrl, String failureLandingPageUrl) { From 2e2faf4a881ebebbde9fec008fbf0ca13589e45a Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Thu, 1 Sep 2016 15:51:38 -0400 Subject: [PATCH 10/63] Specify junit dependecy version: 4.8.2 --- google-oauth-client-jetty/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/google-oauth-client-jetty/pom.xml b/google-oauth-client-jetty/pom.xml index ca2428d52..b1f2cac81 100644 --- a/google-oauth-client-jetty/pom.xml +++ b/google-oauth-client-jetty/pom.xml @@ -79,6 +79,7 @@ junit junit + 4.8.2 test From ac9683fa6baf3f6a23af0f0f3adb0c054ef3d446 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Tue, 6 Sep 2016 14:40:42 -0400 Subject: [PATCH 11/63] Revert "127.0.0.1" back to "localhost" --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 4 ++-- .../jetty/auth/oauth2/LocalServerReceiverTest.java | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 12401c937..73c1287ad 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -83,7 +83,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { private String failureLandingPageUrl; /** - * Constructor that starts the server on {@code "127.0.0.1"} and an unused port. + * Constructor that starts the server on {@link #LOCALHOST} and an unused port. * *

* Use {@link Builder} if you need to specify any of the optional parameters. @@ -190,7 +190,7 @@ private static int getUnusedPort() throws IOException { public static final class Builder { /** Host name to use. */ - private String host = "127.0.0.1"; + private String host = LOCALHOST; /** Port to use or {@code -1} to select an unused port. */ private int port = -1; diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java index 84cd6fab4..0ee409123 100644 --- a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -28,11 +28,6 @@ public class LocalServerReceiverTest { private StringBuilder responseOutput = new StringBuilder(); private String redirectedLandingPageUrl; - @Test - public void testNumericLocalhost() { - Assert.assertEquals("127.0.0.1", new LocalServerReceiver().getHost()); - } - @Test public void testSuccessLandingPage() throws IOException, InterruptedException { String successLandingPageUrl = "https://www.example.com/my-success-landing-page"; From 9d911a7e118a18e8f86c96710689b9c1cd25692c Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Tue, 6 Sep 2016 14:42:03 -0400 Subject: [PATCH 12/63] Revert "127.0.0.1" back to "localhost" --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 73c1287ad..6e032ab4e 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -45,7 +45,7 @@ */ public final class LocalServerReceiver implements VerificationCodeReceiver { - private static final String LOCALHOST = "127.0.0.1"; + private static final String LOCALHOST = "localhost"; private static final String CALLBACK_PATH = "/Callback"; From ba89b79ea5d00286a50b4fb93a94761b7f35a66b Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Tue, 6 Sep 2016 16:20:09 -0400 Subject: [PATCH 13/63] Move landing page configuration to builder --- .../auth/oauth2/LocalServerReceiver.java | 24 ++++++++++++------- .../auth/oauth2/LocalServerReceiverTest.java | 12 ++++++---- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 6e032ab4e..fb6fe4f9d 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -90,13 +90,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { *

*/ public LocalServerReceiver() { - this(LOCALHOST, -1); - } - - public LocalServerReceiver(String successLandingPageUrl, String failureLandingPageUrl) { - this(); - this.successLandingPageUrl = successLandingPageUrl; - this.failureLandingPageUrl = failureLandingPageUrl; + this(LOCALHOST, -1, null, null); } /** @@ -105,9 +99,12 @@ public LocalServerReceiver(String successLandingPageUrl, String failureLandingPa * @param host Host name to use * @param port Port to use or {@code -1} to select an unused port */ - LocalServerReceiver(String host, int port) { + LocalServerReceiver(String host, int port, + String successLandingPageUrl, String failureLandingPageUrl) { this.host = host; this.port = port; + this.successLandingPageUrl = successLandingPageUrl; + this.failureLandingPageUrl = failureLandingPageUrl; } @Override @@ -195,9 +192,12 @@ public static final class Builder { /** Port to use or {@code -1} to select an unused port. */ private int port = -1; + private String successLandingPageUrl; + private String failureLandingPageUrl; + /** Builds the {@link LocalServerReceiver}. */ public LocalServerReceiver build() { - return new LocalServerReceiver(host, port); + return new LocalServerReceiver(host, port, successLandingPageUrl, failureLandingPageUrl); } /** Returns the host name to use. */ @@ -221,6 +221,12 @@ public Builder setPort(int port) { this.port = port; return this; } + + public Builder setLandingPages(String successLandingPageUrl, String failureLandingPageUrl) { + this.successLandingPageUrl = successLandingPageUrl; + this.failureLandingPageUrl = failureLandingPageUrl; + return this; + } } /** diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java index 0ee409123..ade3299cf 100644 --- a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -31,7 +31,8 @@ public class LocalServerReceiverTest { @Test public void testSuccessLandingPage() throws IOException, InterruptedException { String successLandingPageUrl = "https://www.example.com/my-success-landing-page"; - LocalServerReceiver receiver = new LocalServerReceiver(successLandingPageUrl, null); + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(successLandingPageUrl, null).build(); try { sendSuccessLoginResult(receiver.getRedirectUri()); @@ -44,7 +45,8 @@ public void testSuccessLandingPage() throws IOException, InterruptedException { @Test public void testFailureLandingPage() throws IOException { String failureLandingPageUrl = "https://www.example.com/my-failure-landing-page"; - LocalServerReceiver receiver = new LocalServerReceiver(null, failureLandingPageUrl); + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(null, failureLandingPageUrl).build(); try { sendFailureLoginResult(receiver.getRedirectUri()); @@ -56,7 +58,8 @@ public void testFailureLandingPage() throws IOException { @Test public void testDefaultSuccessLandingPage() throws IOException { - LocalServerReceiver receiver = new LocalServerReceiver(null, null); + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(null, null).build(); try { sendSuccessLoginResult(receiver.getRedirectUri()); @@ -68,7 +71,8 @@ public void testDefaultSuccessLandingPage() throws IOException { @Test public void testDefaultFailureLandingPage() throws IOException { - LocalServerReceiver receiver = new LocalServerReceiver(null, null); + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(null, null).build(); try { sendFailureLoginResult(receiver.getRedirectUri()); From 7992c8c4836933d61af891e64defb1d0929854c8 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Tue, 6 Sep 2016 16:40:29 -0400 Subject: [PATCH 14/63] Implement customizable landing pages after login --- google-oauth-client-jetty/pom.xml | 6 + .../auth/oauth2/LocalServerReceiver.java | 52 +++++-- .../auth/oauth2/LocalServerReceiverTest.java | 128 ++++++++++++++++++ 3 files changed, 177 insertions(+), 9 deletions(-) create mode 100644 google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java diff --git a/google-oauth-client-jetty/pom.xml b/google-oauth-client-jetty/pom.xml index 2d0ab379b..b1f2cac81 100644 --- a/google-oauth-client-jetty/pom.xml +++ b/google-oauth-client-jetty/pom.xml @@ -76,5 +76,11 @@ org.mortbay.jetty jetty + + junit + junit + 4.8.2 + test + diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index d24d33f4a..fb6fe4f9d 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -45,6 +45,8 @@ */ public final class LocalServerReceiver implements VerificationCodeReceiver { + private static final String LOCALHOST = "localhost"; + private static final String CALLBACK_PATH = "/Callback"; /** Server or {@code null} before {@link #getRedirectUri()}. */ @@ -69,14 +71,26 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { private final String host; /** - * Constructor that starts the server on {@code "localhost"} selects an unused port. + * URL to an HTML page to be shown (via redirect) after successful login. If null, a canned + * default landing page will be shown (via direct response). + */ + private String successLandingPageUrl; + + /** + * URL to an HTML page to be shown (via redirect) after failed login. If null, a canned + * default landing page will be shown (via direct response). + */ + private String failureLandingPageUrl; + + /** + * Constructor that starts the server on {@link #LOCALHOST} and an unused port. * *

* Use {@link Builder} if you need to specify any of the optional parameters. *

*/ public LocalServerReceiver() { - this("localhost", -1); + this(LOCALHOST, -1, null, null); } /** @@ -85,9 +99,12 @@ public LocalServerReceiver() { * @param host Host name to use * @param port Port to use or {@code -1} to select an unused port */ - LocalServerReceiver(String host, int port) { + LocalServerReceiver(String host, int port, + String successLandingPageUrl, String failureLandingPageUrl) { this.host = host; this.port = port; + this.successLandingPageUrl = successLandingPageUrl; + this.failureLandingPageUrl = failureLandingPageUrl; } @Override @@ -170,14 +187,17 @@ private static int getUnusedPort() throws IOException { public static final class Builder { /** Host name to use. */ - private String host = "localhost"; + private String host = LOCALHOST; /** Port to use or {@code -1} to select an unused port. */ private int port = -1; + private String successLandingPageUrl; + private String failureLandingPageUrl; + /** Builds the {@link LocalServerReceiver}. */ public LocalServerReceiver build() { - return new LocalServerReceiver(host, port); + return new LocalServerReceiver(host, port, successLandingPageUrl, failureLandingPageUrl); } /** Returns the host name to use. */ @@ -201,6 +221,12 @@ public Builder setPort(int port) { this.port = port; return this; } + + public Builder setLandingPages(String successLandingPageUrl, String failureLandingPageUrl) { + this.successLandingPageUrl = successLandingPageUrl; + this.failureLandingPageUrl = failureLandingPageUrl; + return this; + } } /** @@ -216,14 +242,22 @@ public void handle( if (!CALLBACK_PATH.equals(target)) { return; } - writeLandingHtml(response); - response.flushBuffer(); + ((Request) request).setHandled(true); lock.lock(); try { error = request.getParameter("error"); code = request.getParameter("code"); gotAuthorizationResponse.signal(); + + if (error == null && successLandingPageUrl != null) { + response.sendRedirect(successLandingPageUrl); + } else if (error != null && failureLandingPageUrl != null) { + response.sendRedirect(failureLandingPageUrl); + } else { + writeLandingHtml(response); + } + response.flushBuffer(); } finally { lock.unlock(); } @@ -237,9 +271,9 @@ private void writeLandingHtml(HttpServletResponse response) throws IOException { doc.println(""); doc.println("OAuth 2.0 Authentication Token Received"); doc.println(""); - doc.println("Received verification code. You may now close this window..."); + doc.println("Received verification code. You may now close this window."); doc.println(""); - doc.println(""); + doc.println(""); doc.flush(); } } diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java new file mode 100644 index 000000000..ade3299cf --- /dev/null +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.api.client.extensions.jetty.auth.oauth2; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +public class LocalServerReceiverTest { + + private int responseCode; + private StringBuilder responseOutput = new StringBuilder(); + private String redirectedLandingPageUrl; + + @Test + public void testSuccessLandingPage() throws IOException, InterruptedException { + String successLandingPageUrl = "https://www.example.com/my-success-landing-page"; + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(successLandingPageUrl, null).build(); + + try { + sendSuccessLoginResult(receiver.getRedirectUri()); + verifyRedirectedLandingPageUrl(successLandingPageUrl); + } finally { + receiver.stop(); + } + } + + @Test + public void testFailureLandingPage() throws IOException { + String failureLandingPageUrl = "https://www.example.com/my-failure-landing-page"; + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(null, failureLandingPageUrl).build(); + + try { + sendFailureLoginResult(receiver.getRedirectUri()); + verifyRedirectedLandingPageUrl(failureLandingPageUrl); + } finally { + receiver.stop(); + } + } + + @Test + public void testDefaultSuccessLandingPage() throws IOException { + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(null, null).build(); + + try { + sendSuccessLoginResult(receiver.getRedirectUri()); + verifyDefaultLandingPage(); + } finally { + receiver.stop(); + } + } + + @Test + public void testDefaultFailureLandingPage() throws IOException { + LocalServerReceiver receiver = + new LocalServerReceiver.Builder().setLandingPages(null, null).build(); + + try { + sendFailureLoginResult(receiver.getRedirectUri()); + verifyDefaultLandingPage(); + } finally { + receiver.stop(); + } + } + + private void verifyRedirectedLandingPageUrl(String landingPageUrlMatch) { + Assert.assertEquals(302, responseCode); + Assert.assertEquals(landingPageUrlMatch, redirectedLandingPageUrl); + Assert.assertTrue(responseOutput.toString().isEmpty()); + } + + private void verifyDefaultLandingPage() { + Assert.assertEquals(200, responseCode); + Assert.assertNull(redirectedLandingPageUrl); + Assert.assertTrue(responseOutput.toString().contains("")); + Assert.assertTrue(responseOutput.toString().contains("")); + } + + private void sendSuccessLoginResult(String serverEndpoint) throws IOException { + sendLoginResult(serverEndpoint, "?code=some-authorization-code"); + } + + private void sendFailureLoginResult(String serverEndpoint) throws IOException { + sendLoginResult(serverEndpoint, "?error=some-error"); + } + + private void sendLoginResult(final String serverEndpoint, final String parameters) + throws IOException { + HttpURLConnection connection = null; + + try { + URL url = new URL(serverEndpoint + parameters); + connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(2000 /* ms */); + connection.setReadTimeout(2000 /* ms */); + responseCode = connection.getResponseCode(); + redirectedLandingPageUrl = connection.getHeaderField("Location"); + + InputStreamReader reader = new InputStreamReader(connection.getInputStream(), "UTF-8"); + for (int ch = reader.read(); ch != -1; ch = reader.read()) { + responseOutput.append((char) ch); + } + } finally { + if (connection != null) { + connection.disconnect(); + } + } + } +} From 51fc6b84acefb07c602146cb69c05377371d4bd1 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Tue, 6 Sep 2016 17:08:47 -0400 Subject: [PATCH 15/63] Make stop() cancel waitForCode() / fix sync issue / fix port assignment issue / add unit tests --- .../auth/oauth2/LocalServerReceiver.java | 58 ++--- .../auth/oauth2/LocalServerReceiverTest.java | 238 +++++++++++++++++- 2 files changed, 246 insertions(+), 50 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index fb6fe4f9d..afba36a53 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -24,10 +24,7 @@ import java.io.IOException; import java.io.PrintWriter; -import java.net.Socket; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.Semaphore; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -58,11 +55,8 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { /** Error code or {@code null} for none. */ String error; - /** Lock on the code and error. */ - final Lock lock = new ReentrantLock(); - - /** Condition for receiving an authorization response. */ - final Condition gotAuthorizationResponse = lock.newCondition(); + /** To block until receiving an authorization response or stop() is called. */ + final Semaphore waitUntilSignaled = new Semaphore(0 /* initially zero permit */); /** Port to use or {@code -1} to select an unused port in {@link #getRedirectUri()}. */ private int port; @@ -109,16 +103,13 @@ public LocalServerReceiver() { @Override public String getRedirectUri() throws IOException { - if (port == -1) { - port = getUnusedPort(); - } - server = new Server(port); - for (Connector c : server.getConnectors()) { - c.setHost(host); - } + server = new Server(port != -1 ? port : 0); + Connector connector = server.getConnectors()[0]; + connector.setHost(host); server.addHandler(new CallbackHandler()); try { server.start(); + port = connector.getLocalPort(); } catch (Exception e) { Throwables.propagateIfPossible(e); throw new IOException(e); @@ -128,22 +119,16 @@ public String getRedirectUri() throws IOException { @Override public String waitForCode() throws IOException { - lock.lock(); - try { - while (code == null && error == null) { - gotAuthorizationResponse.awaitUninterruptibly(); - } - if (error != null) { - throw new IOException("User authorization failed (" + error + ")"); - } - return code; - } finally { - lock.unlock(); + waitUntilSignaled.acquireUninterruptibly(); + if (error != null) { + throw new IOException("User authorization failed (" + error + ")"); } + return code; } @Override public void stop() throws IOException { + waitUntilSignaled.release(); if (server != null) { try { server.stop(); @@ -167,16 +152,6 @@ public int getPort() { return port; } - private static int getUnusedPort() throws IOException { - Socket s = new Socket(); - s.bind(null); - try { - return s.getLocalPort(); - } finally { - s.close(); - } - } - /** * Builder. * @@ -243,12 +218,10 @@ public void handle( return; } - ((Request) request).setHandled(true); - lock.lock(); try { + ((Request) request).setHandled(true); error = request.getParameter("error"); code = request.getParameter("code"); - gotAuthorizationResponse.signal(); if (error == null && successLandingPageUrl != null) { response.sendRedirect(successLandingPageUrl); @@ -258,8 +231,9 @@ public void handle( writeLandingHtml(response); } response.flushBuffer(); - } finally { - lock.unlock(); + } + finally { + waitUntilSignaled.release(); } } diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java index ade3299cf..fa2e1a3ba 100644 --- a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -14,7 +14,11 @@ package com.google.api.client.extensions.jetty.auth.oauth2; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + import org.junit.Test; import java.io.IOException; @@ -24,6 +28,224 @@ public class LocalServerReceiverTest { + @Test + public void testActualPort() throws IOException { + LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + receiver.getRedirectUri(); + assertTrue(receiver.getPort() != 0); + assertTrue(receiver.getPort() != -1); + } finally { + receiver.stop(); + } + } + + @Test + public void testRedirectUri() throws IOException { + LocalServerReceiver receiver = new LocalServerReceiver("localhost", -1, null, null); + + try { + String localEndpoint = receiver.getRedirectUri(); + assertEquals("http://localhost:" + receiver.getPort() + "/Callback", localEndpoint); + } finally { + receiver.stop(); + } + } + + boolean forkTermianted; + String authCode; + String error; + + @Test + public void testPrematureStopCancelsWaitForCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + receiver.getRedirectUri(); + + receiver.stop(); + Thread fork = runWaitForCodeThread(receiver); + + verifyForkTermination(fork); + } finally { + receiver.stop(); + } + } + + @Test + public void testStopCancelsWaitForCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + receiver.getRedirectUri(); + + Thread fork = runWaitForCodeThread(receiver); + Thread.sleep(100 /* ms */); // Sleep for a while to make fork run into waitForCode(). + receiver.stop(); + + verifyForkTermination(fork); + } finally { + receiver.stop(); + } + } + + @Test + public void testPrematureLoginCancelsWaitForCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + String localEndpoint = receiver.getRedirectUri(); + + sendSuccessLoginResult(localEndpoint); + Thread fork = runWaitForCodeThread(receiver); + + verifyForkTermination(fork); + verifyLoginSuccess(); + } finally { + receiver.stop(); + } + } + + @Test + public void testLoginCancelsWaitForCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + String localEndpoint = receiver.getRedirectUri(); // Start the server. + + Thread fork = runWaitForCodeThread(receiver); + Thread.sleep(100 /* ms */); // Sleep for a while to make fork run into waitForCode(). + sendSuccessLoginResult(localEndpoint); + + verifyForkTermination(fork); + verifyLoginSuccess(); + } finally { + receiver.stop(); + } + } + + @Test + public void testPrematureLoginErrorCancelsWaitForCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + String localEndpoint = receiver.getRedirectUri(); + + sendFailureLoginResult(localEndpoint); + Thread fork = runWaitForCodeThread(receiver); + + verifyForkTermination(fork); + verifyLoginFailure(); + } finally { + receiver.stop(); + } + } + + @Test + public void testLoginErrorCancelsWaitForCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + String localEndpoint = receiver.getRedirectUri(); // Start the server. + + Thread fork = runWaitForCodeThread(receiver); + Thread.sleep(100 /* ms */); // Sleep for a while to make fork run into waitForCode(). + sendFailureLoginResult(localEndpoint); + + verifyForkTermination(fork); + verifyLoginFailure(); + } finally { + receiver.stop(); + } + } + + @Test + public void testWaitForCodeIsBlocked() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + receiver.getRedirectUri(); + + runWaitForCodeThread(receiver); + Thread.sleep(200); + assertFalse(forkTermianted); + } finally { + receiver.stop(); + } + } + + @Test + public void testStopDoesNotChangeAuthCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + String localEndpoint = receiver.getRedirectUri(); // Start the server. + + Thread fork = runWaitForCodeThread(receiver); + Thread.sleep(100 /* ms */); // Sleep for a while to make fork run into waitForCode(). + sendSuccessLoginResult(localEndpoint); + receiver.stop(); + + verifyForkTermination(fork); + verifyLoginSuccess(); + } finally { + receiver.stop(); + } + } + + @Test + public void testStopDoesNotChangeErrorCode() throws IOException, InterruptedException { + final LocalServerReceiver receiver = new LocalServerReceiver(); + + try { + String localEndpoint = receiver.getRedirectUri(); + + Thread fork = runWaitForCodeThread(receiver); + Thread.sleep(100 /* ms */); // Sleep for a while to make fork run into waitForCode(). + sendFailureLoginResult(localEndpoint); + receiver.stop(); + + verifyForkTermination(fork); + verifyLoginFailure(); + } finally { + receiver.stop(); + } + } + + private Thread runWaitForCodeThread(final LocalServerReceiver receiver) { + Thread fork = new Thread(new Runnable() { + @Override + public void run() { + try { + authCode = receiver.waitForCode(); + } catch (IOException ioe) { + error = ioe.getMessage(); + } + finally { + forkTermianted = true; + } + } + }); + fork.start(); + return fork; + } + + private void verifyForkTermination(Thread fork) throws InterruptedException { + fork.join(3000 /* ms */); // Test should pass right away. Don't wait too long. + assertTrue(forkTermianted); + } + + private void verifyLoginSuccess() { + assertEquals(authCode, "some-authorization-code"); + assertNull(error); + } + + private void verifyLoginFailure() { + assertEquals(authCode, null); + assertTrue(error.contains("some-error")); + } + private int responseCode; private StringBuilder responseOutput = new StringBuilder(); private String redirectedLandingPageUrl; @@ -83,16 +305,16 @@ public void testDefaultFailureLandingPage() throws IOException { } private void verifyRedirectedLandingPageUrl(String landingPageUrlMatch) { - Assert.assertEquals(302, responseCode); - Assert.assertEquals(landingPageUrlMatch, redirectedLandingPageUrl); - Assert.assertTrue(responseOutput.toString().isEmpty()); + assertEquals(302, responseCode); + assertEquals(landingPageUrlMatch, redirectedLandingPageUrl); + assertTrue(responseOutput.toString().isEmpty()); } private void verifyDefaultLandingPage() { - Assert.assertEquals(200, responseCode); - Assert.assertNull(redirectedLandingPageUrl); - Assert.assertTrue(responseOutput.toString().contains("")); - Assert.assertTrue(responseOutput.toString().contains("")); + assertEquals(200, responseCode); + assertNull(redirectedLandingPageUrl); + assertTrue(responseOutput.toString().contains("")); + assertTrue(responseOutput.toString().contains("")); } private void sendSuccessLoginResult(String serverEndpoint) throws IOException { From 8bc06ddbeef7359897ab947465cffa7a01ece95f Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Wed, 7 Sep 2016 17:36:53 -0400 Subject: [PATCH 16/63] Use better name for semaphore --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index afba36a53..86d3d23ca 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -56,7 +56,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { String error; /** To block until receiving an authorization response or stop() is called. */ - final Semaphore waitUntilSignaled = new Semaphore(0 /* initially zero permit */); + final Semaphore waitUnlessSignaled = new Semaphore(0 /* initially zero permit */); /** Port to use or {@code -1} to select an unused port in {@link #getRedirectUri()}. */ private int port; @@ -119,7 +119,7 @@ public String getRedirectUri() throws IOException { @Override public String waitForCode() throws IOException { - waitUntilSignaled.acquireUninterruptibly(); + waitUnlessSignaled.acquireUninterruptibly(); if (error != null) { throw new IOException("User authorization failed (" + error + ")"); } @@ -128,7 +128,7 @@ public String waitForCode() throws IOException { @Override public void stop() throws IOException { - waitUntilSignaled.release(); + waitUnlessSignaled.release(); if (server != null) { try { server.stop(); @@ -233,7 +233,7 @@ public void handle( response.flushBuffer(); } finally { - waitUntilSignaled.release(); + waitUnlessSignaled.release(); } } From af5b48d1a06817404db49fc1ffea27df537293dc Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Wed, 14 Sep 2016 14:06:56 -0400 Subject: [PATCH 17/63] Add JavaDoc for waitForCode() --- .../jetty/auth/oauth2/LocalServerReceiver.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 86d3d23ca..9567c76c2 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -117,6 +117,15 @@ public String getRedirectUri() throws IOException { return "http://" + host + ":" + port + CALLBACK_PATH; } + /** + * Blocks until the server receives a login result, or the server is stopped + * by {@link #stop()}, to return an authorization code. + * + * @return authorization code if login succeeds; may return {@code null} if the server + * is stopped by {@link #stop()} + * @throws IOException if the server receives an error code (through an HTTP request + * parameter {@code error}) + */ @Override public String waitForCode() throws IOException { waitUnlessSignaled.acquireUninterruptibly(); From f4d0716fa492575ea90e075accc8493cfdddf8ba Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Tue, 20 Sep 2016 11:24:26 -0400 Subject: [PATCH 18/63] Clarify difference between ExpiresIn and ExpirationTime --- .../api/client/auth/oauth2/Credential.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java index 558ce8932..ad358e8ca 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java @@ -389,7 +389,10 @@ public Credential setRefreshToken(String refreshToken) { return this; } - /** Expected expiration time in milliseconds or {@code null} for none. */ + /** + * Expected expiration time in milliseconds relative to the + * {@link System#currentTimeMillis() Java epoch}, or {@code null} for none. + */ public final Long getExpirationTimeMilliseconds() { lock.lock(); try { @@ -400,7 +403,8 @@ public final Long getExpirationTimeMilliseconds() { } /** - * Sets the expected expiration time in milliseconds or {@code null} for none. + * Sets the expected expiration time in milliseconds relative to the + * {@link System#currentTimeMillis() Java epoch}, or {@code null} for none. * *

* Overriding is only supported for the purpose of calling the super implementation and changing @@ -418,8 +422,8 @@ public Credential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds) } /** - * Returns the remaining lifetime in seconds of the access token (for example 3600 for an hour, or - * -3600 if expired an hour ago) or {@code null} if unknown. + * Returns the remaining lifetime in seconds of the access token (for example 3600 for an hour + * from now, or -3600 if expired an hour ago) or {@code null} if unknown. */ public final Long getExpiresInSeconds() { lock.lock(); @@ -434,16 +438,16 @@ public final Long getExpiresInSeconds() { } /** - * Sets the lifetime in seconds of the access token (for example 3600 for an hour) or {@code null} - * for none. + * Sets the lifetime in seconds of the access token (for example 3600 for an hour from now) + * or {@code null} for none. * *

* Overriding is only supported for the purpose of calling the super implementation and changing * the return type, but nothing else. *

* - * @param expiresIn lifetime in seconds of the access token (for example 3600 for an hour) or - * {@code null} for none + * @param expiresIn lifetime in seconds of the access token (for example 3600 for an hour from now) + * or {@code null} for none */ public Credential setExpiresInSeconds(Long expiresIn) { return setExpirationTimeMilliseconds( From e58b7ba526243152b613b4c207c7430c46773f8e Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Tue, 20 Sep 2016 14:59:50 -0400 Subject: [PATCH 19/63] Change line break to keep Checkstyle happy --- .../java/com/google/api/client/auth/oauth2/Credential.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java index ad358e8ca..771daffc0 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java @@ -446,8 +446,8 @@ public final Long getExpiresInSeconds() { * the return type, but nothing else. *

* - * @param expiresIn lifetime in seconds of the access token (for example 3600 for an hour from now) - * or {@code null} for none + * @param expiresIn lifetime in seconds of the access token (for example 3600 for an hour from + * now) or {@code null} for none */ public Credential setExpiresInSeconds(Long expiresIn) { return setExpirationTimeMilliseconds( From 57fd88b34bea69005c0a3bf0ad547a7a3acb2005 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Mon, 9 Jan 2017 16:26:23 -0500 Subject: [PATCH 20/63] Add OSGi Metadata (#139) Adding metadata to the following modules: `google-oauth-client` `google-oauth-client-java6` `google-oauth-client-servlet` `google-oauth-client-appengine` `google-oauth-client-jetty` --- google-oauth-client-appengine/pom.xml | 31 ++++++++++++++++++--------- google-oauth-client-java6/pom.xml | 31 ++++++++++++++++++--------- google-oauth-client-jetty/pom.xml | 31 ++++++++++++++++++--------- google-oauth-client-servlet/pom.xml | 31 ++++++++++++++++++--------- google-oauth-client/pom.xml | 23 ++++++++++++++------ 5 files changed, 101 insertions(+), 46 deletions(-) diff --git a/google-oauth-client-appengine/pom.xml b/google-oauth-client-appengine/pom.xml index af34cabbc..28e207971 100644 --- a/google-oauth-client-appengine/pom.xml +++ b/google-oauth-client-appengine/pom.xml @@ -30,24 +30,15 @@ true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - jar - compile - - jar - - - maven-source-plugin source-jar - compile jar @@ -82,6 +73,26 @@ + + org.apache.felix + maven-bundle-plugin + 2.5.4 + + + com.google.oauth-client-appengine + JavaSE-1.6 + + + + + bundle-manifest + process-classes + + manifest + + + + diff --git a/google-oauth-client-java6/pom.xml b/google-oauth-client-java6/pom.xml index 0eb923a2b..a52527655 100644 --- a/google-oauth-client-java6/pom.xml +++ b/google-oauth-client-java6/pom.xml @@ -29,24 +29,15 @@ true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - jar - compile - - jar - - - maven-source-plugin source-jar - compile jar @@ -65,6 +56,26 @@ + + org.apache.felix + maven-bundle-plugin + 2.5.4 + + + com.google.oauth-client-java6 + JavaSE-1.6 + + + + + bundle-manifest + process-classes + + manifest + + + + diff --git a/google-oauth-client-jetty/pom.xml b/google-oauth-client-jetty/pom.xml index b1f2cac81..b5fb918ae 100644 --- a/google-oauth-client-jetty/pom.xml +++ b/google-oauth-client-jetty/pom.xml @@ -29,24 +29,15 @@ true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - jar - compile - - jar - - - maven-source-plugin source-jar - compile jar @@ -65,6 +56,26 @@ + + org.apache.felix + maven-bundle-plugin + 2.5.4 + + + com.google.oauth-client-jetty + JavaSE-1.6 + + + + + bundle-manifest + process-classes + + manifest + + + + diff --git a/google-oauth-client-servlet/pom.xml b/google-oauth-client-servlet/pom.xml index 38fd8b185..028d4ae5f 100644 --- a/google-oauth-client-servlet/pom.xml +++ b/google-oauth-client-servlet/pom.xml @@ -30,24 +30,15 @@ true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - jar - compile - - jar - - - maven-source-plugin source-jar - compile jar @@ -70,6 +61,26 @@ + + org.apache.felix + maven-bundle-plugin + 2.5.4 + + + com.google.oauth-client-servlet + JavaSE-1.6 + + + + + bundle-manifest + process-classes + + manifest + + + + diff --git a/google-oauth-client/pom.xml b/google-oauth-client/pom.xml index 395fe33ec..fbcdf1b47 100644 --- a/google-oauth-client/pom.xml +++ b/google-oauth-client/pom.xml @@ -34,12 +34,15 @@ true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + maven-source-plugin - jar - compile + source-jar jar @@ -47,13 +50,21 @@ - maven-source-plugin + org.apache.felix + maven-bundle-plugin + 2.5.4 + + + com.google.oauth-client + JavaSE-1.6 + + - source-jar - compile + bundle-manifest + process-classes - jar + manifest From 7a861a3e2d2917cf4b9200876ad0716f67bc9c6f Mon Sep 17 00:00:00 2001 From: galacticvac Date: Mon, 6 Feb 2017 17:30:41 -0500 Subject: [PATCH 21/63] Allow credential without explicit expire time (#144) Certain sites provide an access token without an expiration. Currently this causes a NullPointerException. This change is to allow valid credentials that don't have an expiry. --- .../java6/auth/oauth2/AuthorizationCodeInstalledApp.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-oauth-client-java6/src/main/java/com/google/api/client/extensions/java6/auth/oauth2/AuthorizationCodeInstalledApp.java b/google-oauth-client-java6/src/main/java/com/google/api/client/extensions/java6/auth/oauth2/AuthorizationCodeInstalledApp.java index c537b2cd0..544c31bb8 100644 --- a/google-oauth-client-java6/src/main/java/com/google/api/client/extensions/java6/auth/oauth2/AuthorizationCodeInstalledApp.java +++ b/google-oauth-client-java6/src/main/java/com/google/api/client/extensions/java6/auth/oauth2/AuthorizationCodeInstalledApp.java @@ -69,7 +69,9 @@ public Credential authorize(String userId) throws IOException { try { Credential credential = flow.loadCredential(userId); if (credential != null - && (credential.getRefreshToken() != null || credential.getExpiresInSeconds() > 60)) { + && (credential.getRefreshToken() != null || + credential.getExpiresInSeconds() == null || + credential.getExpiresInSeconds() > 60)) { return credential; } // open in browser From 4bf1c458896b80e99c519913844ec736dc68bc2f Mon Sep 17 00:00:00 2001 From: Devendra Tewari Date: Sat, 18 Feb 2017 11:31:40 -0300 Subject: [PATCH 22/63] Add setter for callback path --- .../auth/oauth2/LocalServerReceiver.java | 41 +++++++++++++++++-- .../auth/oauth2/LocalServerReceiverTest.java | 13 ++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 9567c76c2..6127b35ca 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -64,6 +64,9 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { /** Host name to use. */ private final String host; + /** Callback path of redirect_uri */ + private final String callbackPath; + /** * URL to an HTML page to be shown (via redirect) after successful login. If null, a canned * default landing page will be shown (via direct response). @@ -84,7 +87,7 @@ public final class LocalServerReceiver implements VerificationCodeReceiver { *

*/ public LocalServerReceiver() { - this(LOCALHOST, -1, null, null); + this(LOCALHOST, -1, CALLBACK_PATH, null, null); } /** @@ -95,8 +98,20 @@ public LocalServerReceiver() { */ LocalServerReceiver(String host, int port, String successLandingPageUrl, String failureLandingPageUrl) { + this(host, port, CALLBACK_PATH, successLandingPageUrl, failureLandingPageUrl); + } + + /** + * Constructor. + * + * @param host Host name to use + * @param port Port to use or {@code -1} to select an unused port + */ + LocalServerReceiver(String host, int port, String callbackPath, + String successLandingPageUrl, String failureLandingPageUrl) { this.host = host; this.port = port; + this.callbackPath = callbackPath; this.successLandingPageUrl = successLandingPageUrl; this.failureLandingPageUrl = failureLandingPageUrl; } @@ -114,7 +129,7 @@ public String getRedirectUri() throws IOException { Throwables.propagateIfPossible(e); throw new IOException(e); } - return "http://" + host + ":" + port + CALLBACK_PATH; + return "http://" + host + ":" + port + callbackPath; } /** @@ -161,6 +176,13 @@ public int getPort() { return port; } + /** + * Returns callback path used in redirect_uri. + */ + public String getCallbackPath() { + return callbackPath; + } + /** * Builder. * @@ -179,9 +201,11 @@ public static final class Builder { private String successLandingPageUrl; private String failureLandingPageUrl; + private String callbackPath = CALLBACK_PATH; + /** Builds the {@link LocalServerReceiver}. */ public LocalServerReceiver build() { - return new LocalServerReceiver(host, port, successLandingPageUrl, failureLandingPageUrl); + return new LocalServerReceiver(host, port, callbackPath, successLandingPageUrl, failureLandingPageUrl); } /** Returns the host name to use. */ @@ -206,6 +230,17 @@ public Builder setPort(int port) { return this; } + /** Returns the callback path of redirect_uri */ + public String getCallbackPath() { + return callbackPath; + } + + /** Set the callback path of redirect_uri */ + public Builder setCallbackPath(String callbackPath) { + this.callbackPath = callbackPath; + return this; + } + public Builder setLandingPages(String successLandingPageUrl, String failureLandingPageUrl) { this.successLandingPageUrl = successLandingPageUrl; this.failureLandingPageUrl = failureLandingPageUrl; diff --git a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java index fa2e1a3ba..cd754f2cc 100644 --- a/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java +++ b/google-oauth-client-jetty/src/test/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiverTest.java @@ -53,6 +53,19 @@ public void testRedirectUri() throws IOException { } } + @Test + public void testCallbackPath() throws IOException { + final String CALLBACK_PATH = "/Some/other/path"; + LocalServerReceiver receiver = new LocalServerReceiver("localhost", -1, CALLBACK_PATH, null, null); + + try { + String localEndpoint = receiver.getRedirectUri(); + assertEquals("http://localhost:" + receiver.getPort() + CALLBACK_PATH, localEndpoint); + } finally { + receiver.stop(); + } + } + boolean forkTermianted; String authCode; String error; From 446346ce9e1bbcc4fcc9589ea513d25680b5cd7f Mon Sep 17 00:00:00 2001 From: Devendra Tewari Date: Mon, 20 Feb 2017 10:50:54 -0300 Subject: [PATCH 23/63] Fix checkstyle error --- .../extensions/jetty/auth/oauth2/LocalServerReceiver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 6127b35ca..656f3f053 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -205,7 +205,8 @@ public static final class Builder { /** Builds the {@link LocalServerReceiver}. */ public LocalServerReceiver build() { - return new LocalServerReceiver(host, port, callbackPath, successLandingPageUrl, failureLandingPageUrl); + return new LocalServerReceiver(host, port, callbackPath, + successLandingPageUrl, failureLandingPageUrl); } /** Returns the host name to use. */ From 0740d7b224c6627bc1210bd00aff52db6703d34f Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Wed, 15 Mar 2017 14:42:54 -0700 Subject: [PATCH 24/63] Add scope provided to pom.xml (#150) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Don’t include the API as servlet containers will need it. It looks like it may be needed for client-jetty, but that seems to target a very old version of jetty. --- google-oauth-client-appengine/pom.xml | 1 + google-oauth-client-servlet/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/google-oauth-client-appengine/pom.xml b/google-oauth-client-appengine/pom.xml index 28e207971..ddefb840a 100644 --- a/google-oauth-client-appengine/pom.xml +++ b/google-oauth-client-appengine/pom.xml @@ -121,6 +121,7 @@ javax.servlet servlet-api + provided com.google.guava diff --git a/google-oauth-client-servlet/pom.xml b/google-oauth-client-servlet/pom.xml index 028d4ae5f..9eae335b9 100644 --- a/google-oauth-client-servlet/pom.xml +++ b/google-oauth-client-servlet/pom.xml @@ -100,6 +100,7 @@ javax.servlet servlet-api + provided javax.jdo From d0e0e804521b9d1f9b9dd24de5a715e66466f1e2 Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Sat, 6 May 2017 12:26:37 -0700 Subject: [PATCH 25/63] Revert "Master" --- .../api/client/auth/oauth2/Credential.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java index 771daffc0..558ce8932 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java @@ -389,10 +389,7 @@ public Credential setRefreshToken(String refreshToken) { return this; } - /** - * Expected expiration time in milliseconds relative to the - * {@link System#currentTimeMillis() Java epoch}, or {@code null} for none. - */ + /** Expected expiration time in milliseconds or {@code null} for none. */ public final Long getExpirationTimeMilliseconds() { lock.lock(); try { @@ -403,8 +400,7 @@ public final Long getExpirationTimeMilliseconds() { } /** - * Sets the expected expiration time in milliseconds relative to the - * {@link System#currentTimeMillis() Java epoch}, or {@code null} for none. + * Sets the expected expiration time in milliseconds or {@code null} for none. * *

* Overriding is only supported for the purpose of calling the super implementation and changing @@ -422,8 +418,8 @@ public Credential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds) } /** - * Returns the remaining lifetime in seconds of the access token (for example 3600 for an hour - * from now, or -3600 if expired an hour ago) or {@code null} if unknown. + * Returns the remaining lifetime in seconds of the access token (for example 3600 for an hour, or + * -3600 if expired an hour ago) or {@code null} if unknown. */ public final Long getExpiresInSeconds() { lock.lock(); @@ -438,16 +434,16 @@ public final Long getExpiresInSeconds() { } /** - * Sets the lifetime in seconds of the access token (for example 3600 for an hour from now) - * or {@code null} for none. + * Sets the lifetime in seconds of the access token (for example 3600 for an hour) or {@code null} + * for none. * *

* Overriding is only supported for the purpose of calling the super implementation and changing * the return type, but nothing else. *

* - * @param expiresIn lifetime in seconds of the access token (for example 3600 for an hour from - * now) or {@code null} for none + * @param expiresIn lifetime in seconds of the access token (for example 3600 for an hour) or + * {@code null} for none */ public Credential setExpiresInSeconds(Long expiresIn) { return setExpirationTimeMilliseconds( From 40f5d27a5a3e1f13a67f0e4eb2731cb3a2704d46 Mon Sep 17 00:00:00 2001 From: gak Date: Thu, 14 Jul 2016 14:18:45 -0700 Subject: [PATCH 26/63] Update imports ordering to the new java import order (go/java-imports). The import order is changing because the current rules are unnecessarily complicated, difficult to configure in IDEs, and difficult for users to remember. More information: http://go/java-imports-lsc Tested: $ blaze build //java/com/google/api/client/benchmarks/model:all //java/com/google/api/client/benchmarks:all //java/com/google/api/client/extensions/android/json:all //java/com/google/api/client/extensions/android:all //java/com/google/api/client/extensions/jetty/auth/oauth2:all //java/com/google/api/client/googleapis/extensions/android/accounts:all //java/com/google/api/client/googleapis/extensions/android/gms/auth:all //java/com/google/api/client/googleapis/xml/atom:all //java/com/google/api/client/http/apache:all //java/com/google/api/client/http/xml/atom:all //java/com/google/api/client/http/xml:all //java/com/google/api/client/test/json:all //java/com/google/api/client/test/util/store:all //java/com/google/api/client/testing/http/apache:all //java/com/google/api/client/xml/atom:all //java/com/google/api/client/xml:all http://sponge/a7602dcb-ac8b-4609-9add-4a9e66f34eaf All failing tests were failing before this change ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127472734 --- .../jetty/auth/oauth2/LocalServerReceiver.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java index 656f3f053..618e90a26 100644 --- a/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java +++ b/google-oauth-client-jetty/src/main/java/com/google/api/client/extensions/jetty/auth/oauth2/LocalServerReceiver.java @@ -16,18 +16,15 @@ import com.google.api.client.extensions.java6.auth.oauth2.VerificationCodeReceiver; import com.google.api.client.util.Throwables; - -import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Request; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.handler.AbstractHandler; - import java.io.IOException; import java.io.PrintWriter; import java.util.concurrent.Semaphore; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.mortbay.jetty.Connector; +import org.mortbay.jetty.Request; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.handler.AbstractHandler; /** * OAuth 2.0 verification code receiver that runs a Jetty server on a free port, waiting for a From 79ddf40ed53a3abac88e642eea6d638844804be4 Mon Sep 17 00:00:00 2001 From: gak Date: Mon, 18 Jul 2016 18:08:26 -0700 Subject: [PATCH 27/63] Update imports ordering to the new java import order (go/java-imports). The import order is changing because the current rules are unnecessarily complicated, difficult to configure in IDEs, and difficult for users to remember. More information: http://go/java-imports-lsc Tested: $ blaze build //javatests/com/google/android/libraries/componentview/components/gencode:all //javatests/com/google/android/libraries/componentview/components/interactive:all //javatests/com/google/android/libraries/componentview/performance/testactivity:all //javatests/com/google/android/libraries/componentview/robolectric:all //javatests/com/google/android/libraries/curvular/codegen:all //javatests/com/google/android/libraries/gcoreclient/common/api/mocks:all //javatests/com/google/android/libraries/glide/cronet:all //javatests/com/google/android/libraries/gmb/bizinfov2/mocks:all //javatests/com/google/android/libraries/gmb/experiments/mocks:all //javatests/com/google/android/libraries/hangouts/video/testing:all //javatests/com/google/android/libraries/kids/supervision/chimera/shadows:all //javatests/com/google/android/libraries/kids/supervision/testcommon:all //javatests/com/google/android/libraries/location/beacon/testing:all //javatests/com/google/android/libraries/location/normalizer:all //javatests/com/google/android/libraries/location/places/eval/conversions:all //javatests/com/google/android/libraries/location/places/inference/data/model:all //javatests/com/google/android/libraries/location/places/inference/data:all //javatests/com/google/android/libraries/location/places/inference/modules:all //javatests/com/google/android/libraries/micore/context/libs/cm:all //javatests/com/google/android/libraries/micore/training/sampleapp:all //javatests/com/google/android/libraries/micore/training/service:all //javatests/com/google/android/libraries/nbu/flags:all //javatests/com/google/android/libraries/performance/primes/hprof:all //javatests/com/google/android/libraries/performance/primes/testharness:all //javatests/com/google/android/libraries/photoeditor/core:all //javatests/com/google/android/libraries/sense/processor/matchmaker:all //javatests/com/google/android/libraries/social/autobackup:all //javatests/com/google/android/libraries/social/experiments/mocks:all //javatests/com/google/android/libraries/social/notifications/testing:all //javatests/com/google/android/libraries/social/people/mocks:all //javatests/com/google/android/libraries/social/sendkit/apitest:all //javatests/com/google/android/libraries/social/sendkit/shellapp:all //javatests/com/google/android/libraries/social/socialanalytics/testing:all //javatests/com/google/android/libraries/social/squares/apitest:all //javatests/com/google/android/libraries/social/stream/streamview/shellapp:all //javatests/com/google/android/libraries/social/testing/espresso/idlingresource:all //javatests/com/google/android/libraries/stitch/binder/compiler/bar:all //javatests/com/google/android/libraries/stitch/incompat/lgemenuoverride:all //javatests/com/google/android/libraries/tvdetect:all //javatests/com/google/android/libraries/velour/buildtools/resources:all //javatests/com/google/android/libraries/youtube/common/nio:all //javatests/com/google/android/libraries/youtube/creator/fluff:all //javatests/com/google/android/libraries/youtube/edit/filters/renderer/client/pipeline:all //javatests/com/google/android/libraries/youtube/innertube/crawler/processor:all //javatests/com/google/android/libraries/youtube/player/proxy:all //javatests/com/google/android/libraries/youtube/systemhealth:all //javatests/com/google/android/libraries/youtube/upload/faststart:all //javatests/com/google/android/testing/loganalysis/parser/impl:all //javatests/com/google/android/wh/common:all //javatests/com/google/api/buganizer/stubby:all //javatests/com/google/api/client/auth/oauth:all //javatests/com/google/api/client/dapper:all //javatests/com/google/api/client/googleapis/batch:all //javatests/com/google/api/client/googleapis/extensions/appengine/auth/oauth2:all //javatests/com/google/api/client/googleapis:all //javatests/com/google/api/client/testing/util:all //javatests/com/google/api/client/util:all //javatests/com/google/api/client/xml:all //javatests/com/google/api/management/dcshared/apiconfiguration:all //javatests/com/google/api/management/dcshared/quota/appstats:all //javatests/com/google/api/management/offline/migration:all //javatests/com/google/api/management/server/apis/loasproject/v1:all //javatests/com/google/api/management/server/apis/servicemanager/v1:all //javatests/com/google/api/management/server/controlplanemigration:all //javatests/com/google/api/management/server/core/flows/util/testing:all //javatests/com/google/api/management/server/debug:all //javatests/com/google/api/management/server/domain/irdb:all //javatests/com/google/api/management/server/integrations/consumersettings:all //javatests/com/google/api/management/server/integrations/gfe/coordinatorv2:all //javatests/com/google/api/management/server/integrations/precisequotaserver:all //javatests/com/google/api/management/server/integrations/quotaserver/client:all //javatests/com/google/api/management/server/integrations/respay:all //javatests/com/google/api/management/server/integrations/serviceaccounts:all //javatests/com/google/api/management/server/superquota:all //javatests/com/google/api/management/services/apis/common/dcvisibility:all http://sponge/b448ece6-ceda-4d4a-ab21-d7511d3351e6 Some tests failed; test failures are believed to be unrelated to this CL ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127782949 --- .../extensions/java6/auth/oauth2/FileCredentialStoreTest.java | 4 +--- .../com/google/api/client/auth/oauth/OAuthHmacSignerTest.java | 3 +-- .../com/google/api/client/auth/oauth/OAuthRsaSignerTest.java | 4 +--- .../google/api/client/auth/oauth2/AuthenticationTestBase.java | 4 +--- .../client/auth/oauth2/AuthorizationCodeRequestUrlTest.java | 3 +-- .../api/client/auth/oauth2/AuthorizationRequestUrlTest.java | 3 +-- .../api/client/auth/oauth2/BrowserClientRequestUrlTest.java | 3 +-- .../auth/oauth2/ClientParametersAuthenticationTest.java | 4 +--- .../com/google/api/client/auth/openidconnect/IdTokenTest.java | 4 +--- .../api/client/auth/openidconnect/IdTokenVerifierTest.java | 4 +--- 10 files changed, 10 insertions(+), 26 deletions(-) diff --git a/google-oauth-client-java6/src/test/java/com/google/api/client/extensions/java6/auth/oauth2/FileCredentialStoreTest.java b/google-oauth-client-java6/src/test/java/com/google/api/client/extensions/java6/auth/oauth2/FileCredentialStoreTest.java index 7f0dd169e..424f263a6 100644 --- a/google-oauth-client-java6/src/test/java/com/google/api/client/extensions/java6/auth/oauth2/FileCredentialStoreTest.java +++ b/google-oauth-client-java6/src/test/java/com/google/api/client/extensions/java6/auth/oauth2/FileCredentialStoreTest.java @@ -35,12 +35,10 @@ import com.google.common.base.Charsets; import com.google.common.collect.ImmutableSet; import com.google.common.io.Files; - -import junit.framework.TestCase; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import junit.framework.TestCase; /** * Tests {@link FileCredentialStore}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthHmacSignerTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthHmacSignerTest.java index 9e337e0dc..64e58e9f1 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthHmacSignerTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthHmacSignerTest.java @@ -14,9 +14,8 @@ package com.google.api.client.auth.oauth; -import junit.framework.TestCase; - import java.security.GeneralSecurityException; +import junit.framework.TestCase; /** * Tests {@link OAuthHmacSigner}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthRsaSignerTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthRsaSignerTest.java index cdb04c51a..a664bab5a 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthRsaSignerTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth/OAuthRsaSignerTest.java @@ -17,11 +17,9 @@ import com.google.api.client.util.Base64; import com.google.api.client.util.SecurityUtils; import com.google.api.client.util.StringUtils; - -import junit.framework.TestCase; - import java.security.GeneralSecurityException; import java.security.KeyPairGenerator; +import junit.framework.TestCase; /** * Tests {@link OAuthRsaSigner}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthenticationTestBase.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthenticationTestBase.java index f2ab7908a..aa49b0ebb 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthenticationTestBase.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthenticationTestBase.java @@ -24,10 +24,8 @@ import com.google.api.client.testing.http.MockLowLevelHttpRequest; import com.google.api.client.testing.http.MockLowLevelHttpResponse; import com.google.api.client.util.GenericData; - -import junit.framework.TestCase; - import java.io.IOException; +import junit.framework.TestCase; /** * Base class for tests of authentication code. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java index 751876a5a..29c50eb82 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java @@ -15,9 +15,8 @@ package com.google.api.client.auth.oauth2; -import junit.framework.TestCase; - import java.util.Arrays; +import junit.framework.TestCase; /** * Tests {@link AuthorizationCodeRequestUrl}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationRequestUrlTest.java index ff249524e..bcf696760 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationRequestUrlTest.java @@ -15,9 +15,8 @@ package com.google.api.client.auth.oauth2; -import junit.framework.TestCase; - import java.util.Arrays; +import junit.framework.TestCase; /** * Tests {@link AuthorizationRequestUrl}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/BrowserClientRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/BrowserClientRequestUrlTest.java index 5738a3a1d..e891b28a8 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/BrowserClientRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/BrowserClientRequestUrlTest.java @@ -15,9 +15,8 @@ package com.google.api.client.auth.oauth2; -import junit.framework.TestCase; - import java.util.Arrays; +import junit.framework.TestCase; /** * Tests {@link BrowserClientRequestUrl}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/ClientParametersAuthenticationTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/ClientParametersAuthenticationTest.java index 28aac530e..df73eab33 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/ClientParametersAuthenticationTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/ClientParametersAuthenticationTest.java @@ -18,10 +18,8 @@ import com.google.api.client.http.UrlEncodedContent; import com.google.api.client.testing.http.HttpTesting; import com.google.api.client.testing.http.MockHttpTransport; - -import junit.framework.TestCase; - import java.util.Map; +import junit.framework.TestCase; /** * Tests {@link ClientParametersAuthentication}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenTest.java index 1b1d5e1d7..7f9667390 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenTest.java @@ -14,10 +14,8 @@ package com.google.api.client.auth.openidconnect; -import junit.framework.TestCase; - import java.util.Arrays; - +import junit.framework.TestCase; /** * Tests {@link IdToken}. diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java index 6665fe96f..ab37da737 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java @@ -18,12 +18,10 @@ import com.google.api.client.json.webtoken.JsonWebSignature.Header; import com.google.api.client.util.Clock; import com.google.api.client.util.Lists; - -import junit.framework.TestCase; - import java.util.Arrays; import java.util.Collections; import java.util.List; +import junit.framework.TestCase; /** * Tests {@link IdTokenVerifier}. From 2ce0fb70492af785545082d0190fadd5daf4db9f Mon Sep 17 00:00:00 2001 From: neozwu Date: Wed, 13 Sep 2017 15:58:48 -0700 Subject: [PATCH 28/63] start 1.24 (#162) --- google-oauth-client-appengine/pom.xml | 2 +- ...ttp-client-1.24.0-SNAPSHOT.jar.properties} | 0 ...nt-android-1.24.0-SNAPSHOT.jar.properties} | 0 ...lient-gson-1.24.0-SNAPSHOT.jar.properties} | 0 ...nt-jackson-1.24.0-SNAPSHOT.jar.properties} | 0 ...t-jackson2-1.24.0-SNAPSHOT.jar.properties} | 0 ...t-protobuf-1.24.0-SNAPSHOT.jar.properties} | 0 ...client-xml-1.24.0-SNAPSHOT.jar.properties} | 0 ...uth-client-1.24.0-SNAPSHOT.jar.properties} | 0 ...ogle-http-client-android-dependencies.html | 24 +-- ...le-http-client-appengine-dependencies.html | 34 ++-- .../google-http-client-dependencies.html | 148 +++++++++++++----- .../google-http-client-gson-dependencies.html | 34 ++-- ...ogle-http-client-jackson-dependencies.html | 36 ++--- ...gle-http-client-jackson2-dependencies.html | 34 ++-- .../google-http-client-jdo-dependencies.html | 34 ++-- ...gle-http-client-protobuf-dependencies.html | 24 +-- .../google-http-client-xml-dependencies.html | 24 +-- ...e-oauth-client-appengine-dependencies.html | 106 ++++++------- .../google-oauth-client-dependencies.html | 34 ++-- ...oogle-oauth-client-java6-dependencies.html | 44 +++--- ...oogle-oauth-client-jetty-dependencies.html | 136 ++++++++++------ ...gle-oauth-client-servlet-dependencies.html | 96 +++++++----- google-oauth-client-assembly/pom.xml | 2 +- google-oauth-client-java6/pom.xml | 2 +- google-oauth-client-jetty/pom.xml | 2 +- google-oauth-client-servlet/pom.xml | 2 +- google-oauth-client/pom.xml | 2 +- pom.xml | 4 +- 29 files changed, 473 insertions(+), 351 deletions(-) rename google-oauth-client-assembly/android-properties/{google-http-client-1.23.0-SNAPSHOT.jar.properties => google-http-client-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-http-client-android-1.23.0-SNAPSHOT.jar.properties => google-http-client-android-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-http-client-gson-1.23.0-SNAPSHOT.jar.properties => google-http-client-gson-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-http-client-jackson-1.23.0-SNAPSHOT.jar.properties => google-http-client-jackson-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-http-client-jackson2-1.23.0-SNAPSHOT.jar.properties => google-http-client-jackson2-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-http-client-protobuf-1.23.0-SNAPSHOT.jar.properties => google-http-client-protobuf-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-http-client-xml-1.23.0-SNAPSHOT.jar.properties => google-http-client-xml-1.24.0-SNAPSHOT.jar.properties} (100%) rename google-oauth-client-assembly/android-properties/{google-oauth-client-1.23.0-SNAPSHOT.jar.properties => google-oauth-client-1.24.0-SNAPSHOT.jar.properties} (100%) diff --git a/google-oauth-client-appengine/pom.xml b/google-oauth-client-appengine/pom.xml index ddefb840a..b1c02619b 100644 --- a/google-oauth-client-appengine/pom.xml +++ b/google-oauth-client-appengine/pom.xml @@ -4,7 +4,7 @@ com.google.oauth-client google-oauth-client-parent - 1.23.0-SNAPSHOT + 1.24.0-SNAPSHOT ../pom.xml google-oauth-client-appengine diff --git a/google-oauth-client-assembly/android-properties/google-http-client-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-http-client-android-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-android-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-android-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-android-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-http-client-gson-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-gson-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-gson-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-gson-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-http-client-jackson-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-jackson-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-jackson-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-jackson-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-http-client-jackson2-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-jackson2-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-jackson2-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-jackson2-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-http-client-protobuf-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-protobuf-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-protobuf-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-protobuf-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-http-client-xml-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-http-client-xml-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-http-client-xml-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-http-client-xml-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/android-properties/google-oauth-client-1.23.0-SNAPSHOT.jar.properties b/google-oauth-client-assembly/android-properties/google-oauth-client-1.24.0-SNAPSHOT.jar.properties similarity index 100% rename from google-oauth-client-assembly/android-properties/google-oauth-client-1.23.0-SNAPSHOT.jar.properties rename to google-oauth-client-assembly/android-properties/google-oauth-client-1.24.0-SNAPSHOT.jar.properties diff --git a/google-oauth-client-assembly/dependencies/google-http-client-android-dependencies.html b/google-oauth-client-assembly/dependencies/google-http-client-android-dependencies.html index 0598e6a9c..7e176d519 100644 --- a/google-oauth-client-assembly/dependencies/google-http-client-android-dependencies.html +++ b/google-oauth-client-assembly/dependencies/google-http-client-android-dependencies.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ @import url("./css/site.css"); - + @@ -24,8 +24,8 @@
- Last Published: 2016-03-28 -  | Version: 1.23.0-SNAPSHOT + Last Published: 2017-09-13 +  | Version: 1.24.0-SNAPSHOT
@@ -63,7 +63,7 @@

compile

com.google.http-client google-http-client -1.23.0-SNAPSHOT +1.24.0-SNAPSHOT jar The Apache Software License, Version 2.0
@@ -181,7 +181,7 @@

Project Dependency Graph