zeppelin git commit: ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

2018-04-25 Thread zjffdu
Repository: zeppelin
Updated Branches:
  refs/heads/master 5632d2cd9 -> 806831454


ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

### What is this PR for?

SparkInterpreterLauncherTest will fail when you already have enviroment 
variable setup in the machine where you run the unit test.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3428

### How should this be tested?
* CI pass

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang 

Closes #2943 from zjffdu/ZEPPELIN-3428 and squashes the following commits:

6b89b22 [Jeff Zhang] ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/80683145
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/80683145
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/80683145

Branch: refs/heads/master
Commit: 806831454502d052f504d162bf6d6ab0aad02920
Parents: 5632d2c
Author: Jeff Zhang 
Authored: Wed Apr 25 08:31:56 2018 +0800
Committer: Jeff Zhang 
Committed: Wed Apr 25 17:43:38 2018 +0800

--
 .../launcher/SparkInterpreterLauncherTest.java| 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/80683145/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
--
diff --git 
a/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
 
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
index 0bd79af..82f9e2a 100644
--- 
a/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
+++ 
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
@@ -57,7 +57,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(2, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 2);
 assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
 assertEquals(" --master local[*] --conf spark.files='file_1' --conf 
spark.jars='jar_1'", interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -82,7 +82,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(2, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 2);
 assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
 assertEquals(" --master yarn-client --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -108,7 +108,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(2, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 2);
 assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
 assertEquals(" --master yarn --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.submit.deployMode='client' --conf 
spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -133,7 +133,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(3, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 3);
 assertEquals(

zeppelin git commit: ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

2018-04-25 Thread zjffdu
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 3da7bd683 -> e5a080e6d


ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

### What is this PR for?

SparkInterpreterLauncherTest will fail when you already have enviroment 
variable setup in the machine where you run the unit test.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3428

### How should this be tested?
* CI pass

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang 

Closes #2943 from zjffdu/ZEPPELIN-3428 and squashes the following commits:

6b89b22 [Jeff Zhang] ZEPPELIN-3428. Flaky test: SparkInterpreterLauncherTest

(cherry picked from commit 806831454502d052f504d162bf6d6ab0aad02920)
Signed-off-by: Jeff Zhang 


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/e5a080e6
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/e5a080e6
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/e5a080e6

Branch: refs/heads/branch-0.8
Commit: e5a080e6d3357d7afc7d43765772b1dda318305f
Parents: 3da7bd6
Author: Jeff Zhang 
Authored: Wed Apr 25 08:31:56 2018 +0800
Committer: Jeff Zhang 
Committed: Wed Apr 25 17:43:53 2018 +0800

--
 .../launcher/SparkInterpreterLauncherTest.java| 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e5a080e6/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
--
diff --git 
a/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
 
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
index eb44809..ef5a04e 100644
--- 
a/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
+++ 
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/launcher/SparkInterpreterLauncherTest.java
@@ -50,7 +50,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(2, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 2);
 assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
 assertEquals(" --master local[*] --conf spark.files='file_1' --conf 
spark.jars='jar_1'", interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -75,7 +75,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(2, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 2);
 assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
 assertEquals(" --master yarn-client --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -101,7 +101,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(2, interpreterProcess.getEnv().size());
+assertTrue(interpreterProcess.getEnv().size() >= 2);
 assertEquals("/user/spark", interpreterProcess.getEnv().get("SPARK_HOME"));
 assertEquals(" --master yarn --conf spark.files='file_1' --conf 
spark.jars='jar_1' --conf spark.submit.deployMode='client' --conf 
spark.yarn.isPython=true", 
interpreterProcess.getEnv().get("ZEPPELIN_SPARK_CONF"));
   }
@@ -126,7 +126,7 @@ public class SparkInterpreterLauncherTest {
 
assertTrue(interpreterProcess.getInterpreterDir().endsWith("/interpreter/spark"));
 
assertTrue(interpreterProcess.getLocalRepoDir().endsWith("/local-repo/groupId"));
 assertEquals(zConf.getInterpreterRemoteRunnerPath(), 
interpreterProcess.getInterpreterRunner());
-assertEquals(3, interpre

zeppelin git commit: [ZEPPELIN-3311] Zeppelin should ask user to re-login after JWT cookie expires (KnoxJwtRealm)

2018-04-25 Thread rkamath
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 7f16c5d1e -> 3da7bd683


[ZEPPELIN-3311] Zeppelin should ask user to re-login after JWT cookie expires 
(KnoxJwtRealm)

Zeppelin should ask user to re-login after JWT cookie expires.

[Bug Fix]

* [ZEPPELIN-3311](https://issues.apache.org/jira/browse/ZEPPELIN-3311)

Steps to reproduce :
1) Enable SSO for zeppelin
2) Login to zeppelin using SSO.
3) Now wait till JWT expires(knoxsso.token.ttl under Advanced knoxsso-topology 
could be set to lower values to get a short lived cookie)
4) Refresh zeppelin. Zeppelin doesn't ask for re-login, though JWT is already 
expired and not valid anymore.

* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A

Author: Prabhjyot Singh 

Closes #2941 from prabhjyotsingh/ZEPPELIN-3311 and squashes the following 
commits:

0014d5ad8 [Prabhjyot Singh] ZEPPELIN-3311: Zeppelin should ask user to re-login 
after JWT cookie expires (KnoxJwtRealm)

Change-Id: Ie113f6078974cf914d259fae3d2987cf8364d71c
(cherry picked from commit 5632d2cd94b9ea8646ba5382be993598e2640a6f)
Signed-off-by: Renjith Kamath 


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/3da7bd68
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/3da7bd68
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/3da7bd68

Branch: refs/heads/branch-0.8
Commit: 3da7bd68374b3cf7f092a8e164d77c2465a6aca2
Parents: 7f16c5d
Author: Prabhjyot Singh 
Authored: Tue Apr 24 15:42:55 2018 +0530
Committer: Renjith Kamath 
Committed: Wed Apr 25 14:44:30 2018 +0530

--
 .../apache/zeppelin/realm/jwt/KnoxJwtRealm.java | 40 +++-
 1 file changed, 39 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3da7bd68/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
--
diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java 
b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
index a903e6e..d3a2759 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
@@ -30,6 +30,7 @@ import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 import java.security.interfaces.RSAPublicKey;
 import java.text.ParseException;
+import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -128,7 +129,17 @@ public class KnoxJwtRealm extends AuthorizingRealm {
   protected boolean validateToken(String token) {
 try {
   SignedJWT signed = SignedJWT.parse(token);
-  return validateSignature(signed);
+  boolean sigValid = validateSignature(signed);
+  if (!sigValid) {
+LOGGER.warn("Signature of JWT token could not be verified. Please 
check the public key");
+return false;
+  }
+  boolean expValid = validateExpiration(signed);
+  if (!expValid) {
+LOGGER.warn("Expiration time validation of JWT token failed.");
+return false;
+  }
+  return true;
 } catch (ParseException ex) {
   LOGGER.info("ParseException in validateToken", ex);
   return false;
@@ -184,6 +195,33 @@ public class KnoxJwtRealm extends AuthorizingRealm {
 return valid;
   }
 
+  /**
+   * Validate that the expiration time of the JWT token has not been violated.
+   * If it has then throw an AuthenticationException. Override this method in
+   * subclasses in order to customize the expiration validation behavior.
+   *
+   * @param jwtToken
+   *the token that contains the expiration date to validate
+   * @return valid true if the token has not expired; false otherwise
+   */
+  protected boolean validateExpiration(SignedJWT jwtToken) {
+boolean valid = false;
+try {
+  Date expires = jwtToken.getJWTClaimsSet().getExpirationTime();
+  if (expires == null || new Date().before(expires)) {
+if (LOGGER.isDebugEnabled()) {
+  LOGGER.debug("SSO token expiration date has been " + "successfully 
validated");
+}
+valid = true;
+  } else {
+LOGGER.warn("SSO expiration date validation failed.");
+  }
+} catch (ParseException pe) {
+  LOGGER.warn("SSO expiration date validation failed.", pe);
+}
+return valid;
+  }
+
   @Override
   protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection 
principals) {
 Set roles = mapGroupPrincipals(principals.toString());



zeppelin git commit: [ZEPPELIN-3311] Zeppelin should ask user to re-login after JWT cookie expires (KnoxJwtRealm)

2018-04-25 Thread rkamath
Repository: zeppelin
Updated Branches:
  refs/heads/master c4fdf5883 -> 5632d2cd9


[ZEPPELIN-3311] Zeppelin should ask user to re-login after JWT cookie expires 
(KnoxJwtRealm)

Zeppelin should ask user to re-login after JWT cookie expires.

[Bug Fix]

* [ZEPPELIN-3311](https://issues.apache.org/jira/browse/ZEPPELIN-3311)

Steps to reproduce :
1) Enable SSO for zeppelin
2) Login to zeppelin using SSO.
3) Now wait till JWT expires(knoxsso.token.ttl under Advanced knoxsso-topology 
could be set to lower values to get a short lived cookie)
4) Refresh zeppelin. Zeppelin doesn't ask for re-login, though JWT is already 
expired and not valid anymore.

* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A

Author: Prabhjyot Singh 

Closes #2941 from prabhjyotsingh/ZEPPELIN-3311 and squashes the following 
commits:

0014d5ad8 [Prabhjyot Singh] ZEPPELIN-3311: Zeppelin should ask user to re-login 
after JWT cookie expires (KnoxJwtRealm)

Change-Id: Ie113f6078974cf914d259fae3d2987cf8364d71c


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/5632d2cd
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/5632d2cd
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/5632d2cd

Branch: refs/heads/master
Commit: 5632d2cd94b9ea8646ba5382be993598e2640a6f
Parents: c4fdf58
Author: Prabhjyot Singh 
Authored: Tue Apr 24 15:42:55 2018 +0530
Committer: Renjith Kamath 
Committed: Wed Apr 25 14:40:55 2018 +0530

--
 .../apache/zeppelin/realm/jwt/KnoxJwtRealm.java | 40 +++-
 1 file changed, 39 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5632d2cd/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
--
diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java 
b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
index 7c13590..3d87aa5 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
@@ -16,6 +16,7 @@
  */
 package org.apache.zeppelin.realm.jwt;
 
+import java.util.Date;
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.Groups;
@@ -129,7 +130,17 @@ public class KnoxJwtRealm extends AuthorizingRealm {
   protected boolean validateToken(String token) {
 try {
   SignedJWT signed = SignedJWT.parse(token);
-  return validateSignature(signed);
+  boolean sigValid = validateSignature(signed);
+  if (!sigValid) {
+LOGGER.warn("Signature of JWT token could not be verified. Please 
check the public key");
+return false;
+  }
+  boolean expValid = validateExpiration(signed);
+  if (!expValid) {
+LOGGER.warn("Expiration time validation of JWT token failed.");
+return false;
+  }
+  return true;
 } catch (ParseException ex) {
   LOGGER.info("ParseException in validateToken", ex);
   return false;
@@ -182,6 +193,33 @@ public class KnoxJwtRealm extends AuthorizingRealm {
 return valid;
   }
 
+  /**
+   * Validate that the expiration time of the JWT token has not been violated.
+   * If it has then throw an AuthenticationException. Override this method in
+   * subclasses in order to customize the expiration validation behavior.
+   *
+   * @param jwtToken
+   *the token that contains the expiration date to validate
+   * @return valid true if the token has not expired; false otherwise
+   */
+  protected boolean validateExpiration(SignedJWT jwtToken) {
+boolean valid = false;
+try {
+  Date expires = jwtToken.getJWTClaimsSet().getExpirationTime();
+  if (expires == null || new Date().before(expires)) {
+if (LOGGER.isDebugEnabled()) {
+  LOGGER.debug("SSO token expiration date has been " + "successfully 
validated");
+}
+valid = true;
+  } else {
+LOGGER.warn("SSO expiration date validation failed.");
+  }
+} catch (ParseException pe) {
+  LOGGER.warn("SSO expiration date validation failed.", pe);
+}
+return valid;
+  }
+
   @Override
   protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection 
principals) {
 Set roles = mapGroupPrincipals(principals.toString());



zeppelin git commit: Fix type note => user

2018-04-25 Thread rkamath
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 7d37243a6 -> 7f16c5d1e


Fix type note => user

Just fix a typo

Hot Fix

* Not sure if a jira issue is required?

* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Thomas Decaux 

Closes #2940 from ebuildy/patch-1 and squashes the following commits:

7a4ebab3f [Thomas Decaux] Fix type note => user

Change-Id: If7c5afd42fa162d3337386408d4722062d5eb59b
(cherry picked from commit c4fdf5883c1881e36b152b444f8456a4f98e96cb)
Signed-off-by: Renjith Kamath 


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7f16c5d1
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7f16c5d1
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7f16c5d1

Branch: refs/heads/branch-0.8
Commit: 7f16c5d1ec0507474a1983a8e18d940d15a8410f
Parents: 7d37243
Author: Thomas Decaux 
Authored: Mon Apr 23 19:11:13 2018 +0200
Committer: Renjith Kamath 
Committed: Wed Apr 25 14:39:37 2018 +0530

--
 zeppelin-web/src/app/interpreter/interpreter-create.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7f16c5d1/zeppelin-web/src/app/interpreter/interpreter-create.html
--
diff --git a/zeppelin-web/src/app/interpreter/interpreter-create.html 
b/zeppelin-web/src/app/interpreter/interpreter-create.html
index 8bf29a9..3078d65 100644
--- a/zeppelin-web/src/app/interpreter/interpreter-create.html
+++ b/zeppelin-web/src/app/interpreter/interpreter-create.html
@@ -100,7 +100,7 @@ limitations under the License.
 
   
 scoped per user
   
@@ -117,7 +117,7 @@ limitations under the License.
 
   
 isolated per user
   



zeppelin git commit: Fix type note => user

2018-04-25 Thread rkamath
Repository: zeppelin
Updated Branches:
  refs/heads/master ad77265c6 -> c4fdf5883


Fix type note => user

Just fix a typo

Hot Fix

* Not sure if a jira issue is required?

* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Thomas Decaux 

Closes #2940 from ebuildy/patch-1 and squashes the following commits:

7a4ebab3f [Thomas Decaux] Fix type note => user

Change-Id: If7c5afd42fa162d3337386408d4722062d5eb59b


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/c4fdf588
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/c4fdf588
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/c4fdf588

Branch: refs/heads/master
Commit: c4fdf5883c1881e36b152b444f8456a4f98e96cb
Parents: ad77265
Author: Thomas Decaux 
Authored: Mon Apr 23 19:11:13 2018 +0200
Committer: Renjith Kamath 
Committed: Wed Apr 25 14:39:25 2018 +0530

--
 zeppelin-web/src/app/interpreter/interpreter-create.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/c4fdf588/zeppelin-web/src/app/interpreter/interpreter-create.html
--
diff --git a/zeppelin-web/src/app/interpreter/interpreter-create.html 
b/zeppelin-web/src/app/interpreter/interpreter-create.html
index 8bf29a9..3078d65 100644
--- a/zeppelin-web/src/app/interpreter/interpreter-create.html
+++ b/zeppelin-web/src/app/interpreter/interpreter-create.html
@@ -100,7 +100,7 @@ limitations under the License.
 
   
 scoped per user
   
@@ -117,7 +117,7 @@ limitations under the License.
 
   
 isolated per user
   



zeppelin git commit: [HOTFIX] ZEPPELIN-3405 fix permission checks with roles

2018-04-25 Thread rkamath
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 5279fa0b1 -> 7d37243a6


[HOTFIX] ZEPPELIN-3405 fix permission checks with roles

hotfix for #2931
https://github.com/apache/zeppelin/pull/2931#issuecomment-383736331

[Hot Fix]

* [ ] - Task

https://issues.apache.org/jira/browse/ZEPPELIN-3405

see PR description

* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Renjith Kamath 

Closes #2942 from r-kamath/hotfix_ZEPPELIN-3405 and squashes the following 
commits:

b93c2de93 [Renjith Kamath] ZEPPELIN-3405 fix permission checks with roles

Change-Id: I1ce0d0306dc665b0267042a5e9181a13f136fac1
(cherry picked from commit ad77265c69bf2ea5fe82fa8c15c7a3d3ea2178e3)
Signed-off-by: Renjith Kamath 


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7d37243a
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7d37243a
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7d37243a

Branch: refs/heads/branch-0.8
Commit: 7d37243a6b8541812d1b141b63a223330b31a0b5
Parents: 5279fa0
Author: Renjith Kamath 
Authored: Tue Apr 24 16:47:44 2018 +0530
Committer: Renjith Kamath 
Committed: Wed Apr 25 14:36:06 2018 +0530

--
 .../java/org/apache/zeppelin/user/AuthenticationInfo.java| 8 +---
 .../org/apache/zeppelin/user/AuthenticationInfoTest.java | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7d37243a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
--
diff --git 
a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
 
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
index fe9cba6..c9412cb 100644
--- 
a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
+++ 
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
@@ -57,13 +57,7 @@ public class AuthenticationInfo implements JsonSerializable {
   public AuthenticationInfo(String user, String roles, String ticket) {
 this.user = user;
 this.ticket = ticket;
-if (StringUtils.isNotBlank(roles) && roles.length() > 2) {
-  this.roles = new ArrayList<>();
-  for (final String role : roles.substring(1, roles.length() - 1)
-  .split(",")) {
-this.roles.add(role.trim());
-  }
-}
+this.roles = gson.fromJson(roles, ArrayList.class);
   }
 
   public String getUser() {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7d37243a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
--
diff --git 
a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
 
b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
index a13d91a..b757033 100644
--- 
a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
+++ 
b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
@@ -28,7 +28,7 @@ public class AuthenticationInfoTest {
 
   @Test
   public void testRoles() {
-final String roles = "[role1, role2, role with space]";
+final String roles = "[\"role1\", \"role2\", \"role with space\"]";
 
 final AuthenticationInfo authenticationInfo = new AuthenticationInfo("foo",
 roles, "bar");



zeppelin git commit: [HOTFIX] ZEPPELIN-3405 fix permission checks with roles

2018-04-25 Thread rkamath
Repository: zeppelin
Updated Branches:
  refs/heads/master 0a47b1393 -> ad77265c6


[HOTFIX] ZEPPELIN-3405 fix permission checks with roles

hotfix for #2931
https://github.com/apache/zeppelin/pull/2931#issuecomment-383736331

[Hot Fix]

* [ ] - Task

https://issues.apache.org/jira/browse/ZEPPELIN-3405

see PR description

* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Renjith Kamath 

Closes #2942 from r-kamath/hotfix_ZEPPELIN-3405 and squashes the following 
commits:

b93c2de93 [Renjith Kamath] ZEPPELIN-3405 fix permission checks with roles

Change-Id: I1ce0d0306dc665b0267042a5e9181a13f136fac1


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/ad77265c
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/ad77265c
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/ad77265c

Branch: refs/heads/master
Commit: ad77265c69bf2ea5fe82fa8c15c7a3d3ea2178e3
Parents: 0a47b13
Author: Renjith Kamath 
Authored: Tue Apr 24 16:47:44 2018 +0530
Committer: Renjith Kamath 
Committed: Wed Apr 25 14:35:44 2018 +0530

--
 .../java/org/apache/zeppelin/user/AuthenticationInfo.java| 8 +---
 .../org/apache/zeppelin/user/AuthenticationInfoTest.java | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ad77265c/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
--
diff --git 
a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
 
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
index fe9cba6..c9412cb 100644
--- 
a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
+++ 
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java
@@ -57,13 +57,7 @@ public class AuthenticationInfo implements JsonSerializable {
   public AuthenticationInfo(String user, String roles, String ticket) {
 this.user = user;
 this.ticket = ticket;
-if (StringUtils.isNotBlank(roles) && roles.length() > 2) {
-  this.roles = new ArrayList<>();
-  for (final String role : roles.substring(1, roles.length() - 1)
-  .split(",")) {
-this.roles.add(role.trim());
-  }
-}
+this.roles = gson.fromJson(roles, ArrayList.class);
   }
 
   public String getUser() {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ad77265c/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
--
diff --git 
a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
 
b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
index a13d91a..b757033 100644
--- 
a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
+++ 
b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/AuthenticationInfoTest.java
@@ -28,7 +28,7 @@ public class AuthenticationInfoTest {
 
   @Test
   public void testRoles() {
-final String roles = "[role1, role2, role with space]";
+final String roles = "[\"role1\", \"role2\", \"role with space\"]";
 
 final AuthenticationInfo authenticationInfo = new AuthenticationInfo("foo",
 roles, "bar");