geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r788107 - in /geronimo/specs/trunk/geronimo-jacc_1.1_spec/src: main/java/javax/security/jacc/ test/java/javax/security/jacc/
Date Wed, 24 Jun 2009 18:24:35 GMT
Author: gawor
Date: Wed Jun 24 18:24:35 2009
New Revision: 788107

URL: http://svn.apache.org/viewvc?rev=788107&view=rev
Log:
ensure HTTPMethodSpec.getActions() returns right information - otherwise reserialized permission
objects could loose some vital information. Also, add serialVersionUID constants

Modified:
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/HTTPMethodSpec.java
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/URLPatternSpec.java
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebResourcePermission.java
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebRoleRefPermission.java
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebUserDataPermission.java
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/test/java/javax/security/jacc/WebUserDataPermissionTest.java

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/HTTPMethodSpec.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/HTTPMethodSpec.java?rev=788107&r1=788106&r2=788107&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/HTTPMethodSpec.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/HTTPMethodSpec.java
Wed Jun 24 18:24:35 2009
@@ -228,7 +228,7 @@
 
     public String getActions() {
         if (actions == null) {
-            if (isAll()) {
+            if (isAllWebResources()) {
                 actions = "";
             } else {
                 boolean first = true;
@@ -269,14 +269,18 @@
         return actions;
     }
 
-    private boolean isAll() {
-        return isExcluded && mask == 0x00;
+    private boolean isAllWebResources() {
+        return isExcluded && mask == 0x00 && transport == NA && extensionMethods.length
== 0;
     }
 
     public int hashCode() {
         return mask ^ transport;
     }
 
+    public String toString() {
+        return getActions();
+    }
+
     public boolean implies(HTTPMethodSpec p) {
         if ((transport & p.transport) != p.transport) {
             return false;

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/URLPatternSpec.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/URLPatternSpec.java?rev=788107&r1=788106&r2=788107&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/URLPatternSpec.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/URLPatternSpec.java
Wed Jun 24 18:24:35 2009
@@ -118,6 +118,10 @@
         return pattern;
     }
 
+    public String toString() {
+        return pattern;
+    }
+
     public boolean implies(URLPatternSpec p) {
 
         // The first URLPattern in the name of the argument permission is

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebResourcePermission.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebResourcePermission.java?rev=788107&r1=788106&r2=788107&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebResourcePermission.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebResourcePermission.java
Wed Jun 24 18:24:35 2009
@@ -39,6 +39,9 @@
  * @version $Rev$ $Date$
  */
 public final class WebResourcePermission extends Permission implements Serializable {
+
+    private static final long serialVersionUID = -3750758202597932275L;
+    
     private transient int cachedHashCode = 0;
     private transient URLPatternSpec urlPatternSpec;
     private transient HTTPMethodSpec httpMethodSpec;

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebRoleRefPermission.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebRoleRefPermission.java?rev=788107&r1=788106&r2=788107&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebRoleRefPermission.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebRoleRefPermission.java
Wed Jun 24 18:24:35 2009
@@ -32,6 +32,9 @@
  * @version $Rev$ $Date$
  */
 public final class WebRoleRefPermission extends Permission implements Serializable {
+
+    private static final long serialVersionUID = 7625355096788237915L;
+    
     private transient int cachedHashCode = 0;
     private String actions;
 

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebUserDataPermission.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebUserDataPermission.java?rev=788107&r1=788106&r2=788107&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebUserDataPermission.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/WebUserDataPermission.java
Wed Jun 24 18:24:35 2009
@@ -49,6 +49,8 @@
  */
 public final class WebUserDataPermission extends Permission implements Serializable {
 
+    private static final long serialVersionUID = 5863379766230648641L;
+    
     private transient int cachedHashCode = 0;
     private transient URLPatternSpec urlPatternSpec;
     private transient HTTPMethodSpec httpMethodSpec;

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/test/java/javax/security/jacc/WebUserDataPermissionTest.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/test/java/javax/security/jacc/WebUserDataPermissionTest.java?rev=788107&r1=788106&r2=788107&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/test/java/javax/security/jacc/WebUserDataPermissionTest.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/test/java/javax/security/jacc/WebUserDataPermissionTest.java
Wed Jun 24 18:24:35 2009
@@ -38,7 +38,7 @@
  * @version $Rev$ $Date$
  */
 public class WebUserDataPermissionTest extends TestCase {
-
+    
     /*
      * Testing WebResourcePermission(java.lang.String, java.lang.String)
      */
@@ -79,6 +79,7 @@
         testSerialization(new WebUserDataPermission("/foo", ""));
         testSerialization(new WebUserDataPermission("/foo", ":NONE"));
         testSerialization(new WebUserDataPermission("/foo", "GET,POST"));
+        testSerialization(new WebUserDataPermission("/foo", "!:CONFIDENTIAL"));
     }
 
     private void testSerialization(WebUserDataPermission permission) throws IOException,
ClassNotFoundException {



Mime
View raw message