updated to unfiltered 0.5.2 webid
authorHenry Story <henry.story@bblfish.net>
Sat, 03 Dec 2011 18:44:47 +0100
branchwebid
changeset 145 4865469e5aac
parent 144 ff77c1ecc2b4
child 146 eb94418a1c66
updated to unfiltered 0.5.2
project/build.scala
src/main/scala/HttpsTrustAll.scala
src/main/scala/auth/X509view.scala
src/main/scala/netty/ReadWriteWebNetty.scala
src/main/scala/netty/SslLoginTest.scala
src/main/scala/netty/server.scala
--- a/project/build.scala	Sat Dec 03 16:12:05 2011 +0100
+++ b/project/build.scala	Sat Dec 03 18:44:47 2011 +0100
@@ -8,11 +8,11 @@
   val specs2 = "org.specs2" %% "specs2" % "1.6.1"
   val specs2_scalaz =  "org.specs2" %% "specs2-scalaz-core" % "6.0.1" % "test"
   val dispatch_http = "net.databinder" %% "dispatch-http" % "0.8.5" 
-  val unfiltered_version = "0.5.1"
+  val unfiltered_version = "0.5.2"
   val unfiltered_filter = "net.databinder" %% "unfiltered-filter" % unfiltered_version 
   val unfiltered_jetty = "net.databinder" %% "unfiltered-jetty" % unfiltered_version 
   val unfiltered_netty = "net.databinder" %% "unfiltered-netty" % unfiltered_version 
-  val scalate = "net.databinder" %% "unfiltered-scalate" % unfiltered_version  
+  val scalate = "net.databinder" %% "unfiltered-scalate" % "0.5.1"
   // val unfiltered_spec = "net.databinder" %% "unfiltered-spec" % "0.4.1" % "test"
   val ivyUnfilteredSpec =
     <dependencies>
--- a/src/main/scala/HttpsTrustAll.scala	Sat Dec 03 16:12:05 2011 +0100
+++ b/src/main/scala/HttpsTrustAll.scala	Sat Dec 03 18:44:47 2011 +0100
@@ -64,7 +64,7 @@
 
   import scala.sys.SystemProperties._
 
-  val sslContextFactory = {
+  val patchedSslContextFactory = {
     val trustWrapper =
       new X509TrustManagerWrapper {
         def wrapTrustManager(trustManager: X509TrustManager) =
@@ -96,7 +96,7 @@
   
   // not tested if ok, there was a problem anyway
   def delayedInit(x: ⇒ Unit): Unit = {
-    sslConn.setSslContext(sslContextFactory.buildSSLContext())
+    sslConn.setSslContext(patchedSslContextFactory.buildSSLContext())
     sslConn.setWantClientAuth(true)
   }
 
--- a/src/main/scala/auth/X509view.scala	Sat Dec 03 16:12:05 2011 +0100
+++ b/src/main/scala/auth/X509view.scala	Sat Dec 03 18:44:47 2011 +0100
@@ -34,7 +34,6 @@
 import unfiltered.scalate.Scalate
 import java.text.DateFormat
 import java.util.Date
-import scalaz.Validation
 
 /**
  * This plan just described the X509 WebID authentication information.
--- a/src/main/scala/netty/ReadWriteWebNetty.scala	Sat Dec 03 16:12:05 2011 +0100
+++ b/src/main/scala/netty/ReadWriteWebNetty.scala	Sat Dec 03 18:44:47 2011 +0100
@@ -28,11 +28,9 @@
 import org.w3.readwriteweb.auth.{X509view, RDFAuthZ}
 import org.w3.readwriteweb._
 import org.jboss.netty.handler.codec.http.HttpResponse
-import unfiltered.jetty.ContextBuilder
-import util.ClasspathUtils
 import unfiltered.netty.{ServerErrorResponse, ReceivedMessage, cycle}
 import unfiltered.request.Path
-import java.io.{FileInputStream, File}
+import unfiltered.netty.async
 import unfiltered.response.{JsContent, NotFound, ResponseString, Ok}
 
 /**
--- a/src/main/scala/netty/SslLoginTest.scala	Sat Dec 03 16:12:05 2011 +0100
+++ b/src/main/scala/netty/SslLoginTest.scala	Sat Dec 03 18:44:47 2011 +0100
@@ -28,6 +28,8 @@
 import unfiltered.response.ResponseString
 
 /**
+ * TODO: This should be moved to an archive
+ *
  * A very light weight plan to test SSL login using TLS renegotiation in netty.
  * This shows how easy it is to to this, and can be useful to try out different browsers' implementations
  * The certificate should only be requested of the client on going to /test/login .
--- a/src/main/scala/netty/server.scala	Sat Dec 03 16:12:05 2011 +0100
+++ b/src/main/scala/netty/server.scala	Sat Dec 03 18:44:47 2011 +0100
@@ -104,8 +104,12 @@
     new SecureServerPipelineFactory(channels, handlers, this)
 
   type ServerBuilder = Https
-  def handler(h: => ChannelHandler) = new Https(port, host, { () => h } :: handlers, beforeStopBlock)
-  def plan(plan: => ChannelHandler) = handler(plan)
+  def handler(h: => ChannelHandler) = makePlan(h)
+
+  def makePlan(h: => ChannelHandler) =
+    new Https(port, host, { () => h } :: handlers, beforeStopBlock)
+
+
   def beforeStop(block: => Unit) = new Https(port, host, handlers, { () => beforeStopBlock(); block })
 
 }