ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsom...@apache.org
Subject ranger git commit: RANGER-2018: Upgrade to Spring 4
Date Thu, 22 Mar 2018 09:53:35 GMT
Repository: ranger
Updated Branches:
  refs/heads/master 4970af966 -> 97b927f93


RANGER-2018: Upgrade to Spring 4

Signed-off-by: Zsombor Gegesy <zsombor@apache.org>


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

Branch: refs/heads/master
Commit: 97b927f9371a0eaa1beb21f252c52904798c6f80
Parents: 4970af9
Author: pradeep <pradeep@apache.org>
Authored: Tue Mar 20 12:44:04 2018 +0530
Committer: Zsombor Gegesy <zsombor@apache.org>
Committed: Thu Mar 22 10:53:22 2018 +0100

----------------------------------------------------------------------
 pom.xml                                         |  6 ++---
 .../RangerAuthenticationEntryPoint.java         |  6 ++---
 .../security/web/filter/MyRememberMeFilter.java |  6 +++++
 .../conf.dist/security-applicationContext.xml   | 27 ++++++++++----------
 .../main/webapp/META-INF/applicationContext.xml | 12 ++++-----
 .../META-INF/asynctask-applicationContext.xml   | 12 ++++-----
 .../META-INF/scheduler-applicationContext.xml   | 12 ++++-----
 .../src/main/webapp/scripts/mgrs/SessionMgr.js  |  4 +--
 .../main/webapp/scripts/prelogin/XAPrelogin.js  |  6 ++---
 .../webapp/scripts/views/common/ProfileBar.js   |  2 +-
 .../PasswordComparisonAuthenticator.java        |  3 +--
 11 files changed, 50 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3f8f2b1..0f3ddfc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,9 +207,9 @@
         <slf4j-api.version>1.7.5</slf4j-api.version>
         <solr.version>5.5.4</solr.version>
         <spring-ldap-core.version>2.3.2.RELEASE</spring-ldap-core.version>
-        <springframework.security.version>3.2.10.RELEASE</springframework.security.version>
-        <springframework.test.version>3.2.10.RELEASE</springframework.test.version>
-        <springframework.version>3.2.10.RELEASE</springframework.version>
+        <springframework.security.version>4.2.4.RELEASE</springframework.security.version>
+        <springframework.test.version>4.3.14.RELEASE</springframework.test.version>
+        <springframework.version>4.3.14.RELEASE</springframework.version>
         <sqoop.version>1.99.7</sqoop.version>
         <storm.version>1.2.0</storm.version>
         <sun-jersey-bundle.version>1.19</sun-jersey-bundle.version>

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
index d9c2bcf..de3891e 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
@@ -60,8 +60,8 @@ public class RangerAuthenticationEntryPoint extends
 	@Autowired
 	SessionMgr sessionMgr;
 
-	public RangerAuthenticationEntryPoint() {
-		super();
+	public RangerAuthenticationEntryPoint(String loginFormUrl) {
+		super(loginFormUrl);
 		if (logger.isDebugEnabled()) {
 			logger.debug("AjaxAwareAuthenticationEntryPoint(): constructor");
 		}
@@ -138,4 +138,4 @@ public class RangerAuthenticationEntryPoint extends
 		}
 	}
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/java/org/apache/ranger/security/web/filter/MyRememberMeFilter.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/filter/MyRememberMeFilter.java
b/security-admin/src/main/java/org/apache/ranger/security/web/filter/MyRememberMeFilter.java
index 370df70..1cc012d 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/filter/MyRememberMeFilter.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/filter/MyRememberMeFilter.java
@@ -32,8 +32,10 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
+import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.RememberMeServices;
 import org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter;
 
 /**
@@ -43,6 +45,10 @@ import org.springframework.security.web.authentication.rememberme.RememberMeAuth
 @SuppressWarnings("deprecation")
 public class MyRememberMeFilter extends RememberMeAuthenticationFilter {
 
+    public MyRememberMeFilter(AuthenticationManager authenticationManager, RememberMeServices
rememberMeServices) {
+		super(authenticationManager, rememberMeServices);
+	}
+
     private static final Logger logger = Logger.getLogger(MyRememberMeFilter.class);
 
     /*

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/resources/conf.dist/security-applicationContext.xml
----------------------------------------------------------------------
diff --git a/security-admin/src/main/resources/conf.dist/security-applicationContext.xml b/security-admin/src/main/resources/conf.dist/security-applicationContext.xml
index 0dda56b..c008a12 100644
--- a/security-admin/src/main/resources/conf.dist/security-applicationContext.xml
+++ b/security-admin/src/main/resources/conf.dist/security-applicationContext.xml
@@ -22,13 +22,13 @@ xmlns:security="http://www.springframework.org/schema/security"
 xmlns:util="http://www.springframework.org/schema/util"
 xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
 http://www.springframework.org/schema/security
-http://www.springframework.org/schema/security/spring-security-3.2.xsd
+http://www.springframework.org/schema/security/spring-security-4.2.xsd
 http://www.springframework.org/schema/util
-http://www.springframework.org/schema/util/spring-util-3.2.xsd
+http://www.springframework.org/schema/util/spring-util-4.3.xsd
 http://www.springframework.org/schema/security/oauth2
-http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd">
+http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd">
 
 	<security:http pattern="/login.jsp" security="none" />
 	<security:http pattern="/styles/**" security="none" />
@@ -46,6 +46,7 @@ http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd">
 	<security:http pattern="/service/tags/download/*" security="none"/>
 
 	<security:http disable-url-rewriting="true" use-expressions="true" create-session="always"
entry-point-ref="authenticationProcessingFilterEntryPoint">
+		<csrf disabled="true"/>
 		<security:session-management session-fixation-protection="newSession" />
 		<intercept-url pattern="/**" access="isAuthenticated()"/>       
 		<custom-filter ref="ssoAuthenticationFilter" after="BASIC_AUTH_FILTER" /> 
@@ -55,18 +56,17 @@ http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd">
 		<security:custom-filter position="LAST" ref="userContextFormationFilter"/>
 
 		<security:access-denied-handler error-page="/public/failedLogin.jsp?access_denied=1"/>
-		<security:logout delete-cookies="RANGERADMINSESSIONID,xa_rmc" logout-url="/logout.html"
success-handler-ref="customLogoutSuccessHandler" />
+		<security:logout delete-cookies="RANGERADMINSESSIONID,xa_rmc" logout-url="/logout" success-handler-ref="customLogoutSuccessHandler"
/>
 		<http-basic entry-point-ref="authenticationProcessingFilterEntryPoint"/>
 	</security:http>
 
 	<beans:bean id="customAccessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
-		<beans:property name="allowIfAllAbstainDecisions" value="false"/>
-		<beans:property name="decisionVoters">
-			<beans:list>
-				<beans:bean class="org.springframework.security.access.vote.RoleVoter"/>
-				<beans:bean class="org.springframework.security.access.vote.AuthenticatedVoter"/>
-			</beans:list>
-		</beans:property>
+		<beans:constructor-arg>
+            <beans:list>
+                <beans:bean class="org.springframework.security.access.vote.AuthenticatedVoter"
/>
+                <beans:bean class="org.springframework.security.access.vote.RoleVoter"
/>
+            </beans:list>
+        </beans:constructor-arg>
 	</beans:bean>
 
 	<beans:bean id="customUsernamePasswordAuthenticationFilter" class="org.apache.ranger.security.web.filter.RangerUsernamePasswordAuthenticationFilter">
@@ -76,8 +76,7 @@ http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd">
 	</beans:bean>
 
 	<beans:bean id="authenticationProcessingFilterEntryPoint" class="org.apache.ranger.security.web.authentication.RangerAuthenticationEntryPoint">
-		<beans:property name="loginFormUrl" value="/login.jsp"/>
-		<beans:property name="forceHttps" value="false"/>
+		<beans:constructor-arg value="/login.jsp"/>
 	</beans:bean>
 
 	<beans:bean id="ajaxAuthSuccessHandler" class="org.apache.ranger.security.web.authentication.RangerAuthSuccessHandler">

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/webapp/META-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/META-INF/applicationContext.xml b/security-admin/src/main/webapp/META-INF/applicationContext.xml
index de1dc67..bbfc5f8 100644
--- a/security-admin/src/main/webapp/META-INF/applicationContext.xml
+++ b/security-admin/src/main/webapp/META-INF/applicationContext.xml
@@ -21,17 +21,17 @@ xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.sp
 xmlns:task="http://www.springframework.org/schema/task" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:util="http://www.springframework.org/schema/util"
 xsi:schemaLocation="http://www.springframework.org/schema/aop
-http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
+http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
 http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
 http://www.springframework.org/schema/context
-http://www.springframework.org/schema/context/spring-context-3.2.xsd
+http://www.springframework.org/schema/context/spring-context-4.3.xsd
 http://www.springframework.org/schema/jee
-http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
+http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
 http://www.springframework.org/schema/tx
-http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
+http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
 http://www.springframework.org/schema/task
-http://www.springframework.org/schema/task/spring-task-3.2.xsd
+http://www.springframework.org/schema/task/spring-task-4.3.xsd
 http://www.springframework.org/schema/util
 http://www.springframework.org/schema/util/spring-util.xsd">
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/webapp/META-INF/asynctask-applicationContext.xml
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/META-INF/asynctask-applicationContext.xml b/security-admin/src/main/webapp/META-INF/asynctask-applicationContext.xml
index 10f1a84..f679f25 100644
--- a/security-admin/src/main/webapp/META-INF/asynctask-applicationContext.xml
+++ b/security-admin/src/main/webapp/META-INF/asynctask-applicationContext.xml
@@ -21,17 +21,17 @@ xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.sp
 xmlns:task="http://www.springframework.org/schema/task"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
 xsi:schemaLocation="http://www.springframework.org/schema/aop
-http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
+http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
 http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
 http://www.springframework.org/schema/context
-http://www.springframework.org/schema/context/spring-context-3.2.xsd
+http://www.springframework.org/schema/context/spring-context-4.3.xsd
 http://www.springframework.org/schema/jee
-http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
+http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
 http://www.springframework.org/schema/tx
-http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
+http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
 http://www.springframework.org/schema/task
-http://www.springframework.org/schema/task/spring-task-3.2.xsd
+http://www.springframework.org/schema/task/spring-task-4.3.xsd
 http://www.springframework.org/schema/util
 http://www.springframework.org/schema/util/spring-util.xsd">
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/webapp/META-INF/scheduler-applicationContext.xml
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/META-INF/scheduler-applicationContext.xml b/security-admin/src/main/webapp/META-INF/scheduler-applicationContext.xml
index a9fb632..ab75166 100644
--- a/security-admin/src/main/webapp/META-INF/scheduler-applicationContext.xml
+++ b/security-admin/src/main/webapp/META-INF/scheduler-applicationContext.xml
@@ -21,17 +21,17 @@ xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.sp
 xmlns:task="http://www.springframework.org/schema/task"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
 xsi:schemaLocation="http://www.springframework.org/schema/aop
-http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
+http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
 http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
 http://www.springframework.org/schema/context
-http://www.springframework.org/schema/context/spring-context-3.2.xsd
+http://www.springframework.org/schema/context/spring-context-4.3.xsd
 http://www.springframework.org/schema/jee
-http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
+http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
 http://www.springframework.org/schema/tx
-http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
+http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
 http://www.springframework.org/schema/task
-http://www.springframework.org/schema/task/spring-task-3.2.xsd
+http://www.springframework.org/schema/task/spring-task-4.3.xsd
 http://www.springframework.org/schema/util
 http://www.springframework.org/schema/util/spring-util.xsd">
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js b/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
index 529a589..35b48cb 100644
--- a/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
+++ b/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
@@ -114,11 +114,11 @@ define(function(require){
 		MSCacheMgr.resetAll();
 		if (reDirectUser) {
 			// This will ask the browser to redirect
-			window.location.replace("logout.html");
+			window.location.replace("logout");
 		} else {
 			// We will do an implicit logout
 			$.ajax({
-				url : 'logout.html',
+				url : 'logout',
 				type : 'GET',
 				async : false
 			});

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/webapp/scripts/prelogin/XAPrelogin.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/prelogin/XAPrelogin.js b/security-admin/src/main/webapp/scripts/prelogin/XAPrelogin.js
index eb65283..c8b0c49 100644
--- a/security-admin/src/main/webapp/scripts/prelogin/XAPrelogin.js
+++ b/security-admin/src/main/webapp/scripts/prelogin/XAPrelogin.js
@@ -64,12 +64,12 @@ function doLogin() {
 			baseUrl = '/';
 		}
 	}
-	var url = baseUrl + 'j_spring_security_check';
+	var url = baseUrl + 'login';
 
 	$.ajax({
 		data : {
-			j_username : $('#username').val(),
-			j_password : $('#password').val()
+			username : $('#username').val(),
+			password : $('#password').val()
 		},
 		url : url,
 		type : 'POST',

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js b/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
index c6301c3..4a8aed5 100644
--- a/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
+++ b/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
@@ -53,7 +53,7 @@ define(function(require){
 			return events;
 		},
 		onLogout : function(checksso){
-			var url = 'security-admin-web/logout.html',
+			var url = 'logout',
 			that = this;
 			$.ajax({
 				url : url,

http://git-wip-us.apache.org/repos/asf/ranger/blob/97b927f9/security-admin/src/test/java/org/apache/ranger/service/PasswordComparisonAuthenticator.java
----------------------------------------------------------------------
diff --git a/security-admin/src/test/java/org/apache/ranger/service/PasswordComparisonAuthenticator.java
b/security-admin/src/test/java/org/apache/ranger/service/PasswordComparisonAuthenticator.java
index 3dc6413..a5db7a9 100644
--- a/security-admin/src/test/java/org/apache/ranger/service/PasswordComparisonAuthenticator.java
+++ b/security-admin/src/test/java/org/apache/ranger/service/PasswordComparisonAuthenticator.java
@@ -100,8 +100,7 @@ public final class PasswordComparisonAuthenticator extends
 		}
 
 		if (user == null) {
-			throw new UsernameNotFoundException("User not found: " + username,
-					username);
+			throw new UsernameNotFoundException("User not found: " + username);
 		}
 
 		if (logger.isDebugEnabled()) {


Mime
View raw message