You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2019/11/01 02:24:32 UTC

[zeppelin] branch master updated: [ZEPPELIN-4341] update getRoles to handle any upstream exception

This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 79197d9  [ZEPPELIN-4341] update getRoles to handle any upstream exception
79197d9 is described below

commit 79197d93a471ece87181449ea40c14f250ccd441
Author: Tony Primerano <pr...@tonycode.com>
AuthorDate: Tue Oct 8 15:29:17 2019 -0400

    [ZEPPELIN-4341] update getRoles to handle any upstream exception
    
    See https://github.com/apache/zeppelin/pull/3466 for reasons.   3466 was for 0.8 and this PR is for master.   Only once file needed to be changed.   I wasn't sure how to do a pull request with different files to different branches so I hope I am doing this correctly.
    
    What is this PR for?
    Allow getting of roles to work when more than 1 realm.
    
    What type of PR is it?
    Bug Fix
    
    What is the Jira issue?
    https://issues.apache.org/jira/browse/ZEPPELIN-4341
    
    Author: Tony Primerano <pr...@tonycode.com>
    
    Closes #3476 from primerano/ZEPPELIN-4341b and squashes the following commits:
    
    a22fbf186 [Tony Primerano] [ZEPPELIN-4341] swap printStackTrace for log.warn
    d15196cfe [Tony Primerano] [ZEPPELIN-4341] update getRoles to handle any upstream exception
---
 .../src/main/java/org/apache/zeppelin/realm/LdapRealm.java            | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
index 562ed96..5a1b357 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
@@ -321,8 +321,8 @@ public class LdapRealm extends JndiLdapRealm {
       systemLdapCtx = ldapContextFactory.getSystemLdapContext();
       return rolesFor(principals, username, systemLdapCtx,
         ldapContextFactory, SecurityUtils.getSubject().getSession());
-    } catch (AuthenticationException ae) {
-      ae.printStackTrace();
+    } catch (Throwable t) {
+      log.warn("Failed to get roles in current context for " + username, t);
       return Collections.emptySet();
     } finally {
       LdapUtils.closeContext(systemLdapCtx);