incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/3] git commit: Fixed BLUR-434
Date Mon, 15 Jun 2015 13:39:27 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master 90625d023 -> 49390b52a


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-document-security/src/test/java/org/apache/blur/lucene/security/analysis/DocumentVisibilityTokenStreamTest.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/test/java/org/apache/blur/lucene/security/analysis/DocumentVisibilityTokenStreamTest.java
b/blur-document-security/src/test/java/org/apache/blur/lucene/security/analysis/DocumentVisibilityTokenStreamTest.java
new file mode 100644
index 0000000..f633aad
--- /dev/null
+++ b/blur-document-security/src/test/java/org/apache/blur/lucene/security/analysis/DocumentVisibilityTokenStreamTest.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.blur.lucene.security.analysis;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.blur.lucene.security.DocumentVisibility;
+import org.apache.blur.lucene.security.analysis.DocumentVisibilityTokenStream;
+import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+import org.junit.Test;
+
+public class DocumentVisibilityTokenStreamTest {
+  @Test
+  public void test() throws IOException {
+    DocumentVisibilityTokenStream stream = new DocumentVisibilityTokenStream(new DocumentVisibility(
+        "hi|(hi&cool&(c&(b|f)))|nice"));
+    CharTermAttribute termAttribute = stream.addAttribute(CharTermAttribute.class);
+    stream.reset();
+    List<String> expectedTerms = new ArrayList<String>();
+    expectedTerms.add("hi");
+    expectedTerms.add("nice");
+    expectedTerms.add("c&cool&hi&(b|f)");
+
+    List<String> terms = new ArrayList<String>();
+    while (stream.incrementToken()) {
+      terms.add(termAttribute.toString());
+    }
+    stream.close();
+
+    assertEquals(expectedTerms, terms);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/DocValueSecureAtomicReaderTest.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/DocValueSecureAtomicReaderTest.java
b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/DocValueSecureAtomicReaderTest.java
new file mode 100644
index 0000000..5fc0f28
--- /dev/null
+++ b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/DocValueSecureAtomicReaderTest.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.blur.lucene.security.index;
+
+import org.apache.blur.lucene.security.index.AccessControlFactory;
+import org.apache.blur.lucene.security.index.DocValueAccessControlFactory;
+
+public class DocValueSecureAtomicReaderTest extends SecureAtomicReaderTestBase {
+
+  private AccessControlFactory _accessControlFactory = new DocValueAccessControlFactory();
+
+  @Override
+  public AccessControlFactory getAccessControlFactory() {
+    return _accessControlFactory;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/FilterSecureAtomicReaderTest.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/FilterSecureAtomicReaderTest.java
b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/FilterSecureAtomicReaderTest.java
new file mode 100644
index 0000000..748d749
--- /dev/null
+++ b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/FilterSecureAtomicReaderTest.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.blur.lucene.security.index;
+
+import org.apache.blur.lucene.security.index.AccessControlFactory;
+import org.apache.blur.lucene.security.index.FilterAccessControlFactory;
+
+public class FilterSecureAtomicReaderTest extends SecureAtomicReaderTestBase {
+
+  private AccessControlFactory _accessControlFactory = new FilterAccessControlFactory();
+
+  @Override
+  public AccessControlFactory getAccessControlFactory() {
+    return _accessControlFactory;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
new file mode 100644
index 0000000..11750a7
--- /dev/null
+++ b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
@@ -0,0 +1,333 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.blur.lucene.security.index;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.blur.lucene.security.index.AccessControlFactory;
+import org.apache.blur.lucene.security.index.AccessControlReader;
+import org.apache.blur.lucene.security.index.AccessControlWriter;
+import org.apache.blur.lucene.security.index.SecureAtomicReader;
+import org.apache.lucene.analysis.core.KeywordAnalyzer;
+import org.apache.lucene.document.BinaryDocValuesField;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.document.NumericDocValuesField;
+import org.apache.lucene.document.SortedDocValuesField;
+import org.apache.lucene.document.SortedSetDocValuesField;
+import org.apache.lucene.document.StringField;
+import org.apache.lucene.index.AtomicReader;
+import org.apache.lucene.index.AtomicReaderContext;
+import org.apache.lucene.index.BinaryDocValues;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.DocsEnum;
+import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.NumericDocValues;
+import org.apache.lucene.index.SortedDocValues;
+import org.apache.lucene.index.SortedSetDocValues;
+import org.apache.lucene.index.Terms;
+import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.queryparser.classic.QueryParser;
+import org.apache.lucene.search.DocIdSetIterator;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.Version;
+import org.junit.Test;
+
+public abstract class SecureAtomicReaderTestBase {
+
+  public abstract AccessControlFactory getAccessControlFactory();
+
+  @Test
+  public void testLiveDocs() throws IOException {
+    SecureAtomicReader secureReader = getSecureReader();
+    Bits liveDocs = secureReader.getLiveDocs();
+    assertEquals(4, liveDocs.length());
+    assertTrue(liveDocs.get(0));
+    assertTrue(liveDocs.get(1));
+    assertTrue(liveDocs.get(2));
+    assertFalse(liveDocs.get(3));
+    secureReader.close();
+  }
+
+  @Test
+  public void testDocumentFetch() throws IOException {
+    SecureAtomicReader secureReader = getSecureReader();
+    {
+      Document document = secureReader.document(0);
+      Set<String> allowed = new HashSet<String>();
+      allowed.add("test");
+      allowed.add("info");
+      allowed.add(getAccessControlFactory().getDiscoverFieldName());
+      allowed.add(getAccessControlFactory().getReadFieldName());
+      for (IndexableField field : document) {
+        assertTrue(allowed.contains(field.name()));
+      }
+    }
+    {
+      Document document = secureReader.document(1);
+      Set<String> allowed = new HashSet<String>();
+      allowed.add("info");
+      for (IndexableField field : document) {
+        assertTrue(allowed.contains(field.name()));
+      }
+    }
+    {
+      Document document = secureReader.document(2);
+      Set<String> allowed = new HashSet<String>();
+      allowed.add("test");
+      allowed.add("info");
+      allowed.add(getAccessControlFactory().getDiscoverFieldName());
+      allowed.add(getAccessControlFactory().getReadFieldName());
+      for (IndexableField field : document) {
+        assertTrue(allowed.contains(field.name()));
+      }
+    }
+    {
+      Document document = secureReader.document(3);
+      Iterator<IndexableField> iterator = document.iterator();
+      assertFalse(iterator.hasNext());
+    }
+
+    secureReader.close();
+  }
+
+  @Test
+  public void testNumericDocValues() throws IOException {
+    SecureAtomicReader secureReader = getSecureReader();
+    NumericDocValues numericDocValues = secureReader.getNumericDocValues("number");
+    assertEquals(0, numericDocValues.get(0));
+    assertEquals(0, numericDocValues.get(1));
+    assertEquals(2, numericDocValues.get(2));
+    assertEquals(0, numericDocValues.get(3));
+  }
+
+  @Test
+  public void testBinaryDocValues() throws IOException {
+    SecureAtomicReader secureReader = getSecureReader();
+    BinaryDocValues binaryDocValues = secureReader.getBinaryDocValues("bin");
+    BytesRef result = new BytesRef();
+    binaryDocValues.get(0, result);
+    assertEquals(new BytesRef("0".getBytes()), result);
+
+    binaryDocValues.get(1, result);
+    assertEquals(new BytesRef(), result);
+
+    binaryDocValues.get(2, result);
+    assertEquals(new BytesRef("2".getBytes()), result);
+
+    binaryDocValues.get(3, result);
+    assertEquals(new BytesRef(), result);
+  }
+
+  @Test
+  public void testSortedDocValues() throws IOException {
+    SecureAtomicReader secureReader = getSecureReader();
+    SortedDocValues sortedDocValues = secureReader.getSortedDocValues("sorted");
+    {
+      BytesRef result = new BytesRef();
+      sortedDocValues.get(0, result);
+      assertEquals(new BytesRef("0".getBytes()), result);
+    }
+    {
+      BytesRef result = new BytesRef();
+      sortedDocValues.get(1, result);
+      assertEquals(new BytesRef(), result);
+    }
+    {
+      BytesRef result = new BytesRef();
+      sortedDocValues.get(2, result);
+      assertEquals(new BytesRef("2".getBytes()), result);
+    }
+    {
+      BytesRef result = new BytesRef();
+      sortedDocValues.get(3, result);
+      assertEquals(new BytesRef(), result);
+    }
+  }
+
+  @Test
+  public void testSortedSetDocValues() throws IOException {
+    SecureAtomicReader secureReader = getSecureReader();
+    SortedSetDocValues sortedSetDocValues = secureReader.getSortedSetDocValues("sortedset");
+    {
+      BytesRef result = new BytesRef();
+      int docID = 0;
+      sortedSetDocValues.setDocument(docID);
+      long ord = -1;
+      assertTrue((ord = sortedSetDocValues.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS);
+      sortedSetDocValues.lookupOrd(ord, result);
+      assertEquals(new BytesRef(Integer.toString(docID)), result);
+
+      assertTrue((ord = sortedSetDocValues.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS);
+      sortedSetDocValues.lookupOrd(ord, result);
+      assertEquals(new BytesRef("0" + Integer.toString(docID)), result);
+
+      assertTrue((ord = sortedSetDocValues.nextOrd()) == SortedSetDocValues.NO_MORE_ORDS);
+    }
+
+    {
+      int docID = 1;
+      sortedSetDocValues.setDocument(docID);
+      assertTrue(sortedSetDocValues.nextOrd() == SortedSetDocValues.NO_MORE_ORDS);
+    }
+
+    {
+      BytesRef result = new BytesRef();
+      int docID = 2;
+      sortedSetDocValues.setDocument(docID);
+      long ord = -1;
+      assertTrue((ord = sortedSetDocValues.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS);
+      sortedSetDocValues.lookupOrd(ord, result);
+      assertEquals(new BytesRef("0" + Integer.toString(docID)), result);
+
+      assertTrue((ord = sortedSetDocValues.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS);
+      sortedSetDocValues.lookupOrd(ord, result);
+      assertEquals(new BytesRef(Integer.toString(docID)), result);
+
+      assertTrue((ord = sortedSetDocValues.nextOrd()) == SortedSetDocValues.NO_MORE_ORDS);
+    }
+
+    {
+      int docID = 3;
+      sortedSetDocValues.setDocument(docID);
+      assertTrue(sortedSetDocValues.nextOrd() == SortedSetDocValues.NO_MORE_ORDS);
+    }
+  }
+
+  @Test
+  public void testTermWalk() throws IOException, ParseException {
+    SecureAtomicReader secureReader = getSecureReader();
+    Fields fields = secureReader.fields();
+    for (String field : fields) {
+      Terms terms = fields.terms(field);
+      TermsEnum termsEnum = terms.iterator(null);
+      BytesRef ref;
+      while ((ref = termsEnum.next()) != null) {
+        System.out.println(field + " " + ref.utf8ToString());
+        DocsEnum docsEnum = termsEnum.docs(null, null);
+        int doc;
+        while ((doc = docsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
+          System.out.println(field + " " + ref.utf8ToString() + " " + doc);
+        }
+      }
+    }
+    secureReader.close();
+  }
+
+  @Test
+  public void testQuery() throws IOException, ParseException {
+    SecureAtomicReader secureReader = getSecureReader();
+    QueryParser parser = new QueryParser(Version.LUCENE_43, "nothing", new KeywordAnalyzer());
+    Query query = parser.parse("test:test");
+    IndexSearcher searcher = new IndexSearcher(secureReader);
+    TopDocs topDocs = searcher.search(query, 10);
+    assertEquals(3, topDocs.totalHits);
+    {
+      int doc = topDocs.scoreDocs[0].doc;
+      assertEquals(0, doc);
+      Document document = searcher.doc(doc);
+      assertEquals("test", document.get("test"));
+      assertEquals("info", document.get("info"));
+    }
+    {
+      int doc = topDocs.scoreDocs[1].doc;
+      assertEquals(1, doc);
+      Document document = searcher.doc(doc);
+      assertNull(document.get("test"));
+      assertEquals("info", document.get("info"));
+    }
+    {
+      int doc = topDocs.scoreDocs[2].doc;
+      assertEquals(2, doc);
+      Document document = searcher.doc(doc);
+      assertEquals("test", document.get("test"));
+      assertEquals("info", document.get("info"));
+    }
+
+    secureReader.close();
+  }
+
+  private SecureAtomicReader getSecureReader() throws IOException {
+    AtomicReader baseReader = createReader();
+    Set<String> dicoverableFields = new HashSet<String>();
+    dicoverableFields.add("info");
+    AccessControlReader accessControlReader = getAccessControlFactory().getReader(Arrays.asList("r1"),
+        Arrays.asList("d1"), dicoverableFields);
+    return new SecureAtomicReader(baseReader, accessControlReader);
+  }
+
+  private AtomicReader createReader() throws IOException {
+    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_43, new KeywordAnalyzer());
+    Directory dir = new RAMDirectory();
+    IndexWriter writer = new IndexWriter(dir, conf);
+    AccessControlWriter accessControlWriter = getAccessControlFactory().getWriter();
+    writer.addDocument(accessControlWriter.addDiscoverVisiblity("d1",
+        accessControlWriter.addReadVisiblity("r1", getDoc(0))));
+    writer.addDocument(accessControlWriter.addDiscoverVisiblity("d1",
+        accessControlWriter.addReadVisiblity("r2", getDoc(1))));
+    writer.addDocument(accessControlWriter.addDiscoverVisiblity("d2",
+        accessControlWriter.addReadVisiblity("r1", getDoc(2))));
+    writer.addDocument(accessControlWriter.addDiscoverVisiblity("d2",
+        accessControlWriter.addReadVisiblity("r2", getDoc(3))));
+    writer.close();
+
+    DirectoryReader reader = DirectoryReader.open(dir);
+    List<AtomicReaderContext> leaves = reader.leaves();
+    return leaves.get(0).reader();
+  }
+
+  // private Iterable<? extends IndexableField> debug(Iterable<IndexableField>
+  // doc) {
+  // System.out.println(doc);
+  // return doc;
+  // }
+
+  private Iterable<IndexableField> getDoc(int i) {
+    Document document = new Document();
+    document.add(new StringField("test", "test", Store.YES));
+    document.add(new StringField("info", "info", Store.YES));
+    if (i == 3) {
+      document.add(new StringField("shouldnotsee", "shouldnotsee", Store.YES));
+    }
+    document.add(new NumericDocValuesField("number", i));
+    document.add(new BinaryDocValuesField("bin", new BytesRef(Integer.toString(i).getBytes())));
+    document.add(new SortedDocValuesField("sorted", new BytesRef(Integer.toString(i).getBytes())));
+    document.add(new SortedSetDocValuesField("sortedset", new BytesRef(Integer.toString(i).getBytes())));
+    document.add(new SortedSetDocValuesField("sortedset", new BytesRef(("0" + Integer.toString(i)).getBytes())));
+    return document;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurMapReduceUtil.java
----------------------------------------------------------------------
diff --git a/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurMapReduceUtil.java
b/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurMapReduceUtil.java
index 41769d0..682b5ed 100644
--- a/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurMapReduceUtil.java
+++ b/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurMapReduceUtil.java
@@ -27,10 +27,9 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import lucene.security.DocumentVisibility;
-
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
+import org.apache.blur.lucene.security.DocumentVisibility;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-query/src/main/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinition.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinition.java
b/blur-query/src/main/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinition.java
index ca65a27..b6f094e 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinition.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinition.java
@@ -22,9 +22,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
-import lucene.security.document.DocumentVisiblityField;
-
 import org.apache.blur.analysis.FieldTypeDefinition;
+import org.apache.blur.lucene.security.document.DocumentVisiblityField;
 import org.apache.blur.thrift.generated.Column;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.lucene.analysis.Analyzer;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-query/src/main/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinition.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinition.java
b/blur-query/src/main/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinition.java
index 1342362..71922d2 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinition.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinition.java
@@ -22,9 +22,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
-import lucene.security.document.DocumentVisiblityField;
-
 import org.apache.blur.analysis.FieldTypeDefinition;
+import org.apache.blur.lucene.security.document.DocumentVisiblityField;
 import org.apache.blur.thrift.generated.Column;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.lucene.analysis.Analyzer;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
b/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
index 8e68b53..48c79ae 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
@@ -27,14 +27,13 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import lucene.security.index.AccessControlFactory;
-import lucene.security.index.FilterAccessControlFactory;
-import lucene.security.search.SecureIndexSearcher;
-
 import org.apache.blur.analysis.BaseFieldManager;
 import org.apache.blur.analysis.FieldTypeDefinition;
 import org.apache.blur.analysis.NoStopWordStandardAnalyzer;
 import org.apache.blur.lucene.search.SuperParser;
+import org.apache.blur.lucene.security.index.AccessControlFactory;
+import org.apache.blur.lucene.security.index.FilterAccessControlFactory;
+import org.apache.blur.lucene.security.search.SecureIndexSearcher;
 import org.apache.blur.thrift.generated.Column;
 import org.apache.blur.thrift.generated.Record;
 import org.apache.blur.thrift.generated.ScoreType;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
b/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
index 7d4c323..0a54a96 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
@@ -25,14 +25,13 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 
-import lucene.security.index.AccessControlFactory;
-import lucene.security.index.FilterAccessControlFactory;
-import lucene.security.search.SecureIndexSearcher;
-
 import org.apache.blur.analysis.BaseFieldManager;
 import org.apache.blur.analysis.FieldTypeDefinition;
 import org.apache.blur.analysis.NoStopWordStandardAnalyzer;
 import org.apache.blur.lucene.search.SuperParser;
+import org.apache.blur.lucene.security.index.AccessControlFactory;
+import org.apache.blur.lucene.security.index.FilterAccessControlFactory;
+import org.apache.blur.lucene.security.search.SecureIndexSearcher;
 import org.apache.blur.thrift.generated.Column;
 import org.apache.blur.thrift.generated.Record;
 import org.apache.blur.thrift.generated.ScoreType;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-store/pom.xml
----------------------------------------------------------------------
diff --git a/blur-store/pom.xml b/blur-store/pom.xml
index d4f4ecd..84c9030 100644
--- a/blur-store/pom.xml
+++ b/blur-store/pom.xml
@@ -38,6 +38,11 @@
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
+			<artifactId>blur-document-security</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-kvs</artifactId>
 			<type>test-jar</type>
 			<version>${project.version}</version>
@@ -74,11 +79,6 @@
 			<version>${lucene.version}</version>
 		</dependency>
 		<dependency>
-			<groupId>com.github.amccurry</groupId>
-			<artifactId>lucene-document-security</artifactId>
-			<version>0.1.4</version>
-		</dependency>
-		<dependency>
 			<groupId>commons-cli</groupId>
 			<artifactId>commons-cli</artifactId>
 			<version>${commons-cli.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/blur-store/src/main/java/org/apache/blur/index/AtomicReaderUtil.java
----------------------------------------------------------------------
diff --git a/blur-store/src/main/java/org/apache/blur/index/AtomicReaderUtil.java b/blur-store/src/main/java/org/apache/blur/index/AtomicReaderUtil.java
index 6e12580..882bc1f 100644
--- a/blur-store/src/main/java/org/apache/blur/index/AtomicReaderUtil.java
+++ b/blur-store/src/main/java/org/apache/blur/index/AtomicReaderUtil.java
@@ -18,9 +18,8 @@ package org.apache.blur.index;
 
 import java.io.IOException;
 
-import lucene.security.index.SecureAtomicReader;
-
 import org.apache.blur.index.ExitableReader.ExitableFilterAtomicReader;
+import org.apache.blur.lucene.security.index.SecureAtomicReader;
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.SegmentReader;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-sources.jar
----------------------------------------------------------------------
diff --git a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-sources.jar
b/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-sources.jar
deleted file mode 100644
index 58dfe2a..0000000
Binary files a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-sources.jar
and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-tests.jar
----------------------------------------------------------------------
diff --git a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-tests.jar
b/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-tests.jar
deleted file mode 100644
index 8257bd0..0000000
Binary files a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4-tests.jar
and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.jar
----------------------------------------------------------------------
diff --git a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.jar
b/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.jar
deleted file mode 100644
index cfb2e9a..0000000
Binary files a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.jar
and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.pom
----------------------------------------------------------------------
diff --git a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.pom
b/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.pom
deleted file mode 100644
index 9dab12f..0000000
--- a/lib/com/github/amccurry/lucene-document-security/0.1.4/lucene-document-security-0.1.4.pom
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>com.github.amccurry</groupId>
-	<artifactId>lucene-document-security</artifactId>
-	<version>0.1.4</version>
-	<packaging>jar</packaging>
-	<name>Lucene Document Security</name>
-	<description>Provides an API for Document level security in Lucene.</description>
-
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.lucene</groupId>
-			<artifactId>lucene-core</artifactId>
-			<version>4.3.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.lucene</groupId>
-			<artifactId>lucene-analyzers-common</artifactId>
-			<version>4.3.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.lucene</groupId>
-			<artifactId>lucene-queryparser</artifactId>
-			<version>4.3.0</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-logging</groupId>
-			<artifactId>commons-logging</artifactId>
-			<version>1.1.3</version>
-		</dependency>
-		<dependency>
- 			<groupId>com.google.guava</groupId>
- 			<artifactId>guava</artifactId>
- 			<version>14.0</version>
- 		</dependency>
-		<dependency>
-			<groupId>commons-codec</groupId>
-			<artifactId>commons-codec</artifactId>
-			<version>1.9</version>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.9</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
-			<artifactId>concurrentlinkedhashmap-lru</artifactId>
-			<version>1.3.2</version>
-		</dependency>
-	</dependencies>
-
-	<repositories>
-		<repository>
-			<id>libdir</id>
-			<url>file://${basedir}/../lib</url>
-		</repository>
-	</repositories>
-
-	<build>
-	<plugins>
-		<plugin>
-			<groupId>org.apache.maven.plugins</groupId>
-			<artifactId>maven-surefire-plugin</artifactId>
-			<configuration>
-				<argLine>-XX:+UseConcMarkSweepGC -Xmx1g -Xms1g</argLine>
-				<forkCount>2</forkCount>
-				<forkMode>always</forkMode>
-				<reuseForks>false</reuseForks>
-				<systemPropertyVariables>
-					<blur.tmp.dir>${project.build.directory}/target/tmp</blur.tmp.dir>
-				</systemPropertyVariables>
-			</configuration>
-		</plugin>
-		<plugin>
-			<groupId>org.apache.maven.plugins</groupId>
-			<artifactId>maven-compiler-plugin</artifactId>
-			<configuration>
-				<source>1.6</source>
-				<target>1.6</target>
-			</configuration>
-		</plugin>
-		<plugin>
-			<groupId>org.apache.maven.plugins</groupId>
-			<artifactId>maven-source-plugin</artifactId>
-			<executions>
-				<execution>
-					<goals>
-						<goal>jar</goal>
-					</goals>
-				</execution>
-			</executions>
-		</plugin>
-		<plugin>
-			<groupId>org.apache.maven.plugins</groupId>
-			<artifactId>maven-jar-plugin</artifactId>
-			<executions>
-				<execution>
-					<goals>
-						<goal>test-jar</goal>
-					</goals>
-				</execution>
-			</executions>
-		</plugin>
-	</plugins>
-</build>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/49390b52/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0fdca67..b9602a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -194,6 +194,7 @@ under the License.
 		<servlet-api.version>3.0.1</servlet-api.version>
 		<hive.version>0.13.1</hive.version>
 		<java-allocation-instrumenter.version>3.0</java-allocation-instrumenter.version>
+		<commons-codec.version>1.9</commons-codec.version>
 	</properties>
 
     <dependencyManagement>
@@ -513,6 +514,7 @@ under the License.
 				<module>blur-status</module>
 				<module>blur-shell</module>
 				<module>blur-kvs</module>
+				<module>blur-document-security</module>
 				<module>distribution</module>
 			</modules>
 		</profile>
@@ -540,6 +542,7 @@ under the License.
 				<module>blur-status</module>
 				<module>blur-shell</module>
 				<module>blur-kvs</module>
+				<module>blur-document-security</module>
 				<module>distribution</module>
 			</modules>
 		</profile>
@@ -567,6 +570,7 @@ under the License.
 				<module>blur-status</module>
 				<module>blur-shell</module>
 				<module>blur-kvs</module>
+				<module>blur-document-security</module>
 				<module>distribution</module>
 			</modules>
 		</profile>


Mime
View raw message