You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by bb...@apache.org on 2011/02/24 14:38:23 UTC

svn commit: r1074143 - in /incubator/clerezza/trunk/parent/platform.security.foafssl/test: ./ src/main/resources/OSGI-INF/ src/main/scala/org/apache/clerezza/foafssl/ src/main/scala/org/apache/clerezza/foafssl/testservlet/ src/main/scala/org/apache/cle...

Author: bblfish
Date: Thu Feb 24 13:38:23 2011
New Revision: 1074143

URL: http://svn.apache.org/viewvc?rev=1074143&view=rev
Log:
Added very initial untested package for a service for testing foaf+ssl/WebID layer

Added:
    incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlets/
    incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlets/TestMe.scala
      - copied, changed from r1074141, incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlet/TestMe.scala
Removed:
    incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/Utilities.scala
    incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlet/TestMe.scala
Modified:
    incubator/clerezza/trunk/parent/platform.security.foafssl/test/pom.xml
    incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/resources/OSGI-INF/serviceComponents.xml

Modified: incubator/clerezza/trunk/parent/platform.security.foafssl/test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.security.foafssl/test/pom.xml?rev=1074143&r1=1074142&r2=1074143&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/platform.security.foafssl/test/pom.xml (original)
+++ incubator/clerezza/trunk/parent/platform.security.foafssl/test/pom.xml Thu Feb 24 13:38:23 2011
@@ -19,10 +19,10 @@
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.annotations</artifactId>
         </dependency>
-		<dependency>
-			<groupId>org.apache.clerezza</groupId>
-			<artifactId>platform.security.foafssl.ontologies</artifactId>
-		</dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.usermanager</artifactId>
+        </dependency>
 		<dependency>
 			<groupId>org.apache.clerezza</groupId>
 			<artifactId>rdf.core</artifactId>
@@ -60,10 +60,6 @@
 			<artifactId>scala-library</artifactId>
 		</dependency>
 		<dependency>
-			<groupId>org.jsslutils</groupId>
-			<artifactId>jsslutils</artifactId>
-		</dependency>
-		<dependency>
 			<groupId>org.wymiwyg</groupId>
 			<artifactId>jetty-osgi-httpservice</artifactId>
 		</dependency>
@@ -76,7 +72,7 @@
 
 	<build>
 		<sourceDirectory>src/main/scala</sourceDirectory>
-		<testSourceDirectory>src/test/scala</testSourceDirectory>
+		<!--testSourceDirectory>src/test/scala</testSourceDirectory-->
 		<plugins>
 			<plugin>
 				<groupId>org.scala-tools</groupId>

Modified: incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/resources/OSGI-INF/serviceComponents.xml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/resources/OSGI-INF/serviceComponents.xml?rev=1074143&r1=1074142&r2=1074143&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/resources/OSGI-INF/serviceComponents.xml (original)
+++ incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/resources/OSGI-INF/serviceComponents.xml Thu Feb 24 13:38:23 2011
@@ -1,34 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
-	<scr:component enabled="true" name="org.apache.clerezza.foafssl.ssl.Activator" immediate="true">
-		<implementation class="org.apache.clerezza.foafssl.ssl.Activator"/>
-		<reference name="x509TrustManagerWrapperService"
-		interface="org.apache.clerezza.foafssl.ssl.X509TrustManagerWrapperService"
-		cardinality="1..1" policy="static" bind="bindX509TrustManagerWrapperService" unbind="unbindX509TrustManagerWrapperService"/>
-	</scr:component>
-	<scr:component enabled="true" name="org.apache.clerezza.foafssl.auth.FoafSslAuthentication" immediate="true">
-		<implementation class="org.apache.clerezza.foafssl.auth.FoafSslAuthentication"/>
-		<service servicefactory="false">
-			<provide interface="org.apache.clerezza.platform.security.auth.WeightedAuthenticationMethod"/>
-		</service>
-		<reference name="webDescriptionProvider" interface="org.apache.clerezza.platform.users.WebDescriptionProvider"
-		cardinality="1..1" policy="static" bind="bindWebDescriptionProvider" unbind="unbindWebDescriptionProvider"/>
-		<!-- <reference name="conceptProviderManager"
-		interface="org.apache.clerezza.platform.concepts.core.ConceptProviderManager"
-		cardinality="1..1" policy="static" bind="bindConceptProviderManager" unbind="unbindConceptProviderManager"/>
-		<reference name="renderletManager"
-		interface="org.apache.clerezza.platform.typerendering.RenderletManager"
-		cardinality="1..1" policy="static" bind="bindRenderletManager" unbind="unbindRenderletManager"/> -->
-	</scr:component>
-	<scr:component enabled="true" name="org.apache.clerezza.foafssl.ssl.X509TrustManagerWrapperService">
-		<implementation class="org.apache.clerezza.foafssl.ssl.X509TrustManagerWrapperService"/>
-		<service servicefactory="false">
-			<provide interface="org.apache.clerezza.foafssl.ssl.X509TrustManagerWrapperService"/>
-		</service>
-		<reference name="tcManager" interface="org.apache.clerezza.platform.users.WebDescriptionProvider"
-		cardinality="1..1" policy="static" bind="bindWebDescriptionProvider" unbind="unbindWebDescriptionProvider"/>
-		<reference name="systemGraph" interface="org.apache.clerezza.rdf.core.access.LockableMGraph" 
-		cardinality="1..1" policy="static" target="(name=http://tpf.localhost/system.graph)" 
-		bind="bindSystemGraph" unbind="unbindSystemGraph"/>
+	<scr:component enabled="true" name="org.apache.clerezza.foafssl.testserlvets.TestMe" immediate="true">
+		<implementation class="org.apache.clerezza.foafssl.testservlets.TestMe"/>
+		<reference name="UserManager"
+		interface="org.apache.clerezza.platform.usermanager.UserManager"
+		cardinality="1..1" policy="static" bind="bindUserManager" unbind="unbindUserManager"/>
 	</scr:component>
 </components>

Copied: incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlets/TestMe.scala (from r1074141, incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlet/TestMe.scala)
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlets/TestMe.scala?p2=incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlets/TestMe.scala&p1=incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlet/TestMe.scala&r1=1074141&r2=1074143&rev=1074143&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlet/TestMe.scala (original)
+++ incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/testservlets/TestMe.scala Thu Feb 24 13:38:23 2011
@@ -1,3 +1,5 @@
+package org.apache.clerezza.foafssl.testservlets
+
 /*
  * Copyright 2011 hjs.
  *
@@ -14,43 +16,50 @@
  * limitations under the License.
  */
 
-package org.apache.clerezza.foafssl.testservlet
-
 import java.security.AccessController
 import java.security.PrivilegedAction
 import org.apache.clerezza.platform.security.UserUtil
 import org.apache.clerezza.platform.usermanager.UserManager
-import org.apache.felix.scr.annotations.Reference;
-import javax.ws.rs._
+import org.apache.felix.scr.annotations.Reference
+import javax.ws.rs.{GET, Path}
+import org.apache.clerezza.rdf.utils.GraphNode
+
+/**
+ * implementation of (very early) version of test server for WebID so that the following tests
+ * can be checked.
+ *
+ * http://lists.w3.org/Archives/Public/public-xg-webid/2011Jan/0107.html
+ */
 
 @Path("/test/webIdEndPoint")
 class TestMe {
 
   @Reference
-	var userManager: UserManager;
+  var userManager: UserManager =null;
+
+  protected def bindUserManager(um: UserManager)  = {
+		userManager = um
+	}
+
+	protected def unbindX509TrustManagerWrapperService(um: UserManager)  = {
+		userManager = null
+	}
 
   @GET
-  def getPersonalProfilePage() = {
+  def getTestMe() : String = {
     val context = AccessController.getContext();
-    val agent = AccessController.doPrivileged(new PrivilegedAction[GraphNode]() {
-    			@Override
-			def run(): GraphNode = {
-				val userName = UserUtil.getUserName(context);
-				if (userName == null) {
-					return null;
-				}
-				return userManager.getUserGraphNode(userName);
-			}
-		});
-		if (agent != null) {
-			node.addProperty(PLATFORM.user, agent.getNode());
-			MGraph userContext = new SimpleMGraph(agent.getNodeContext());
-			removeTripleWithProperty(userContext, PERMISSION.password);
-			removeTripleWithProperty(userContext, PERMISSION.passwordSha1);
-			node.getGraph().addAll(userContext);
-		}
-		return node;
-    }
+    val agent = AccessController.doPrivileged(new PrivilegedAction[String]() {
+      @Override
+      def run(): String = {
+        val userName = UserUtil.getUserName(context);
+        if (userName == null) {
+          return "-";
+        }
+        val node: GraphNode = userManager.getUserGraphNode(userName)
+        return node.getNode.toString;
+      }
+    });
+    return agent
   }
 
 }