This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class AuthZ[A](act: Action[A])(implicit findGuard: RequestHeader => Guard) extends Action[A] { | |
def apply(req: Request): Result = { | |
val guard = findGuard(req) | |
if (guard.allow(guard.subject(req))) act(req) | |
else Results.Unauthorized | |
} | |
override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.w3.readwriteweb.play.auth | |
import play.api.mvc._ | |
import javax.security.auth.Subject | |
import java.security.Principal | |
import play.api.libs.concurrent.Promise | |
import java.security.cert.Certificate | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.w3.banana | |
import java.io._ | |
import scalaz.Validation | |
import scalaz.Validation._ | |
trait RDFReaderFactory[Rdf <: RDF] { | |
def format(ser: RDFSerialization) = ser match { | |
case RDFXML => RDFXMLReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.w3.play.auth | |
import akka.actor.Actor | |
import org.openrdf.model.URI | |
import java.security.cert.X509Certificate | |
import org.w3.play.rdf.GraphCache | |
import scalaz._ | |
import scala.Some | |
import scalaz.Scalaz._ | |
import org.w3.banana.RDF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URI | |
import scalaz.concurrent.Promise | |
import scalaz._ | |
import Scalaz._ | |
import language.implicitConversions | |
case class Cert(cn: String, pubKey: BigInt, webids: List[URI] ) | |
trait RequestHeader { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URI | |
import scalaz.concurrent.Promise | |
import scalaz._ | |
import Scalaz._ | |
import language.implicitConversions | |
import language.higherKinds | |
case class Cert(cn: String, pubKey: BigInt, webids: List[URI] ) | |
trait RequestHeader { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Using library from "net.sf.uadetector" % "uadetector-resources" % "2012.12" | |
import net.sf.uadetector.service._ | |
import net.sf.uadetector.UserAgentFamily._ | |
import net.sf.uadetector.UserAgent | |
val agentParser = UADetectorServiceFactory.getResourceModuleParser | |
val UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.45 Safari/53.22" | |
val agent = agentParser.parse(UA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2012 Henry Story, http://bblfish.net/ | |
* | |
* Licensed 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import coursier.core.Authentication, coursier.MavenRepository | |
interp.repositories() ++= Seq(MavenRepository( | |
"http://bblfish.net/work/repo/snapshots/" | |
)) | |
@ | |
import scala.concurrent.ExecutionContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package shapeless.examples | |
import shapeless.PolyDefns._ | |
import shapeless._ | |
import shapeless.ops.hlist.At | |
import scala.math.Ordering | |
/** |