accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1397031 - in /accumulo/branches/1.4/src/core/src: main/java/org/apache/accumulo/core/security/Authorizations.java test/java/org/apache/accumulo/core/security/AuthorizationsTest.java
Date Thu, 11 Oct 2012 13:12:55 GMT
Author: ecn
Date: Thu Oct 11 13:12:55 2012
New Revision: 1397031

URL: http://svn.apache.org/viewvc?rev=1397031&view=rev
Log:
ACCUMULO-739 added simple "." and "/" to authorizations in 1.4 branch

Modified:
    accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
    accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java

Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java?rev=1397031&r1=1397030&r2=1397031&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
(original)
+++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
Thu Oct 11 13:12:55 2012
@@ -60,6 +60,8 @@ public class Authorizations implements I
     validAuthChars['_'] = true;
     validAuthChars['-'] = true;
     validAuthChars[':'] = true;
+    validAuthChars['.'] = true;
+    validAuthChars['/'] = true;
   }
   
   static final boolean isValidAuthChar(byte b) {

Modified: accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java?rev=1397031&r1=1397030&r2=1397031&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java
(original)
+++ accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java
Thu Oct 11 13:12:55 2012
@@ -18,6 +18,7 @@ package org.apache.accumulo.core.securit
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import org.apache.accumulo.core.util.ByteArraySet;
 import org.junit.Test;
@@ -37,4 +38,20 @@ public class AuthorizationsTest {
     assertEquals(a, b);
   }
   
+  @Test
+  public void testLegalCharacters() {
+    new Authorizations("_");
+    new Authorizations(".");
+    new Authorizations("A_/a.QO0D-l1");
+    new Authorizations("/");
+    new Authorizations("a");
+    new Authorizations("A");
+    try {
+      new Authorizations("|");
+      fail("Did not throw");
+    } catch (Exception ex) {
+      // ignored
+    }
+  }
+  
 }



Mime
View raw message