--- a/_exceptions.py Wed Jul 17 15:02:28 2013 +0200
+++ b/_exceptions.py Mon Jul 22 14:57:37 2013 +0200
@@ -61,7 +61,7 @@
"""
class AuthenticationError(ConnectionError):
- """raised when when an attempt to establish a connection failed do to wrong
+ """raised when an attempt to establish a connection failed due to wrong
connection information (login / password or other authentication token)
"""
--- a/doc/book/en/devrepo/repo/sessions.rst Wed Jul 17 15:02:28 2013 +0200
+++ b/doc/book/en/devrepo/repo/sessions.rst Mon Jul 22 14:57:37 2013 +0200
@@ -59,7 +59,7 @@
other credentials elements (calling `authentication_information`),
giving the request object each time
- * the default retriever (oddly named `LoginPasswordRetreiver`)
+ * the default retriever (named `LoginPasswordRetriever`)
will in turn defer login and password fetching to the request
object (which, depending on the authentication mode (`cookie`
or `http`), will do the appropriate things and return a login
--- a/server/migractions.py Wed Jul 17 15:02:28 2013 +0200
+++ b/server/migractions.py Mon Jul 22 14:57:37 2013 +0200
@@ -83,8 +83,8 @@
repo.vreg.register(ClearGroupMap)
class ServerMigrationHelper(MigrationHelper):
- """specific migration helper for server side migration scripts,
- providind actions related to schema/data migration
+ """specific migration helper for server side migration scripts,
+ providing actions related to schema/data migration
"""
def __init__(self, config, schema, interactive=True,
--- a/web/application.py Wed Jul 17 15:02:28 2013 +0200
+++ b/web/application.py Mon Jul 22 14:57:37 2013 +0200
@@ -343,17 +343,17 @@
def main_handle_request(self, req, path):
- """Process and http request
+ """Process an http request
Arguments are:
- a Request object
- path of the request object
- It return the content of the http response. HTTP header and status are
- are set on the Request Object.
+ It returns the content of the http response. HTTP header and status are
+ set on the Request object.
"""
if not isinstance(req, CubicWebRequestBase):
- warn('[3.15] Application entry poin arguments are now (req, path) '
+ warn('[3.15] Application entry point arguments are now (req, path) '
'not (path, req)', DeprecationWarning, 2)
req, path = path, req
if req.authmode == 'http':
@@ -399,7 +399,7 @@
# Wrong, absent or Reseted credential
except AuthenticationError:
# If there is an https url configured and
- # the request do not used https, redirect to login form
+ # the request does not use https, redirect to login form
https_url = self.vreg.config['https-url']
if https_url and req.base_url() != https_url:
req.status_out = httplib.SEE_OTHER
--- a/web/views/authentication.py Wed Jul 17 15:02:28 2013 +0200
+++ b/web/views/authentication.py Mon Jul 22 14:57:37 2013 +0200
@@ -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,14 @@
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)
-class LoginPasswordRetreiver(WebAuthInfoRetreiver):
+
+class LoginPasswordRetriever(WebAuthInfoRetriever):
__regid__ = 'loginpwdauth'
order = 10
@@ -90,6 +93,9 @@
def revalidate_login(self, req):
return req.get_authorization()[0]
+LoginPasswordRetreiver = class_renamed('LoginPasswordRetreiver', LoginPasswordRetriever)
+
+
class RepositoryAuthenticationManager(AbstractAuthenticationManager):
"""authenticate user associated to a request and check session validity"""