def get_cr(self, uri, allow_last=False):
""" Split the uri, grab a cursor for that db
"""
- pdb = self.parent.auth_proxy.last_auth
+ pdb = self.parent.auth_provider.last_auth
dbname, uri2 = self.get_db(uri, rest_ret=True, allow_last=allow_last)
uri2 = (uri2 and uri2.split('/')) or []
if not dbname:
# if dbname was in our uri, we should have authenticated
# against that.
assert pdb == dbname, " %s != %s" %(pdb, dbname)
- res = self.parent.auth_proxy.auth_creds.get(dbname, False)
+ res = self.parent.auth_provider.auth_creds.get(dbname, False)
if not res:
- self.parent.auth_proxy.checkRequest(self.parent, uri, dbname)
- res = self.parent.auth_proxy.auth_creds[dbname]
+ self.parent.auth_provider.checkRequest(self.parent, uri, dbname)
+ res = self.parent.auth_provider.auth_creds[dbname]
user, passwd, dbn2, uid = res
db,pool = pooler.get_db_and_pool(dbname)
cr = db.cursor()
from tools.config import config
from DAV.WebDAVServer import DAVRequestHandler
from service import http_server
-from service.websrv_lib import HTTPDir, FixSendError, HttpOptions
+from service.websrv_lib import FixSendError, HttpOptions
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse
import urllib
conf = OpenDAVConfig(**_dc)
handler._config = conf
- reg_http_service(HTTPDir(directory,DAVHandler,DAVAuthProvider()))
+ reg_http_service(directory, DAVHandler, DAVAuthProvider())
logging.getLogger('webdav').info("WebDAV service registered at path: %s/ "% directory)
if not (config.get_misc('webdav', 'no_root_hack', False)):
# the StaticHttpHandler can find its dir_path.
config.misc.setdefault('static-http',{})['dir_path'] = dir_path
- if reg_http_service(HTTPDir('/', DAVStaticHandler)):
- logging.getLogger("web-services").info("WebDAV registered HTTP dir %s for /" % \
- (dir_path))
+ reg_http_service('/', DAVStaticHandler)
except Exception, e:
logging.getLogger('webdav').error('Cannot launch webdav: %s' % e)
reps['/'+uri] = path
if int(num_svcs):
- if http_server.reg_http_service(HTTPDir('/.well-known', RedirectHTTPHandler)):
- logging.getLogger("web-services").info("Registered HTTP redirect handler at /.well-known" )
+ reg_http_service('/.well-known', RedirectHTTPHandler)
init_well_known()
dbname = config.get('db_name', False)
if dbname:
PrincipalsRedirect.redirect_paths[''] = '/webdav/%s/principals' % dbname
- reg_http_service(HTTPDir('/principals', PrincipalsRedirect))
+ reg_http_service('/principals', PrincipalsRedirect)
logging.getLogger("web-services").info(
"Registered HTTP redirect handler for /principals to the %s db.",
dbname)