accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1456002 - in /accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler: Authenticator.java ZKAuthenticator.java
Date Wed, 13 Mar 2013 15:27:14 GMT
Author: vines
Date: Wed Mar 13 15:27:14 2013
New Revision: 1456002

URL: http://svn.apache.org/r1456002
Log:
ACCUMULO-1159 - Fixes exception on all token prompts


Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java?rev=1456002&r1=1456001&r2=1456002&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
Wed Mar 13 15:27:14 2013
@@ -28,7 +28,7 @@ public interface Authenticator {
   
   public List<Set<AuthProperty>> getProperties();
   
-  public class AuthProperty {
+  public class AuthProperty implements Comparable<AuthProperty>{
     private String key, description;
     private boolean masked;
     
@@ -53,5 +53,20 @@ public interface Authenticator {
     public boolean getMask() {
       return this.masked;
     }
+    
+    public int hashCode() {
+      return key.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+      if (o instanceof AuthProperty)
+        return ((AuthProperty) o).key.equals(key);
+      return false;
+    }
+
+    @Override
+    public int compareTo(AuthProperty o) {
+      return key.compareTo(o.key);
+    }
   }
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java?rev=1456002&r1=1456001&r2=1456002&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
Wed Mar 13 15:27:14 2013
@@ -16,11 +16,11 @@
  */
 package org.apache.accumulo.core.security.handler;
 
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
@@ -45,7 +45,7 @@ public class ZKAuthenticator implements 
   @Override
   public List<Set<AuthProperty>> getProperties() {
     List<Set<AuthProperty>> toRet = new LinkedList<Set<AuthProperty>>();
-    Set<AuthProperty> internal = new TreeSet<AuthProperty>();
+    Set<AuthProperty> internal = new LinkedHashSet<AuthProperty>();
     internal.add(new AuthProperty("password", "the password for the principal", true));
     internal.add(new AuthProperty("principal", "option field to provide the principal, mostly
used for better debug statements", false));
     toRet.add(internal);



Mime
View raw message