shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdem...@apache.org
Subject [1/2] shiro git commit: SHIRO-611: Use DefaultWebSessionStorageEvaluator in Spring web module
Date Tue, 31 Jan 2017 01:43:54 GMT
Repository: shiro
Updated Branches:
  refs/heads/master eb7f6f569 -> ea7eb0029


SHIRO-611: Use DefaultWebSessionStorageEvaluator in Spring web module


Project: http://git-wip-us.apache.org/repos/asf/shiro/repo
Commit: http://git-wip-us.apache.org/repos/asf/shiro/commit/3436fe6d
Tree: http://git-wip-us.apache.org/repos/asf/shiro/tree/3436fe6d
Diff: http://git-wip-us.apache.org/repos/asf/shiro/diff/3436fe6d

Branch: refs/heads/master
Commit: 3436fe6da08ec255006c55da673d4983acfc1d6f
Parents: eb7f6f5
Author: Brian Demers <bdemers@apache.org>
Authored: Mon Jan 30 20:19:04 2017 -0500
Committer: Brian Demers <bdemers@apache.org>
Committed: Mon Jan 30 20:19:04 2017 -0500

----------------------------------------------------------------------
 .../spring/web/config/AbstractShiroWebConfiguration.java      | 7 +++++++
 .../shiro/spring/web/config/ShiroWebConfigurationTest.groovy  | 7 +++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/3436fe6d/support/spring/src/main/java/org/apache/shiro/spring/web/config/AbstractShiroWebConfiguration.java
----------------------------------------------------------------------
diff --git a/support/spring/src/main/java/org/apache/shiro/spring/web/config/AbstractShiroWebConfiguration.java
b/support/spring/src/main/java/org/apache/shiro/spring/web/config/AbstractShiroWebConfiguration.java
index 5762612..6229283 100644
--- a/support/spring/src/main/java/org/apache/shiro/spring/web/config/AbstractShiroWebConfiguration.java
+++ b/support/spring/src/main/java/org/apache/shiro/spring/web/config/AbstractShiroWebConfiguration.java
@@ -19,12 +19,14 @@
 package org.apache.shiro.spring.web.config;
 
 import org.apache.shiro.mgt.RememberMeManager;
+import org.apache.shiro.mgt.SessionStorageEvaluator;
 import org.apache.shiro.mgt.SessionsSecurityManager;
 import org.apache.shiro.mgt.SubjectFactory;
 import org.apache.shiro.session.mgt.SessionManager;
 import org.apache.shiro.spring.config.AbstractShiroConfiguration;
 import org.apache.shiro.web.mgt.CookieRememberMeManager;
 import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
+import org.apache.shiro.web.mgt.DefaultWebSessionStorageEvaluator;
 import org.apache.shiro.web.mgt.DefaultWebSubjectFactory;
 import org.apache.shiro.web.servlet.Cookie;
 import org.apache.shiro.web.servlet.SimpleCookie;
@@ -144,6 +146,11 @@ public class AbstractShiroWebConfiguration extends AbstractShiroConfiguration
{
         return new DefaultWebSubjectFactory();
     }
 
+    @Override
+    protected SessionStorageEvaluator sessionStorageEvaluator() {
+        return new DefaultWebSessionStorageEvaluator();
+    }
+
     protected SessionsSecurityManager createSecurityManager() {
 
         DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();

http://git-wip-us.apache.org/repos/asf/shiro/blob/3436fe6d/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
----------------------------------------------------------------------
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
index 6031deb..584a837 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
@@ -21,6 +21,7 @@ package org.apache.shiro.spring.web.config
 import org.apache.shiro.event.EventBus
 import org.apache.shiro.event.support.DefaultEventBus
 import org.apache.shiro.mgt.SecurityManager
+import org.apache.shiro.mgt.SessionStorageEvaluator
 import org.apache.shiro.realm.text.TextConfigurationRealm
 import org.apache.shiro.spring.config.EventBusTestConfiguration
 import org.apache.shiro.spring.config.RealmTestConfiguration
@@ -28,6 +29,7 @@ import org.apache.shiro.spring.config.ShiroAnnotationProcessorConfiguration
 import org.apache.shiro.spring.config.ShiroBeanConfiguration
 import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor
 import org.apache.shiro.web.mgt.CookieRememberMeManager
+import org.apache.shiro.web.mgt.DefaultWebSessionStorageEvaluator
 import org.apache.shiro.web.mgt.WebSecurityManager
 import org.apache.shiro.web.servlet.Cookie
 
@@ -63,11 +65,16 @@ public class ShiroWebConfigurationTest {
     @Qualifier("sessionCookieTemplate")
     private Cookie sessionCookieTemplate;
 
+    @Autowired
+    private SessionStorageEvaluator sessionStorageEvaluator;
+
     @Test
     public void testMinimalConfiguration() {
 
         // first do a quick check of the injected objects
         assertNotNull securityManager
+        assertNotNull sessionStorageEvaluator
+        assertThat sessionStorageEvaluator, instanceOf(DefaultWebSessionStorageEvaluator)
         assertThat securityManager, instanceOf(WebSecurityManager)
         assertThat securityManager.realms, allOf(hasSize(1), hasItem(instanceOf(TextConfigurationRealm)))
         assertNull securityManager.cacheManager


Mime
View raw message