web/views/authentication.py
changeset 9402 2c48c091b6a2
parent 9071 46885bfa4150
parent 9225 4b81252fccdd
child 9883 0a5890491ab3
--- a/web/views/authentication.py	Tue Jul 02 17:09:04 2013 +0200
+++ b/web/views/authentication.py	Mon Jan 13 13:47:47 2014 +0100
@@ -22,6 +22,7 @@
 from threading import Lock
 
 from logilab.common.decorators import clear_cache
+from logilab.common.deprecation import class_renamed
 
 from cubicweb import AuthenticationError, BadConnectionId
 from cubicweb.view import Component
@@ -32,18 +33,18 @@
 class NoAuthInfo(Exception): pass
 
 
-class WebAuthInfoRetreiver(Component):
+class WebAuthInfoRetriever(Component):
     __registry__ = 'webauth'
     order = None
     __abstract__ = True
 
     def authentication_information(self, req):
-        """retreive authentication information from the given request, raise
+        """retrieve authentication information from the given request, raise
         NoAuthInfo if expected information is not found.
         """
         raise NotImplementedError()
 
-    def authenticated(self, retreiver, req, cnx, login, authinfo):
+    def authenticated(self, retriever, req, cnx, login, authinfo):
         """callback when return authentication information have opened a
         repository connection successfully. Take care req has no session
         attached yet, hence req.execute isn't available.
@@ -66,12 +67,17 @@
     def cleanup_authentication_information(self, req):
         """called when the retriever has returned some authentication
         information but we get an authentication error when using them, so it
-        get a chance to cleanup things (e.g. remove cookie)
+        get a chance to clean things up (e.g. remove cookie)
         """
         pass
 
+WebAuthInfoRetreiver = class_renamed(
+    'WebAuthInfoRetreiver', WebAuthInfoRetriever,
+    '[3.17] WebAuthInfoRetreiver had been renamed into WebAuthInfoRetriever '
+    '("ie" instead of "ei")')
 
-class LoginPasswordRetreiver(WebAuthInfoRetreiver):
+
+class LoginPasswordRetriever(WebAuthInfoRetriever):
     __regid__ = 'loginpwdauth'
     order = 10
 
@@ -90,6 +96,12 @@
     def revalidate_login(self, req):
         return req.get_authorization()[0]
 
+LoginPasswordRetreiver = class_renamed(
+    'LoginPasswordRetreiver', LoginPasswordRetriever,
+    '[3.17] LoginPasswordRetreiver had been renamed into LoginPasswordRetriever '
+    '("ie" instead of "ei")')
+
+
 class RepositoryAuthenticationManager(AbstractAuthenticationManager):
     """authenticate user associated to a request and check session validity"""