Commit 6c825a59 authored by David Douard's avatar David Douard
Browse files

remove references to kerberos in the cube implementation

parent 58adaa8c4b0c
......@@ -27,8 +27,8 @@ class XRemoteUserRetriever(authentication.WebAuthInfoRetreiver):
"""
self.debug('web authenticator building auth info')
try:
login, realm = req.get_header('x-remote-user', None).split('@')
self.debug('encoding info for %s (%s)', login, realm)
login = req.get_header('x-remote-user', None)
self.debug('encoding info for %s', login)
_secret = self._cw.config._secret
cyphr = build_cypher(_secret)
# need a multiple of 16 in length
......@@ -48,27 +48,25 @@ class XRemoteUserRetriever(authentication.WebAuthInfoRetreiver):
if needed)
"""
self.debug('web authenticator running post authentication callback')
cnx.krb_and_cwuser = 'password' not in authinfo
cnx.trusted_cwuser = 'password' not in authinfo
def request_has_auth_info(self, req):
try:
login, realm = req.get_header('x-remote-user', None).split('@')
login, realm = req.get_header('x-remote-user', None)
except Exception:
return False
return True
def revalidate_login(self, req):
try:
login, realm = req.get_header('x-remote-user', None).split('@')
login, realm = req.get_header('x-remote-user', None)
except Exception:
return None
return login
@objectify_selector
def kerberos_authenticated(cls, req, rset=None, **kwargs):
if hasattr(req.cnx, 'krb_and_cwuser') and req.cnx.krb_and_cwuser:
return 1
return 0
def trust_authenticated(cls, req, rset=None, **kwargs):
return int(getattr(req.cnx, 'trusted_cwuser', False))
class LogoutController(basecontrollers.LogoutController):
......@@ -79,6 +77,6 @@ class LogoutController(basecontrollers.LogoutController):
return self._cw.build_url('view', vid='index', __message=msg)
def registration_callback(vreg):
actions.LogoutAction.__select__ = actions.LogoutAction.__select__ & ~kerberos_authenticated()
actions.LogoutAction.__select__ = actions.LogoutAction.__select__ & ~trust_authenticated()
vreg.register_and_replace(LogoutController, basecontrollers.LogoutController)
vreg.register(XRemoteUserRetriever)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment