equal
deleted
inserted
replaced
25 |
25 |
26 from logilab.common.decorators import clear_cache |
26 from logilab.common.decorators import clear_cache |
27 |
27 |
28 from cubicweb import AuthenticationError, BadConnectionId |
28 from cubicweb import AuthenticationError, BadConnectionId |
29 from cubicweb.view import Component |
29 from cubicweb.view import Component |
30 from cubicweb.dbapi import repo_connect, ConnectionProperties |
30 from cubicweb.dbapi import _repo_connect, ConnectionProperties |
31 from cubicweb.web import InvalidSession |
31 from cubicweb.web import InvalidSession |
32 from cubicweb.web.application import AbstractAuthenticationManager |
32 from cubicweb.web.application import AbstractAuthenticationManager |
33 |
33 |
34 class NoAuthInfo(Exception): pass |
34 class NoAuthInfo(Exception): pass |
35 |
35 |
168 return cnx, login |
168 return cnx, login |
169 raise AuthenticationError() |
169 raise AuthenticationError() |
170 |
170 |
171 def _authenticate(self, login, authinfo): |
171 def _authenticate(self, login, authinfo): |
172 cnxprops = ConnectionProperties(close=False, log=self.log_queries) |
172 cnxprops = ConnectionProperties(close=False, log=self.log_queries) |
173 cnx = repo_connect(self.repo, login, cnxprops=cnxprops, **authinfo) |
173 cnx = _repo_connect(self.repo, login, cnxprops=cnxprops, **authinfo) |
174 # decorate connection |
174 # decorate connection |
175 cnx.vreg = self.vreg |
175 cnx.vreg = self.vreg |
176 return cnx |
176 return cnx |
177 |
177 |