--- a/src/main/scala/auth/Authz.scala Tue Oct 18 11:24:07 2011 +0200
+++ b/src/main/scala/auth/Authz.scala Tue Oct 18 11:26:05 2011 +0200
@@ -84,13 +84,6 @@
abstract class AuthZ {
type Req = HttpRequest[HttpServletRequest]
type Res = ResponseFunction[HttpServletResponse]
-
- // I need a guard
- // - in order to be able to have different implementations, but subclassing could do to
- // - the guard should get the information from the file system or the authdb, so it should know where those are
-
- // I will need a web cache to get the subject
-
def protect(in: Req=>Res): Req=>Res = {
case req @ HttpMethod(method) & Path(path) if guard(method, path).allow(() => subject(req)) => in(req)
@@ -155,7 +148,7 @@
} yield {
val initialBinding = new QuerySolutionMap();
initialBinding.add("res", model.createResource("file://local"+path))
- val qe: QueryExecution = QueryExecutionFactory.create(selectQuery, model)//, initialBinding)
+ val qe: QueryExecution = QueryExecutionFactory.create(selectQuery, model, initialBinding)
val agentsAllowed = try {
val exec = qe.execSelect()
val res = for (qs <- exec) yield {
--- a/src/main/scala/auth/WebIdClaim.scala Tue Oct 18 11:24:07 2011 +0200
+++ b/src/main/scala/auth/WebIdClaim.scala Tue Oct 18 11:26:05 2011 +0200
@@ -46,16 +46,17 @@
PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
SELECT ?m ?e ?mod ?exp
WHERE {
- {
- ?key cert:identity ?webid .
- } UNION {
- ?webid cert:key ?key .
- }
- ?key rsa:modulus ?m ;
- rsa:public_exponent ?e .
+ {
+ ?key cert:identity ?webid .
+ } UNION {
+ ?webid cert:key ?key .
+ }
+ ?key rsa:modulus ?m ;
+ rsa:public_exponent ?e .
+
OPTIONAL { ?m cert:hex ?mod . }
OPTIONAL { ?e cert:decimal ?exp . }
-}""")
+ }""") //Including OPTIONAL notation, for backward compatibility - should remove that after a while
/**
* Transform an RDF representation of a number into a BigInteger