Changeset - 49f656a0ccdd
[Not reviewed]
default
0 5 0
Søren Løvborg - 10 years ago 2015-07-26 13:58:50
kwi@kwi.dk
auth: miscellaneous improvements and typo fixes
5 files changed with 9 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/auth_settings.py
Show inline comments
 
@@ -107,6 +107,9 @@ class AuthSettingsController(BaseControl
 
        try:
 
            new_enabled_plugins = _auth_plugins_validator.to_python(request.POST.get('auth_plugins'))
 
        except formencode.Invalid:
 
            # User provided an invalid plugin list. Just fall back to
 
            # the list of currently enabled plugins. (We'll re-validate
 
            # and show an error message to the user, below.)
 
            pass
 
        else:
 
            # Hide plugins that the user has asked to be disabled, but
kallithea/controllers/login.py
Show inline comments
 
@@ -235,7 +235,7 @@ class LoginController(BaseController):
 

	
 
    def authentication_token(self):
 
        """Return the CSRF protection token for the session - just like it
 
        could have been screen scrabed from a page with a form.
 
        could have been screen scraped from a page with a form.
 
        Only intended for testing but might also be useful for other kinds
 
        of automation.
 
        """
kallithea/lib/auth.py
Show inline comments
 
@@ -472,6 +472,8 @@ class AuthUser(object):
 
    to the default anonymous user (if enabled). It's up to other parts
 
    of the code to check e.g. if a supplied password is correct, and if
 
    so, set `is_authenticated` to True.
 

	
 
    However, `AuthUser` does refuse to load a user that is not `active`.
 
    """
 

	
 
    def __init__(self, user_id=None, api_key=None, username=None,
kallithea/lib/base.py
Show inline comments
 
@@ -378,8 +378,8 @@ class BaseController(WSGIController):
 
    @staticmethod
 
    def _determine_auth_user(api_key, session_authuser):
 
        """
 
        Create an `AuthUser` object given the IP address of the request, the
 
        API key (if any), and the authuser from the session.
 
        Create an `AuthUser` object given the API key (if any) and the
 
        value of the authuser session cookie.
 
        """
 

	
 
        # Authenticate by API key
kallithea/model/user.py
Show inline comments
 
@@ -333,10 +333,8 @@ class UserModel(BaseModel):
 

	
 
    def fill_data(self, auth_user, user_id=None, api_key=None, username=None):
 
        """
 
        Fetches auth_user by user_id,or api_key if present.
 
        Fetches auth_user by user_id, api_key or username, if present.
 
        Fills auth_user attributes with those taken from database.
 
        Additionally sets is_authenticated if lookup fails
 
        present in database
 

	
 
        :param auth_user: instance of user to set attributes
 
        :param user_id: user id to fetch by
0 comments (0 inline, 0 general)