You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by io...@apache.org on 2014/04/01 19:45:11 UTC

svn commit: r1583743 - in /manifoldcf/integration/solr-4.x/branches/CONNECTORS-914: ./ src/main/assembly/ src/test/java/org/apache/solr/mcf/

Author: iorixxx
Date: Tue Apr  1 17:45:10 2014
New Revision: 1583743

URL: http://svn.apache.org/r1583743
Log:
mvn package assembly:assembly passes

Added:
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/pom.xml   (with props)
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/bin.xml   (with props)
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/src.xml   (with props)
Modified:
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/DEPENDENCIES.txt
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/README.txt
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFQParserPluginTest.java
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSCLoadTest.java
    manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSearchComponentTest.java

Modified: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/DEPENDENCIES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/DEPENDENCIES.txt?rev=1583743&r1=1583742&r2=1583743&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/DEPENDENCIES.txt (original)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/DEPENDENCIES.txt Tue Apr  1 17:45:10 2014
@@ -1,8 +1,7 @@
 Apache ManifoldCF Plugin for Apache Solr 4.x requires
 ---------------------------------------------------
 * JRE 1.6 or above
-* ant 1.8 or higher
-* ivy 2.2 or higher
+* mvn 3.0 or higher
 
 For building Apache ManifoldCF Plugin for Apache Solr 4.x:
 ------------------------------------------------------

Modified: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/README.txt
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/README.txt?rev=1583743&r1=1583742&r2=1583743&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/README.txt (original)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/README.txt Tue Apr  1 17:45:10 2014
@@ -26,34 +26,137 @@ Upgrading
 
 If you are replacing a version of Apache ManifoldCF Plugin for Apache Solr 4.x that is
 older than version 2.0, you must declare two additional fields (representing parent
-acls and parent deny acls), and reindex all your documents.  Otherwise, the plugin
-will prevent you from viewing any documents.
+acls and parent deny acls), and reindex all your documents, so all six fields have the.
+correct values. Otherwise, the plugin will prevent you from viewing any documents.
 
 Instructions for Building Apache ManifoldCF Plugin for Apache Solr 4.x from Source
 ------------------------------------------------------------------------------
 
-1. Download the Java SE 6 JDK (Java Development Kit), or greater, from http://www.oracle.com/technetwork/java/index.html.
+1. Download the Java SE 6 JDK (Java Development Kit), or greater, from
+   http://www.oracle.com/technetwork/java/index.html.
    You will need the JDK installed, and the %JAVA_HOME%\bin directory included
    on your command path.  To test this, issue a "java -version" command from your
    shell and verify that the Java version is 1.6 or greater.
 
-2. Download the Apache Ant binary distribution (1.8.2 or greater) from http://ant.apache.org.
-   You will need Ant installed and the %ANT_HOME%\bin directory included on your
-   command path.  To test this, issue a "ant -version" command from your
-   shell and verify that Ant is available.
-
-3. Download the Apache Ivy binary distribution (2.2.0 or greater) from http://ant.apache.org/ivy.
-    Copy the ivy jar into the ant lib area into the %ANT_HOME%\lib directory.
-    
-4. In a shell, change to the root directory of the source (where you find the outermost
-   build.xml file), and type "ant" for directions.
+2. Download and install Maven 3.0 or later.  Maven installation and configuration
+   instructions can be found here:  http://maven.apache.org
 
+3. Building distribution assemblies
+
+   Execute the following command in order to build the distribution assemblies
+
+   mvn package assembly:assembly
+
+   The JAR packages can be found in the target folder:
+
+   target/solr3x-plugin-mcf-<VERSION>.jar where <VERSION> is the release version
+
+
+Getting Started
+---------------
+
+There are two ways to hook up security to Solr in this package.  The first is using
+a Query Parser plugin.  The second is using a Search Component.  In both cases,
+the first step is to have ManifoldCF installed and running.  See:
+http://manifoldcf.apache.org/release/trunk/en_US/how-to-build-and-deploy.html
+
+Then, you will need to add fields to your Solr schema.xml file that can be used
+to contain document authorization information.  There will need to be six of these
+fields, an 'allow' field for documents, parents, and shares, and a 'deny' field for
+documents, parents, and shares.  For example:
+
+  <field name="allow_token_document" type="string" indexed="true" stored="false"
+    multiValued="true" required="false" default="__nosecurity__"/>
+  <field name="allow_token_parent" type="string" indexed="true" stored="false"
+    multiValued="true" required="false" default="__nosecurity__"/>
+  <field name="allow_token_share" type="string" indexed="true" stored="false"
+    multiValued="true" required="false" default="__nosecurity__"/>
+  <field name="deny_token_document" type="string" indexed="true" stored="false"
+    multiValued="true" required="false" default="__nosecurity__"/>
+  <field name="deny_token_parent" type="string" indexed="true" stored="false"
+    multiValued="true" required="false" default="__nosecurity__"/>
+  <field name="deny_token_share" type="string" indexed="true" stored="false"
+    multiValued="true" required="false" default="__nosecurity__"/>
+
+The default value of "__nosecurity__" is required by this plugin, so do not forget
+to include it.
+
+
+Using the Query Parser Plugin
+----------------------------
+
+To set up the query parser plugin, modify your solrconfig.xml to add the query parser:
+
+  <!-- ManifoldCF document security enforcement component -->
+  <queryParser name="manifoldCFSecurity"
+    class="org.apache.solr.mcf.ManifoldCFQParserPlugin">
+    <str name="AuthorityServiceBaseURL">http://localhost:8345/mcf-authority-service</str>
+    <int name="ConnectionPoolSize">50</int>
+  </queryParser>
+
+Hook up the search component in the solrconfig.xml file wherever you want it, e.g.:
+
+<requestHandler name="search" class="solr.SearchHandler" default="true">
+  <lst name="appends">
+    <str name="fq">{!manifoldCFSecurity}</str>
+  </lst>
+  ...
+</requestHandler>
+
+
+Using the Search Component
+----------------------------
+
+To set up the search component, modify your solrconfig.xml to add the search component:
+
+  <!-- ManifoldCF document security enforcement component -->
+  <searchComponent name="manifoldCFSecurity"
+    class="org.apache.solr.mcf.ManifoldCFSearchComponent">
+    <str name="AuthorityServiceBaseURL">http://localhost:8345/mcf-authority-service</str>
+    <int name="ConnectionPoolSize">50</int>
+  </searchComponent>
+
+Hook up the search component in the solrconfig.xml file wherever you want it, e.g.:
+
+<requestHandler name="search" class="solr.SearchHandler" default="true">
+  <arr name="last-components">
+    <str>manifoldCFSecurity</str>
+  </arr>
+  ...
+</requestHandler>
+
+
+Supplying authenticated usernames and domains
+----------------------------------------------
+
+This component looks for the following parameters in the Solr request object:
+
+AuthenticatedUserName
+AuthenticatedUserDomain
+AuthenticatedUserName_XX
+AuthenticatedUserDomain_XX
+
+At a minimum, AuthenticatedUserName must be present in order for the component to communicate with
+the ManifoldCF Authority Service and obtain user access tokens.  In that case, the user identity will consist
+of one user and one authorization domain.  If AuthenticatedUserDomain is not set, then the authorization domain
+chosen will be the standard default domain, an empty string.
+
+If you need multiple user/domain tuples for the user identity, you may pass these as parameter pairs starting with
+AuthenticatedUserName_0 and AuthenticatedUserDomain_0, and counting up as high as you like.
+
+Operation in conjunction with mod-authz-annotate
+------------------------------------------------
+
+An optional component of ManifoldCF can be built and deployed as part of Apache - mod-authz-annotate.  The
+mod-authz-annotate module obtains the Kerberos principal from the Kerberos tickets present if mod-auth-kerb is used, and uses
+the MCF Authority Service to look up the appropriate access tokens.  If you choose to use that architecture,
+you will still need to use this Solr component to modify the user query.  All you have to do is the following:
+
+- Make sure you do not set AuthenticatedUserName or AuthenticatedUserName_0 in the request
+- Make sure the HTTP request from Apache to Solr translates all AAAGRP header values into "UserToken" parameters
+   for the Solr request
 
-Some files included in Apache ManifoldCF Plugin for Apache Solr 4.x distributions
-----------------------------------------------------------------------------
 
-dist/apache-solr-mcf*.jar
-  The Apache ManifoldCF Plugin for Apache Solr 4.x jar.
 
 Licensing
 ---------

Added: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/pom.xml?rev=1583743&view=auto
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/pom.xml (added)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/pom.xml Tue Apr  1 17:45:10 2014
@@ -0,0 +1,131 @@
+<?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>org.apache.solr.mcf</groupId>
+
+  <name>ManifoldCF Solr4x Plugin</name>
+  <artifactId>solr4x-plugin-mcf</artifactId>
+  <version>2.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <description>ManifoldCF Plugin for Apache Solr 4.x</description>
+  <inceptionYear>2014</inceptionYear>
+
+  <organization>
+    <name>The Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <slf4j.version>1.6.6</slf4j.version>
+    <solr.version>4.7.0</solr.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-test-framework</artifactId>
+      <version>${solr.version}</version>
+      <type>jar</type>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-core</artifactId>
+      <version>${solr.version}</version>
+      <type>jar</type>
+      <scope>compile</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j.version}</version>
+      <scope>compile</scope>
+      <type>jar</type>
+     </dependency>
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.1.1</version>
+      <type>jar</type>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+  
+  <build>
+
+    <plugins>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <argLine>-Xmx1024m</argLine>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <encoding>utf-8</encoding>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <Specification-Title>${project.name}</Specification-Title>
+              <Specification-Version>${project.version}</Specification-Version>
+              <Specification-Vendor>The Apache Software Foundation</Specification-Vendor>
+              <Implementation-Title>${project.name}</Implementation-Title>
+              <Implementation-Version>${project.version}</Implementation-Version>
+              <Implementation-Vendor>The Apache Software Foundation</Implementation-Vendor>
+              <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
+              <url>${project.url}</url>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/main/assembly/bin.xml</descriptor>
+            <descriptor>src/main/assembly/src.xml</descriptor>
+          </descriptors>
+          <tarLongFileMode>gnu</tarLongFileMode>
+        </configuration>
+      </plugin>
+
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file

Propchange: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/bin.xml?rev=1583743&view=auto
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/bin.xml (added)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/bin.xml Tue Apr  1 17:45:10 2014
@@ -0,0 +1,53 @@
+<?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.
+-->
+<assembly>
+    <id>bin</id>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+    <moduleSets>
+        <moduleSet>
+            <excludes>
+            </excludes>
+            <binaries>
+                <outputDirectory>lib</outputDirectory>
+                <unpack>false</unpack>
+                <dependencySets>
+                    <dependencySet>
+                        <excludes>
+                            <exclude>org.slf4j:*</exclude>
+                        </excludes>
+                    </dependencySet>
+                </dependencySets>
+            </binaries>
+        </moduleSet>
+    </moduleSets>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>**/target/*.jar</include>
+                <include>README.txt</include>
+                <include>LICENSE.txt</include>
+                <include>NOTICE.txt</include>
+                <include>CHANGES.txt</include>
+                <include>DEPENDENCIES.txt</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+</assembly>

Propchange: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/bin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/src.xml
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/src.xml?rev=1583743&view=auto
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/src.xml (added)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/src.xml Tue Apr  1 17:45:10 2014
@@ -0,0 +1,37 @@
+<?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.
+-->
+<assembly>
+    <id>src</id>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <!-- Release materials -->
+        <fileSet>
+            <excludes>
+                <exclude>**/.*</exclude>
+                <exclude>**/.*/**</exclude>
+                <exclude>**/*.iml/**</exclude>
+                <exclude>**/target/**</exclude>
+                <exclude>**/lib/**</exclude>
+                <exclude>**/data/**</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+</assembly>

Propchange: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/main/assembly/src.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFQParserPluginTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFQParserPluginTest.java?rev=1583743&r1=1583742&r2=1583743&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFQParserPluginTest.java (original)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFQParserPluginTest.java Tue Apr  1 17:45:10 2014
@@ -30,7 +30,6 @@ import org.junit.Test;
 
 import org.eclipse.jetty.server.handler.ContextHandlerCollection;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 
@@ -40,7 +39,7 @@ public class ManifoldCFQParserPluginTest
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-auth-qparser.xml","schema-auth.xml",getFile("solr-mcf/solr").getAbsolutePath());
+    initCore("solrconfig-auth-qparser.xml","schema-auth.xml");
     service = new MockMCFAuthorityService();
     service.start();
 

Modified: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSCLoadTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSCLoadTest.java?rev=1583743&r1=1583742&r2=1583743&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSCLoadTest.java (original)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSCLoadTest.java Tue Apr  1 17:45:10 2014
@@ -30,7 +30,6 @@ import org.junit.Test;
 
 import org.eclipse.jetty.server.handler.ContextHandlerCollection;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 
@@ -40,7 +39,7 @@ public class ManifoldCFSCLoadTest extend
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-auth-load.xml","schema-auth.xml",getFile("solr-mcf/solr").getAbsolutePath());
+    initCore("solrconfig-auth-load.xml","schema-auth.xml");
     service = new MockMCFAuthorityService();
     service.start();
 

Modified: manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSearchComponentTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSearchComponentTest.java?rev=1583743&r1=1583742&r2=1583743&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSearchComponentTest.java (original)
+++ manifoldcf/integration/solr-4.x/branches/CONNECTORS-914/src/test/java/org/apache/solr/mcf/ManifoldCFSearchComponentTest.java Tue Apr  1 17:45:10 2014
@@ -40,7 +40,7 @@ public class ManifoldCFSearchComponentTe
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-auth.xml","schema-auth.xml",getFile("solr-mcf/solr").getAbsolutePath());
+    initCore("solrconfig-auth.xml","schema-auth.xml");
     service = new MockMCFAuthorityService();
     service.start();