You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by bd...@apache.org on 2016/06/29 22:06:10 UTC

[1/6] shiro git commit: Fix the calculation for the hash iterations

Repository: shiro
Updated Branches:
  refs/heads/1.3.x cfc9b57f1 -> ca29664d8


Fix the calculation for the hash iterations

We really need to subtract 1 here, not DEFAULT_ITERATIONS (which could
change, breaking the calculation then)

Fixes #14, SHIRO-568


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

Branch: refs/heads/1.3.x
Commit: ca29664d8e4552a70a06bd958062d589b5468450
Parents: dff6cc6
Author: Andreas Kohn <an...@gmail.com>
Authored: Thu Apr 21 10:26:44 2016 +0200
Committer: Brian Demers <bd...@stormpath.com>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/ca29664d/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java b/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
index 7ee3c40..b3c8a33 100644
--- a/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
+++ b/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
@@ -346,7 +346,7 @@ public class SimpleHash extends AbstractHash {
             digest.update(salt);
         }
         byte[] hashed = digest.digest(bytes);
-        int iterations = hashIterations - DEFAULT_ITERATIONS; //already hashed once above
+        int iterations = hashIterations - 1; //already hashed once above
         //iterate remaining number:
         for (int i = 0; i < iterations; i++) {
             digest.reset();


[3/6] shiro git commit: Updated versions for 1.3.x

Posted by bd...@apache.org.
Updated versions for 1.3.x


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

Branch: refs/heads/1.3.x
Commit: cb0c225a53f75badb70d58dff13589cd29baebe0
Parents: cfc9b57
Author: Brian Demers <bd...@stormpath.com>
Authored: Wed Jun 29 14:57:00 2016 -0700
Committer: Brian Demers <bd...@stormpath.com>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 all/pom.xml                      | 2 +-
 core/pom.xml                     | 2 +-
 pom.xml                          | 2 +-
 samples/aspectj/pom.xml          | 2 +-
 samples/pom.xml                  | 2 +-
 samples/quickstart/pom.xml       | 2 +-
 samples/spring-client/pom.xml    | 2 +-
 samples/spring-hibernate/pom.xml | 2 +-
 samples/spring/pom.xml           | 2 +-
 samples/web/pom.xml              | 2 +-
 support/aspectj/pom.xml          | 2 +-
 support/cas/pom.xml              | 2 +-
 support/ehcache/pom.xml          | 2 +-
 support/features/pom.xml         | 2 +-
 support/guice/pom.xml            | 2 +-
 support/pom.xml                  | 2 +-
 support/quartz/pom.xml           | 2 +-
 support/spring/pom.xml           | 2 +-
 tools/hasher/pom.xml             | 2 +-
 tools/pom.xml                    | 2 +-
 web/pom.xml                      | 2 +-
 21 files changed, 21 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/all/pom.xml
----------------------------------------------------------------------
diff --git a/all/pom.xml b/all/pom.xml
index 0bfb5f4..182f017 100644
--- a/all/pom.xml
+++ b/all/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 3739716..72d59c4 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1929dfe..a9bcfc1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
     <groupId>org.apache.shiro</groupId>
     <artifactId>shiro-root</artifactId>
     <packaging>pom</packaging>
-    <version>1.2.7-SNAPSHOT</version>
+    <version>1.3.0-SNAPSHOT</version>
 
     <name>Apache Shiro</name>
     <url>http://shiro.apache.org/</url>

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/aspectj/pom.xml
----------------------------------------------------------------------
diff --git a/samples/aspectj/pom.xml b/samples/aspectj/pom.xml
index 3a73bcb..60fb772 100644
--- a/samples/aspectj/pom.xml
+++ b/samples/aspectj/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
 		<groupId>org.apache.shiro.samples</groupId>
 		<artifactId>shiro-samples</artifactId>
-		<version>1.2.7-SNAPSHOT</version>
+		<version>1.3.0-SNAPSHOT</version>
 	        <relativePath>../pom.xml</relativePath> 
         </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/pom.xml
----------------------------------------------------------------------
diff --git a/samples/pom.xml b/samples/pom.xml
index 0a458fa..ae8e708 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/quickstart/pom.xml
----------------------------------------------------------------------
diff --git a/samples/quickstart/pom.xml b/samples/quickstart/pom.xml
index bef9634..4219ca8 100644
--- a/samples/quickstart/pom.xml
+++ b/samples/quickstart/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.shiro.samples</groupId>
         <artifactId>shiro-samples</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/spring-client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/spring-client/pom.xml b/samples/spring-client/pom.xml
index d09d85b..71766b3 100644
--- a/samples/spring-client/pom.xml
+++ b/samples/spring-client/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.shiro.samples</groupId>
         <artifactId>shiro-samples</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/spring-hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/samples/spring-hibernate/pom.xml b/samples/spring-hibernate/pom.xml
index d248436..7e630c9 100644
--- a/samples/spring-hibernate/pom.xml
+++ b/samples/spring-hibernate/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.shiro.samples</groupId>
         <artifactId>shiro-samples</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/spring/pom.xml
----------------------------------------------------------------------
diff --git a/samples/spring/pom.xml b/samples/spring/pom.xml
index 42fb2ad..36937a5 100644
--- a/samples/spring/pom.xml
+++ b/samples/spring/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.shiro.samples</groupId>
         <artifactId>shiro-samples</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/samples/web/pom.xml
----------------------------------------------------------------------
diff --git a/samples/web/pom.xml b/samples/web/pom.xml
index f4373f7..cb1efbf 100644
--- a/samples/web/pom.xml
+++ b/samples/web/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.shiro.samples</groupId>
         <artifactId>shiro-samples</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/aspectj/pom.xml
----------------------------------------------------------------------
diff --git a/support/aspectj/pom.xml b/support/aspectj/pom.xml
index dba8cd0..c021f90 100644
--- a/support/aspectj/pom.xml
+++ b/support/aspectj/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/cas/pom.xml
----------------------------------------------------------------------
diff --git a/support/cas/pom.xml b/support/cas/pom.xml
index 44d15d7..e9ee07d 100644
--- a/support/cas/pom.xml
+++ b/support/cas/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/ehcache/pom.xml
----------------------------------------------------------------------
diff --git a/support/ehcache/pom.xml b/support/ehcache/pom.xml
index f9ae3db..02004d5 100644
--- a/support/ehcache/pom.xml
+++ b/support/ehcache/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/features/pom.xml
----------------------------------------------------------------------
diff --git a/support/features/pom.xml b/support/features/pom.xml
index b531670..f0a4379 100644
--- a/support/features/pom.xml
+++ b/support/features/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/guice/pom.xml
----------------------------------------------------------------------
diff --git a/support/guice/pom.xml b/support/guice/pom.xml
index 12e02ce..cecf88b 100644
--- a/support/guice/pom.xml
+++ b/support/guice/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/pom.xml
----------------------------------------------------------------------
diff --git a/support/pom.xml b/support/pom.xml
index fdbdff6..7fbd4c8 100644
--- a/support/pom.xml
+++ b/support/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/quartz/pom.xml
----------------------------------------------------------------------
diff --git a/support/quartz/pom.xml b/support/quartz/pom.xml
index 362c8b3..35d9f8e 100644
--- a/support/quartz/pom.xml
+++ b/support/quartz/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/support/spring/pom.xml
----------------------------------------------------------------------
diff --git a/support/spring/pom.xml b/support/spring/pom.xml
index b83e122..2e91478 100644
--- a/support/spring/pom.xml
+++ b/support/spring/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/tools/hasher/pom.xml
----------------------------------------------------------------------
diff --git a/tools/hasher/pom.xml b/tools/hasher/pom.xml
index caeb1c0..6434418 100644
--- a/tools/hasher/pom.xml
+++ b/tools/hasher/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro.tools</groupId>
         <artifactId>shiro-tools</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/tools/pom.xml
----------------------------------------------------------------------
diff --git a/tools/pom.xml b/tools/pom.xml
index c18b7eb..908ce2a 100644
--- a/tools/pom.xml
+++ b/tools/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/cb0c225a/web/pom.xml
----------------------------------------------------------------------
diff --git a/web/pom.xml b/web/pom.xml
index 206d526..b2b8622 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-root</artifactId>
-        <version>1.2.7-SNAPSHOT</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 


[4/6] shiro git commit: SHIRO-566 Use Collections wrappers to save memory and cpu.

Posted by bd...@apache.org.
SHIRO-566 Use Collections wrappers to save memory and cpu.

Fixes #19
cherry-picked from: 109e6248353c3c9b8792233d2d824ff97de5b8fb


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

Branch: refs/heads/1.3.x
Commit: fd161e0be34246e20b423a67803da5c94a372030
Parents: cb0c225
Author: Andreas Kohn <an...@gmail.com>
Authored: Tue Jun 28 18:47:18 2016 +0200
Committer: Brian Demers <bd...@stormpath.com>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/shiro/util/CollectionUtils.java    | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/fd161e0b/core/src/main/java/org/apache/shiro/util/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/shiro/util/CollectionUtils.java b/core/src/main/java/org/apache/shiro/util/CollectionUtils.java
index 0956efa..af33121 100644
--- a/core/src/main/java/org/apache/shiro/util/CollectionUtils.java
+++ b/core/src/main/java/org/apache/shiro/util/CollectionUtils.java
@@ -35,6 +35,11 @@ public class CollectionUtils {
         if (elements == null || elements.length == 0) {
             return Collections.emptySet();
         }
+
+        if (elements.length == 1) {
+            return Collections.singleton(elements[0]);
+        }
+
         LinkedHashSet<E> set = new LinkedHashSet<E>(elements.length * 4 / 3 + 1);
         Collections.addAll(set, elements);
         return set;
@@ -106,11 +111,9 @@ public class CollectionUtils {
         if (elements == null || elements.length == 0) {
             return Collections.emptyList();
         }
-        // Avoid integer overflow when a large array is passed in
-        int capacity = computeListCapacity(elements.length);
-        ArrayList<E> list = new ArrayList<E>(capacity);
-        Collections.addAll(list, elements);
-        return list;
+
+        // Integer overflow does not occur when a large array is passed in because the list array already exists
+        return Arrays.asList(elements);
     }
 
     /*public static <E> Deque<E> asDeque(E... elements) {


[6/6] shiro git commit: SHIRO-564 lower-case wildcard string before building subparts so that the subparts list is not created twice for case-insensitive strings.

Posted by bd...@apache.org.
SHIRO-564 lower-case wildcard string before building subparts so that the subparts list is not created twice for case-insensitive strings.

Fixes #18


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

Branch: refs/heads/1.3.x
Commit: 6809366c83869d493e4109d822d0aa44a03d303b
Parents: fd161e0
Author: Matt Bishop <ma...@elasticpath.com>
Authored: Sun May 29 12:12:31 2016 -0700
Committer: Brian Demers <bd...@stormpath.com>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 .../shiro/authz/permission/WildcardPermission.java  | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/6809366c/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java b/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
index cb9d14e..54032a3 100644
--- a/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
+++ b/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
@@ -154,14 +154,16 @@ public class WildcardPermission implements Permission, Serializable {
             throw new IllegalArgumentException("Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.");
         }
 
+        if (!caseSensitive) {
+            wildcardString = wildcardString.toLowerCase();
+        }
+
         List<String> parts = CollectionUtils.asList(wildcardString.split(PART_DIVIDER_TOKEN));
 
         this.parts = new ArrayList<Set<String>>();
         for (String part : parts) {
             Set<String> subparts = CollectionUtils.asSet(part.split(SUBPART_DIVIDER_TOKEN));
-            if (!caseSensitive) {
-                subparts = lowercase(subparts);
-            }
+
             if (subparts.isEmpty()) {
                 throw new IllegalArgumentException("Wildcard string cannot contain parts with only dividers. Make sure permission strings are properly formatted.");
             }
@@ -173,14 +175,6 @@ public class WildcardPermission implements Permission, Serializable {
         }
     }
 
-    private Set<String> lowercase(Set<String> subparts) {
-        Set<String> lowerCasedSubparts = new LinkedHashSet<String>(subparts.size());
-        for (String subpart : subparts) {
-            lowerCasedSubparts.add(subpart.toLowerCase());
-        }
-        return lowerCasedSubparts;
-    }
-
     /*--------------------------------------------
     |  A C C E S S O R S / M O D I F I E R S    |
     ============================================*/


[5/6] shiro git commit: SHIRO-435: Fix the double SecurityManager singleton. Also prevent the same issue on Environment. Update test cases of ShiroWebModule accordingly. (Patch from https://issues.apache.org/jira/browse/SHIRO-435)

Posted by bd...@apache.org.
SHIRO-435: Fix the double SecurityManager singleton. Also prevent the same issue on Environment. Update test cases of ShiroWebModule accordingly. (Patch from https://issues.apache.org/jira/browse/SHIRO-435)

Fixes #16


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

Branch: refs/heads/1.3.x
Commit: dff6cc689440a954a64335df52d390f4bbe98ef2
Parents: 3015cd0
Author: Johannes Schnatterer <jo...@triology.de>
Authored: Wed May 25 14:29:41 2016 +0200
Committer: Brian Demers <bd...@stormpath.com>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/shiro/guice/web/ShiroWebModule.java     | 4 ++--
 .../java/org/apache/shiro/guice/web/ShiroWebModuleTest.java | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/dff6cc68/support/guice/src/main/java/org/apache/shiro/guice/web/ShiroWebModule.java
----------------------------------------------------------------------
diff --git a/support/guice/src/main/java/org/apache/shiro/guice/web/ShiroWebModule.java b/support/guice/src/main/java/org/apache/shiro/guice/web/ShiroWebModule.java
index 316958e..45bc916 100644
--- a/support/guice/src/main/java/org/apache/shiro/guice/web/ShiroWebModule.java
+++ b/support/guice/src/main/java/org/apache/shiro/guice/web/ShiroWebModule.java
@@ -179,7 +179,7 @@ public abstract class ShiroWebModule extends ShiroModule {
     @SuppressWarnings({"unchecked"})
     @Override
     protected final void bindSecurityManager(AnnotatedBindingBuilder<? super SecurityManager> bind) {
-        bindWebSecurityManager(bind);
+        bind.to(WebSecurityManager.class); // SHIRO-435
     }
 
     /**
@@ -211,7 +211,7 @@ public abstract class ShiroWebModule extends ShiroModule {
 
     @Override
     protected final void bindEnvironment(AnnotatedBindingBuilder<Environment> bind) {
-        bindWebEnvironment(bind);
+        bind.to(WebEnvironment.class); // SHIRO-435
     }
 
     protected void bindWebEnvironment(AnnotatedBindingBuilder<? super WebEnvironment> bind) {

http://git-wip-us.apache.org/repos/asf/shiro/blob/dff6cc68/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java
----------------------------------------------------------------------
diff --git a/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java b/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java
index 908f322..a3a3f76 100644
--- a/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java
+++ b/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java
@@ -100,7 +100,7 @@ public class ShiroWebModuleTest {
 
             @Override
             protected void bindWebSecurityManager(AnnotatedBindingBuilder<? super WebSecurityManager> bind) {
-                bind.to(MyDefaultWebSecurityManager.class);
+                bind.to(MyDefaultWebSecurityManager.class).asEagerSingleton();
             }
         });
         SecurityManager securityManager = injector.getInstance(SecurityManager.class);
@@ -109,7 +109,8 @@ public class ShiroWebModuleTest {
         WebSecurityManager webSecurityManager = injector.getInstance(WebSecurityManager.class);
         assertNotNull(webSecurityManager);
         assertTrue(webSecurityManager instanceof MyDefaultWebSecurityManager);
-
+        // SHIRO-435: Check both keys SecurityManager and WebSecurityManager are bound to the same instance
+        assertTrue( securityManager == webSecurityManager );
     }
 
     @Test
@@ -132,7 +133,7 @@ public class ShiroWebModuleTest {
 
             @Override
             protected void bindWebEnvironment(AnnotatedBindingBuilder<? super WebEnvironment> bind) {
-                bind.to(MyWebEnvironment.class);
+                bind.to(MyWebEnvironment.class).asEagerSingleton();
             }
         });
         Environment environment = injector.getInstance(Environment.class);
@@ -141,6 +142,8 @@ public class ShiroWebModuleTest {
         WebEnvironment webEnvironment = injector.getInstance(WebEnvironment.class);
         assertNotNull(webEnvironment);
         assertTrue(webEnvironment instanceof MyWebEnvironment);
+        // SHIRO-435: Check both keys Environment and WebEnvironment are bound to the same instance
+        assertTrue( environment == webEnvironment );
     }
 
     public static class MyDefaultWebSecurityManager extends DefaultWebSecurityManager {


[2/6] shiro git commit: SHIRO-300 Add protected setParts(list) method to WildcardPermission so subclasses can create their own parts/subparts list.

Posted by bd...@apache.org.
SHIRO-300 Add protected setParts(list) method to WildcardPermission so subclasses can create their own parts/subparts list.

Fixes #17


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

Branch: refs/heads/1.3.x
Commit: 3015cd08ab466bbe8a423da17a9fc95b05d27720
Parents: 6809366
Author: Matt Bishop <ma...@elasticpath.com>
Authored: Sun May 29 12:06:01 2016 -0700
Committer: Brian Demers <bd...@stormpath.com>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 .../apache/shiro/authz/permission/WildcardPermission.java   | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/3015cd08/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java b/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
index 54032a3..4149771 100644
--- a/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
+++ b/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
@@ -182,6 +182,15 @@ public class WildcardPermission implements Permission, Serializable {
         return this.parts;
     }
 
+    /**
+     * Sets the pre-split String parts of this <code>WildcardPermission</code>.
+     * @since 1.3.0
+     * @param parts pre-split String parts.
+     */
+    protected void setParts(List<Set<String>> parts) {
+        this.parts = parts;
+    }
+
     /*--------------------------------------------
     |               M E T H O D S               |
     ============================================*/