src/ssh_pmod.py
def _check_user(self, user):
        """Returns true if a user is of the appropriate format."""

        return (isinstance(user, dict) and
                'username' in user and
                isinstance(user['username'], str) and
                len(user['username']) > 0 and
                user['username'] != 'root' and
                user['username'].isalpha() and
                'deleteAllSSHKeys' in user and
                isinstance(user['deleteAllSSHKeys'], bool) and
                'authorizedKeys' in user and
                isinstance(user['authorizedKeys'], list) and
                len(user['authorizedKeys']) > 0 and
                all(map(lambda akey: isinstance(akey, str) and len(akey) > 0,
                        user['authorizedKeys'])) and
                os.path.isdir(BASE_HOME_DIR + user['username']))
Returns true if a user is of the appropriate format.
Returns true if a user is of the appropriate format.
Returns true if a user is of the appropriate format .
def _check_user(self, user):
        return (isinstance(user, dict) and
                'username' in user and
                isinstance(user['username'], str) and
                len(user['username']) > 0 and
                user['username'] != 'root' and
                user['username'].isalpha() and
                'deleteAllSSHKeys' in user and
                isinstance(user['deleteAllSSHKeys'], bool) and
                'authorizedKeys' in user and
                isinstance(user['authorizedKeys'], list) and
                len(user['authorizedKeys']) > 0 and
                all(map(lambda akey: isinstance(akey, str) and len(akey) > 0,
                        user['authorizedKeys'])) and
                os.path.isdir(BASE_HOME_DIR + user['username']))
def _check_user ( self , user ) : return ( isinstance ( user , dict ) and 'username' in user and isinstance ( user [ 'username' ] , str ) and len ( user [ 'username' ] ) > 0 and user [ 'username' ] != 'root' and user [ 'username' ] . isalpha ( ) and 'deleteAllSSHKeys' in user and isinstance ( user [ 'deleteAllSSHKeys' ] , bool ) and 'authorizedKeys' in user and isinstance ( user [ 'authorizedKeys' ] , list ) and len ( user [ 'authorizedKeys' ] ) > 0 and all ( map ( lambda akey : isinstance ( akey , str ) and len ( akey ) > 0 , user [ 'authorizedKeys' ] ) ) and os . path . isdir ( BASE_HOME_DIR + user [ 'username' ] ) )
Returns true if a user is of the appropriate format.
Returns true if a user is of the appropriate format .
"""Returns true if a user is of the appropriate format."""
self
user