[1/3] hadoop git commit: HADOOP-14799. Update nimbus-jose-jwt to 4.41.1. (rchiang)
Repository: hadoop Updated Branches: refs/heads/branch-2 f7e5e45b7 -> eeb731307 refs/heads/branch-2.8 db1ec739e -> 4c4a2fb42 refs/heads/branch-2.9 d9d8fa1d3 -> ed1719730 HADOOP-14799. Update nimbus-jose-jwt to 4.41.1. (rchiang) (cherry picked from commit 556812c179aa094c21acf610439a8d69fe6420ab) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/eeb73130 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/eeb73130 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/eeb73130 Branch: refs/heads/branch-2 Commit: eeb731307f303e0748ad02c53912a2ba1806da09 Parents: f7e5e45 Author: Ray ChiangAuthored: Tue Sep 12 10:19:34 2017 -0700 Committer: Brahma Reddy Battula Committed: Thu Feb 22 18:08:52 2018 +0530 -- .../JWTRedirectAuthenticationHandler.java | 4 +- .../TestJWTRedirectAuthenticationHandler.java | 476 ++ .../TestJWTRedirectAuthentictionHandler.java| 481 --- .../mapreduce/task/reduce/TestFetcher.java | 4 - hadoop-project/pom.xml | 2 +- 5 files changed, 480 insertions(+), 487 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/eeb73130/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java -- diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java index 61f5b9e..884398c 100644 --- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java +++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java @@ -28,6 +28,7 @@ import java.text.ParseException; import java.security.interfaces.RSAPublicKey; +import com.google.common.annotations.VisibleForTesting; import org.apache.hadoop.security.authentication.client.AuthenticationException; import org.apache.hadoop.security.authentication.util.CertificateUtil; import org.slf4j.Logger; @@ -216,7 +217,8 @@ public class JWTRedirectAuthenticationHandler extends * @param request for getting the original request URL * @return url to use as login url for redirect */ - protected String constructLoginURL(HttpServletRequest request) { + @VisibleForTesting + String constructLoginURL(HttpServletRequest request) { String delimiter = "?"; if (authenticationProviderUrl.contains("?")) { delimiter = "&"; http://git-wip-us.apache.org/repos/asf/hadoop/blob/eeb73130/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java -- diff --git a/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java new file mode 100644 index 000..5a2db9b --- /dev/null +++ b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java @@ -0,0 +1,476 @@ +/** + * 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. See accompanying LICENSE file. + */ +package org.apache.hadoop.security.authentication.server; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.List; +import java.util.ArrayList; +import java.util.Properties; +import java.util.Vector; +import java.util.Date; + +import javax.servlet.ServletException; +import javax.servlet.http.Cookie;
[1/3] hadoop git commit: HADOOP-14799. Update nimbus-jose-jwt to 4.41.1. (rchiang)
Repository: hadoop Updated Branches: refs/heads/branch-2 08feac4c8 -> 577a26719 refs/heads/branch-2.8 486fa889d -> bfd8fb309 refs/heads/branch-2.9 b8b67e4b8 -> 557d6f281 HADOOP-14799. Update nimbus-jose-jwt to 4.41.1. (rchiang) (cherry picked from commit 556812c179aa094c21acf610439a8d69fe6420ab) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/577a2671 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/577a2671 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/577a2671 Branch: refs/heads/branch-2 Commit: 577a267198b1d745eee85d1ad9af64d4506bbd0a Parents: 08feac4 Author: Ray ChiangAuthored: Tue Sep 12 10:19:34 2017 -0700 Committer: Brahma Reddy Battula Committed: Wed Feb 14 00:07:09 2018 +0530 -- .../JWTRedirectAuthenticationHandler.java | 4 +- .../TestJWTRedirectAuthenticationHandler.java | 476 ++ .../TestJWTRedirectAuthentictionHandler.java| 481 --- .../mapreduce/task/reduce/TestFetcher.java | 4 - hadoop-project/pom.xml | 2 +- 5 files changed, 480 insertions(+), 487 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/577a2671/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java -- diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java index 61f5b9e..884398c 100644 --- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java +++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/JWTRedirectAuthenticationHandler.java @@ -28,6 +28,7 @@ import java.text.ParseException; import java.security.interfaces.RSAPublicKey; +import com.google.common.annotations.VisibleForTesting; import org.apache.hadoop.security.authentication.client.AuthenticationException; import org.apache.hadoop.security.authentication.util.CertificateUtil; import org.slf4j.Logger; @@ -216,7 +217,8 @@ public class JWTRedirectAuthenticationHandler extends * @param request for getting the original request URL * @return url to use as login url for redirect */ - protected String constructLoginURL(HttpServletRequest request) { + @VisibleForTesting + String constructLoginURL(HttpServletRequest request) { String delimiter = "?"; if (authenticationProviderUrl.contains("?")) { delimiter = "&"; http://git-wip-us.apache.org/repos/asf/hadoop/blob/577a2671/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java -- diff --git a/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java new file mode 100644 index 000..5a2db9b --- /dev/null +++ b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/server/TestJWTRedirectAuthenticationHandler.java @@ -0,0 +1,476 @@ +/** + * 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. See accompanying LICENSE file. + */ +package org.apache.hadoop.security.authentication.server; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.List; +import java.util.ArrayList; +import java.util.Properties; +import java.util.Vector; +import java.util.Date; + +import javax.servlet.ServletException; +import javax.servlet.http.Cookie;