log.debug("PROPFIND %s", xml_request)
self._answer = xmlutils.propfind(
self.path, xml_request, self._collection,
- self.headers.get("depth", "infinity"))
+ self.headers.get("depth", "infinity"),
+ context)
log.debug("PROPFIND ANSWER %s", self._answer)
self.send_calypso_response(client.MULTI_STATUS, len(self._answer))
"certificate": "/etc/apache2/ssl/server.crt",
"key": "/etc/apache2/ssl/server.key",
"pidfile": "/var/run/calypso.pid",
+ "user_principal": "/+%(user)s",
},
"encoding": {
"request": "utf-8",
return ET.tostring(multistatus, config.get("encoding", "request"))
-def propfind(path, xml_request, collection, depth):
+def propfind(path, xml_request, collection, depth, context):
"""Read and answer PROPFIND requests.
Read rfc4918-9.1 for info.
# element.text = time.strftime("%a, %d %b %Y %H:%M:%S +0000", item.last_modified)
# element.text = email.utils.formatdate(item.last_modified)
element.text = email.utils.formatdate(time.mktime(item.last_modified))
+ elif tag == _tag("D", "current-user-principal"):
+ tag = ET.Element(_tag("D", "href"))
+ tag.text = config.get("server", "user_principal") % context
+ element.append(tag)
prop.append(element)
status = ET.Element(_tag("D", "status"))
key = /etc/apache2/ssl/server.key
# File to store the PID of the running calypso instance
# pidfile = /var/run/calypso.pid
+# current user principal; path to the default collection for a user
+# for clients that use it (RFC5397)
+user_principal = /+%(user)s
[encoding]
# Encoding for responding requests