Return-Path: X-Original-To: apmail-ranger-commits-archive@www.apache.org Delivered-To: apmail-ranger-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D947117AD8 for ; Tue, 19 May 2015 07:03:17 +0000 (UTC) Received: (qmail 99323 invoked by uid 500); 19 May 2015 07:03:17 -0000 Delivered-To: apmail-ranger-commits-archive@ranger.apache.org Received: (qmail 99298 invoked by uid 500); 19 May 2015 07:03:17 -0000 Mailing-List: contact commits-help@ranger.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ranger.incubator.apache.org Delivered-To: mailing list commits@ranger.incubator.apache.org Received: (qmail 99289 invoked by uid 99); 19 May 2015 07:03:17 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2015 07:03:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4F046C20B3 for ; Tue, 19 May 2015 07:03:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 22R25L8R4laT for ; Tue, 19 May 2015 07:03:07 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id B86FC24BB6 for ; Tue, 19 May 2015 07:03:07 +0000 (UTC) Received: (qmail 98349 invoked by uid 99); 19 May 2015 07:03:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2015 07:03:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 87427DFC80; Tue, 19 May 2015 07:03:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sneethir@apache.org To: commits@ranger.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-ranger git commit: RANGER-492: Added new ldap/ad properties in windows install Date: Tue, 19 May 2015 07:03:07 +0000 (UTC) Repository: incubator-ranger Updated Branches: refs/heads/master 58b8d3693 -> d03332064 RANGER-492: Added new ldap/ad properties in windows install Signed-off-by: sneethiraj Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/d0333206 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/d0333206 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/d0333206 Branch: refs/heads/master Commit: d03332064db212dea8c54e108356432f9ce54feb Parents: 58b8d36 Author: Velmurugan Periasamy Authored: Tue May 19 01:50:49 2015 -0400 Committer: sneethiraj Committed: Tue May 19 03:02:56 2015 -0400 ---------------------------------------------------------------------- security-admin/src/bin/ranger_install.py | 74 +++++++++++++++++++- .../handler/RangerAuthenticationProvider.java | 12 ++-- 2 files changed, 78 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d0333206/security-admin/src/bin/ranger_install.py ---------------------------------------------------------------------- diff --git a/security-admin/src/bin/ranger_install.py b/security-admin/src/bin/ranger_install.py index a3c7836..346f292 100644 --- a/security-admin/src/bin/ranger_install.py +++ b/security-admin/src/bin/ranger_install.py @@ -893,11 +893,81 @@ def update_properties(): else: propertyName="ranger.jpa.jdbc.password" newPropertyValue=os.getenv("RANGER_ADMIN_DB_PASSWORD") - cObj.set('dummysection',propertyName,newPropertyValue) + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) propertyName="ranger.jpa.audit.jdbc.password" newPropertyValue=os.getenv("RANGER_AUDIT_DB_PASSWORD") - cObj.set('dummysection',propertyName,newPropertyValue) + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + if os.getenv("RANGER_AUTHENTICATION_METHOD") == "LDAP": + propertyName="ranger.authentication.method" + newPropertyValue=os.getenv("RANGER_AUTHENTICATION_METHOD") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.url" + newPropertyValue=os.getenv("RANGER_LDAP_URL") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.user.dnpattern" + newPropertyValue=os.getenv("RANGER_LDAP_USERDNPATTERN") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.group.searchbase" + newPropertyValue=os.getenv("RANGER_LDAP_GROUPSEARCHBASE") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.group.searchfilter" + newPropertyValue=os.getenv("RANGER_LDAP_GROUPSEARCHFILTER") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.group.roleattribute" + newPropertyValue=os.getenv("RANGER_LDAP_GROUPROLEATTRIBUTE") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.base.dn" + newPropertyValue=os.getenv("RANGER_LDAP_BASE_DN") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.bind.dn" + newPropertyValue=os.getenv("RANGER_LDAP_BIND_DN") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.bind.password" + newPropertyValue="_" + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.referral" + newPropertyValue=os.getenv("RANGER_LDAP_REFERRAL") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + elif os.getenv("RANGER_AUTHENTICATION_METHOD") == "ACTIVE_DIRECTORY": + propertyName="ranger.authentication.method" + newPropertyValue=os.getenv("RANGER_AUTHENTICATION_METHOD") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.ad.domain" + newPropertyValue=os.getenv("RANGER_LDAP_AD_DOMAIN") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.ad.url" + newPropertyValue=os.getenv("RANGER_LDAP_AD_URL") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.ad.base.dn" + newPropertyValue=os.getenv("RANGER_LDAP_AD_BASE_DN") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.ad.bind.dn" + newPropertyValue=os.getenv("RANGER_LDAP_AD_BIND_DN") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ldap.ad.bind.password" + newPropertyValue="_" + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) + + propertyName="ranger.ad.referral" + newPropertyValue=os.getenv("RANGER_LDAP_AD_REFERRAL") + updatePropertyToFilePy(propertyName ,newPropertyValue ,to_file_ranger) def setup_authentication(authentication_method, xmlPath): if authentication_method == "UNIX": http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d0333206/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java b/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java index 5446dc4..3275a8e 100644 --- a/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java +++ b/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java @@ -230,12 +230,12 @@ public class RangerAuthenticationProvider implements AuthenticationProvider { .authenticate(finalAuthentication); return authentication; } else { - return null; + return authentication; } } catch (Exception e) { logger.debug("LDAP Authentication Failed:", e); } - return null; + return authentication; } public Authentication getADAuthentication(Authentication authentication) { @@ -272,7 +272,7 @@ public class RangerAuthenticationProvider implements AuthenticationProvider { .authenticate(finalAuthentication); return authentication; } else { - return null; + return authentication; } }catch (Exception e) { logger.debug("AD Authentication Failed:", e); @@ -330,7 +330,7 @@ public class RangerAuthenticationProvider implements AuthenticationProvider { .authenticate(finalAuthentication); return authentication; } else { - return null; + return authentication; } } catch (Exception e) { logger.debug("Unix Authentication Failed:", e); @@ -402,7 +402,7 @@ public class RangerAuthenticationProvider implements AuthenticationProvider { authentication = ldapAuthenticationProvider.authenticate(finalAuthentication); return authentication; } else { - return null; + return authentication; } } catch (Exception e) { logger.debug("AD Authentication Failed:", e); @@ -463,7 +463,7 @@ public class RangerAuthenticationProvider implements AuthenticationProvider { authentication = ldapAuthenticationProvider.authenticate(finalAuthentication); return authentication; } else { - return null; + return authentication; } } catch (Exception e) { logger.debug("LDAP Authentication Failed:", e);