Repository: zeppelin Updated Branches: refs/heads/master 2e6f14702 -> 5381883ff
add a configuration zeppelin.jdbc.auth.kerberos.proxy for kerberos proxy behavior â¦e to disable proxy behavior ### What is this PR for? A few sentences describing the overall goals of the pull request's commits. First time? Check out the contributing guide - https://zeppelin.apache.org/contribution/contributions.html ### What type of PR is it? [Improvement] * add a configuration item zeppelin.jdbc.auth.kerberos.proxy.enable to disable kerberos behaviour as we knowï¼ in current version of zeppelinï¼ if we have kerberos auth configuredï¼and using zeppelin with a user loginï¼the jdbc interpreter will do a proxy behavior with the login user automaticallyï¼but in many casesï¼ we do not want do thisï¼and we do not want bind the zeppelin user system with kerberos auth system. I think it's make senses to add a configuration item to disable this behavior. ### Todos * [ ] - Task ### What is the Jira issue? * Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/ * Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg. [ZEPPELIN-533] [ZEPPELIN-2353] (https://issues.apache.org/jira/browse/ZEPPELIN-2353) ### How should this be tested? Outline the steps to test the PR here. when we have kerberos auth configured, and using zeppelin with a login user add configuration: "zeppelin.jdbc.auth.kerberos.proxy.enable=false" for jdbc iterpreter configuration, the jdbc iterpreter will not do the proxy behavior with the login user ### Screenshots (if appropriate) <img width="1405" alt="2017-04-04 9 12 03" src="https://cloud.githubusercontent.com/assets/869480/24658501/7739e680-197c-11e7-90ab-c1938e31efc7.png"> ### Questions: * Does the licenses files need update? * Is there breaking changes for older versions? * Does this needs documentation? Author: LeiWang <wanglei6...@163.com> Author: lei wang <lei1...@outlook.com> Closes #2222 from wary/main-master and squashes the following commits: 1f26bc3 [LeiWang] Update jdbc.md ba34a41 [LeiWang] Update JDBCInterpreter.java 444b6ab [LeiWang] Update JDBCInterpreter.java ea11ce4 [LeiWang] Update jdbc.md ee9cd18 [LeiWang] Update jdbc.md e04fb38 [LeiWang] Update jdbc.md 75e4b9f [LeiWang] Update jdbc.md b850a42 [LeiWang] Update JDBCInterpreter.java 067696a [lei wang] add configure zeppelin.jdbc.auth.kerberos.proxy for kerberos auth type to disable proxy behavior Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/5381883f Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/5381883f Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/5381883f Branch: refs/heads/master Commit: 5381883ff5dc50c9ccb3fe3593496b59853bad8f Parents: 2e6f147 Author: LeiWang <wanglei6...@163.com> Authored: Fri Apr 7 22:10:18 2017 +0800 Committer: ahyoungryu <ahyoung...@apache.org> Committed: Sat Apr 8 13:30:58 2017 +0900 ---------------------------------------------------------------------- docs/interpreter/jdbc.md | 4 ++++ jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5381883f/docs/interpreter/jdbc.md ---------------------------------------------------------------------- diff --git a/docs/interpreter/jdbc.md b/docs/interpreter/jdbc.md index 28403fc..ab31b11 100644 --- a/docs/interpreter/jdbc.md +++ b/docs/interpreter/jdbc.md @@ -165,6 +165,10 @@ There are more JDBC interpreter properties you can specify like below. <td>The path to the keytab file</td> </tr> <tr> + <td>zeppelin.jdbc.auth.kerberos.proxy.enable</td> +    <td>When auth type is Kerberos, enable/disable Kerberos proxy with the login user to get the connection. Default value is true.</td> + </tr> + <tr> <td>default.jceks.file</td> <td>jceks store path (e.g: jceks://file/tmp/zeppelin.jceks)</td> </tr> http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5381883f/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java ---------------------------------------------------------------------- diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java index 47cdfcc..5bf4063 100644 --- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java +++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java @@ -372,7 +372,8 @@ public class JDBCInterpreter extends Interpreter { switch (authType) { case KERBEROS: - if (user == null) { + if (user == null || "false".equalsIgnoreCase( + property.getProperty("zeppelin.jdbc.auth.kerberos.proxy.enable"))) { connection = getConnectionFromPool(url, user, propertyKey, properties); } else { if (url.trim().startsWith("jdbc:hive")) {