[parancoe] 2 new revisions pushed by enricogi...@gmail.com on 2012-09-19 01:00 GMT

4 views
Skip to first unread message

para...@googlecode.com

unread,
Sep 18, 2012, 9:01:03 PM9/18/12
to parancoe...@googlegroups.com
2 new revisions:

Revision: 14bd8f9359c3
Branch: default
Author: enricogiurin <enrico...@gmail.com>
Date: Tue Sep 18 17:54:51 2012
Log: issue 14
http://code.google.com/p/parancoe/source/detail?r=14bd8f9359c3

Revision: e054cf5762f5
Branch: default
Author: enricogiurin <enrico...@gmail.com>
Date: Tue Sep 18 17:59:31 2012
Log: issue 14
http://code.google.com/p/parancoe/source/detail?r=e054cf5762f5

==============================================================================
Revision: 14bd8f9359c3
Branch: default
Author: enricogiurin <enrico...@gmail.com>
Date: Tue Sep 18 17:54:51 2012
Log: issue 14
http://code.google.com/p/parancoe/source/detail?r=14bd8f9359c3

Modified:

/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/MessageDigestPasswordEncoderUtility.java

=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/MessageDigestPasswordEncoderUtility.java
Wed May 2 06:50:54 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/MessageDigestPasswordEncoderUtility.java
Tue Sep 18 17:54:51 2012
@@ -38,7 +38,7 @@
import
org.springframework.security.authentication.encoding.MessageDigestPasswordEncoder;

/**
- * Convenient method to encrypt password based on {@link
Md5PasswordEncoder}
+ * Provide a method to encrypt password based on {@link
MessageDigestPasswordEncoder} and salt.
* @author enrico
*
*/

==============================================================================
Revision: e054cf5762f5
Branch: default
Author: enricogiurin <enrico...@gmail.com>
Date: Tue Sep 18 17:59:31 2012
Log: issue 14
http://code.google.com/p/parancoe/source/detail?r=e054cf5762f5

Deleted:

/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/ParancoeSecurityContextHolderStrategy.java

/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/SecureInterceptor.java

=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/ParancoeSecurityContextHolderStrategy.java
Thu Apr 26 07:55:31 2012
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Plugin Spring Security Evolution.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.parancoe.plugins.securityevolution;
-
-import org.apache.log4j.Logger;
-import org.springframework.security.core.context.SecurityContext;
-import
org.springframework.security.core.context.SecurityContextHolderStrategy;
-import org.springframework.security.core.context.SecurityContextImpl;
-
-/**
- * A Parancoe <code>ThreadLocal</code>-based implementation of {@link
- * org.springframework.security.context.SecurityContextHolderStrategy}.
- * This class is similar to ThreadLocalSecurityContextHolderStrategy but
- * the body of the method clearContext() is empty. *
- * @author Enrico Giurin
- *
- * @see ThreadLocal
- * @see
org.springframework.security.context.HttpSessionContextIntegrationFilter
- */
-public class ParancoeSecurityContextHolderStrategy implements
- SecurityContextHolderStrategy {
-
- private static Logger logger = Logger.getLogger(
- ParancoeSecurityContextHolderStrategy.class);
- private static ThreadLocal contextHolder = new ThreadLocal();
-
- @Override
- public void clearContext() {
- logger.debug("This method has void implementation!");
- }
-
- @Override
- public SecurityContext getContext() {
- if (contextHolder.get() == null) {
- contextHolder.set(createEmptyContext());
- }
-
- return (SecurityContext) contextHolder.get();
- }
-
- @Override
- public void setContext(SecurityContext context) {
- contextHolder.set(context);
- }
-
- @Override
- public SecurityContext createEmptyContext() {
- return new SecurityContextImpl();
- }
-}
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/SecureInterceptor.java
Tue May 29 21:24:49 2012
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Plugin Spring Security Evolution.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.parancoe.plugins.securityevolution;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.MDC;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * Interceptor for secure features based on springsecurity framework.
- * @author Enrico Giurin
- *
- */
-public class SecureInterceptor extends HandlerInterceptorAdapter {
-
- public static final String USERNAME_LOG4J_MDC_KEY = "psec_username";
-
- private static final Logger logger =
- Logger.getLogger(SecureInterceptor.class);
-
- /**
- * Costructor. In the costructor strategy of SecurityContextHolder
- * has set.
- *
- */
- public SecureInterceptor() {
- logger.info("SecureInterceptor set up");
- }
-
- /**
- * Delegates request to filter chain.
- */
-
- @Override
- public boolean preHandle(HttpServletRequest req, HttpServletResponse
res,
- Object handler) throws Exception {
- populateLog4JMDC();
-
- return true;
- }
-
- @Override
- public void afterCompletion(HttpServletRequest req,
- HttpServletResponse res, Object handler, Exception e) throws
- Exception {
- cleanLog4JMDC();
- }
-
- /**
- * Put in the Log4J Mapped Diagnostic Context (MDC) the infos on the
logged user.
- * So these infos can be showed in the log, using the %X{key} format
sequence in the log layout.
- */
- private void populateLog4JMDC() {
- String username = "unknown";
- Authentication authentication =
- SecurityContextHolder.getContext().getAuthentication();
- if (authentication != null && authentication.isAuthenticated()) {
- username = authentication.getName();
- }
- MDC.put(USERNAME_LOG4J_MDC_KEY, username);
- }
-
- /**
- * Remove from the Log4J Mapped Diagnostic Context (MDC) the infos on
the logged user.
- */
- private void cleanLog4JMDC() {
- MDC.remove(USERNAME_LOG4J_MDC_KEY);
- }
-
-
-}//end of class
-
Reply all
Reply to author
Forward
0 new messages