Пример #1
0
    def test_Class_encryption_file(self):

        # setup the GPG key before
        GLSetting.gpgroot = GPGROOT

        tempsource = os.path.join(os.getcwd(), "temp_source.txt")
        with file(tempsource, 'w+') as f1:
            f1.write("\n\nDecrypt the Cat!\n\nhttp://tobtu.com/decryptocat.php\n\n")

            f1.seek(0)

            fake_receiver_desc = {
                'gpg_key_armor': unicode(VALID_PGP_KEY),
                'gpg_key_status': Receiver._gpg_types[1],
                'gpg_key_fingerprint': u"CF4A22020873A76D1DCB68D32B25551568E49345",
                'username': u'*****@*****.**',
                }

            # these are the same lines used in delivery_sched.py
            gpoj = GLBGPG(fake_receiver_desc)
            gpoj.validate_key(VALID_PGP_KEY)
            encrypted_file_path, encrypted_file_size = gpoj.encrypt_file(tempsource, f1, "/tmp")
            gpoj.destroy_environment()

            with file(encrypted_file_path, "r") as f2:
                first_line = f2.readline()

            self.assertSubstring('-----BEGIN PGP MESSAGE-----', first_line)

            with file(encrypted_file_path, "r") as f2:
                whole = f2.read()
            self.assertEqual(encrypted_file_size, len(whole))
Пример #2
0
    def test_Class_encryption_file(self):

        # setup the GPG key before
        GLSetting.gpgroot = GPGROOT

        tempsource = os.path.join(os.getcwd(), "temp_source.txt")
        with file(tempsource, 'w+') as f:
            f.write("\n\nDecrypt the Cat!\n\nhttp://tobtu.com/decryptocat.php\n\n")

            f.seek(0)

            fake_receiver_desc = {
                'gpg_key_armor': unicode(DeveloperKey.__doc__),
                'gpg_key_status': Receiver._gpg_types[1],
                'gpg_key_fingerprint': u"C1ED5C8FDB6A1C74A807569591EC9BB8D9A950DE",
                'username': u'*****@*****.**',
                }

            # these are the same lines used in delivery_sched.py
            gpoj = GLBGPG(fake_receiver_desc)
            gpoj.validate_key(DeveloperKey.__doc__)
            encrypted_file_path, encrypted_file_size = gpoj.encrypt_file(tempsource, f, "/tmp")
            gpoj.destroy_environment()

            with file(encrypted_file_path, "r") as f:
                first_line = f.readline()

            self.assertSubstring('-----BEGIN PGP MESSAGE-----', first_line)

            with file(encrypted_file_path, "r") as f:
                whole = f.read()
            self.assertEqual(encrypted_file_size, len(whole))
Пример #3
0
    def test_Class_encryption_file(self):

        # setup the GPG key before
        GLSetting.gpgroot = GPGROOT

        tempsource = os.path.join(os.getcwd(), "temp_source.txt")
        with file(tempsource, 'w+') as f1:
            f1.write(
                "\n\nDecrypt the Cat!\n\nhttp://tobtu.com/decryptocat.php\n\n")

            f1.seek(0)

            fake_receiver_desc = {
                'gpg_key_armor': unicode(VALID_PGP_KEY),
                'gpg_key_status': Receiver._gpg_types[1],
                'gpg_key_fingerprint':
                u"CF4A22020873A76D1DCB68D32B25551568E49345",
                'username': u'*****@*****.**',
            }

            # these are the same lines used in delivery_sched.py
            gpoj = GLBGPG(fake_receiver_desc)
            gpoj.validate_key(VALID_PGP_KEY)
            encrypted_file_path, encrypted_file_size = gpoj.encrypt_file(
                tempsource, f1, "/tmp")
            gpoj.destroy_environment()

            with file(encrypted_file_path, "r") as f2:
                first_line = f2.readline()

            self.assertSubstring('-----BEGIN PGP MESSAGE-----', first_line)

            with file(encrypted_file_path, "r") as f2:
                whole = f2.read()
            self.assertEqual(encrypted_file_size, len(whole))
Пример #4
0
    def test_Class_encryption_message(self):

        mail_support = MailNotification()

        dummy_template = { "en" : "In %EventTime% you've got a crush for Taryn Southern, yay!!"
                            "more info on: https://www.youtube.com/watch?v=C7JZ4F3zJdY "
                            "and know that you're not alone!" }

        mock_event = Event(type=u'tip', trigger='Tip',
                    notification_settings = dummy_template,
                    trigger_info = {'creation_date': '2013-05-13T17:49:26.105485', 'id': 'useless' },
                    node_info = MockDict().dummyNode,
                    receiver_info = MockDict().dummyReceiver,
                    context_info = MockDict().dummyContext,
                    plugin = MailNotification() )

        mail_content = mail_support.format_template(dummy_template['en'], mock_event)

        # setup the GPG key before
        GLSetting.gpgroot = GPGROOT

        fake_receiver_desc = {
            'gpg_key_armor': unicode(DeveloperKey.__doc__),
            'gpg_key_fingerprint': u"C1ED5C8FDB6A1C74A807569591EC9BB8D9A950DE",
            'gpg_key_status': Receiver._gpg_types[1],
            'username': u'*****@*****.**',
        }

        gpob = GLBGPG(fake_receiver_desc)
        self.assertTrue(gpob.validate_key(DeveloperKey.__doc__))

        encrypted_body = gpob.encrypt_message(mail_content)
        self.assertSubstring('-----BEGIN PGP MESSAGE-----', encrypted_body)
Пример #5
0
def fsops_gpg_encrypt(fpath, recipient_gpg):
    """
    return
        path of encrypted file,
        length of the encrypted file

    this function is used to encrypt a file for a specific recipient.
    commonly 'receiver_desc' is expected as second argument;
    anyhow a simpler dict can be used.

    required keys are checked on top

    """
    assert isinstance(recipient_gpg, dict), "invalid recipient"
    assert recipient_gpg.has_key('gpg_key_armor'), "missing key"
    assert recipient_gpg.has_key('gpg_key_status'), "missing status"
    assert recipient_gpg['gpg_key_status'] == u'Enabled', "GPG not enabled"
    assert recipient_gpg.has_key('name'), "missing recipient Name"

    try:
        gpoj = GLBGPG(recipient_gpg)

        if not gpoj.validate_key(recipient_gpg['gpg_key_armor']):
            raise Exception("Unable to validate key")

        ifile_abs = os.path.join(GLSetting.submission_path, fpath)

        with file(ifile_abs, "r") as f:
            encrypted_file_path, encrypted_file_size = \
                gpoj.encrypt_file(ifile_abs, f, GLSetting.submission_path)

        gpoj.destroy_environment()

        assert encrypted_file_size > 1
        assert os.path.isfile(encrypted_file_path)

        return encrypted_file_path, encrypted_file_size

    except Exception as excep:
        # Yea, please, don't mention protocol downgrade.
        log.err("Error in encrypting %s for %s: fallback in plaintext (%s)" % (
            fpath, recipient_gpg['name'], excep
        ) )
        raise excep
Пример #6
0
    def test_expired_key_error(self):

        self.receiver_only_update['gpg_key_armor'] = unicode(ExpiredKey.__doc__)
        self.receiver_only_update['gpg_key_remove'] = False
        handler = self.request(self.receiver_only_update, role='receiver', user_id=self.dummyReceiver['receiver_gus'])
        yield handler.put()
        self.assertEqual(self.responses[0]['gpg_key_fingerprint'],
            u'C6DAF5B34D5960883C7A9552AACA3A01C2752D4B')

        # ok, now has been imported the key, but we can't perform encryption
        body = ''.join(unichr(x) for x in range(0x370, 0x3FF))
        fake_serialized_receiver = {
            'gpg_key_armor': unicode(ExpiredKey.__doc__),
            'gpg_key_fingerprint': self.responses[0]['gpg_key_fingerprint'],
            'username': u'*****@*****.**',
        }
        gpob = GLBGPG(fake_serialized_receiver)
        self.assertTrue(gpob.validate_key(DeveloperKey.__doc__))
        self.assertRaises(errors.GPGKeyInvalid, gpob.encrypt_message, body)
Пример #7
0
    def test_Class_encryption_message(self):

        dummy_template = {
            "en":
            "In %EventTime% you've got a crush for Taryn Southern, yay!!"
            "more info on: https://www.youtube.com/watch?v=C7JZ4F3zJdY "
            "and know that you're not alone!"
        }

        mock_event = Event(
            type=u'encrypted_tip',
            trigger='Tip',
            notification_settings=dummy_template,
            trigger_info={
                'creation_date': '2013-05-13T17:49:26.105485',  #epoch!
                'id': 'useless',
                'wb_fields': fill_random_fields(self.dummyContext),
            },
            node_info=MockDict().dummyNode,
            receiver_info=MockDict().dummyReceiver,
            context_info=MockDict().dummyContext,
            plugin=MailNotification(),
            trigger_parent={})

        mail_content = Templating().format_template(dummy_template, mock_event)

        # setup the GPG key before
        GLSetting.gpgroot = GPGROOT

        fake_receiver_desc = {
            'gpg_key_armor': unicode(VALID_PGP_KEY),
            'gpg_key_fingerprint': u"CF4A22020873A76D1DCB68D32B25551568E49345",
            'gpg_key_status': Receiver._gpg_types[1],
            'username': u'*****@*****.**',
        }

        gpob = GLBGPG(fake_receiver_desc)
        self.assertTrue(gpob.validate_key(VALID_PGP_KEY))

        encrypted_body = gpob.encrypt_message(mail_content)
        self.assertSubstring('-----BEGIN PGP MESSAGE-----', encrypted_body)
Пример #8
0
    def test_expired_key_error(self):

        self.receiver_only_update['gpg_key_armor'] = unicode(
            ExpiredKey.__doc__)
        self.receiver_only_update['gpg_key_remove'] = False
        handler = self.request(self.receiver_only_update,
                               role='receiver',
                               user_id=self.dummyReceiver_1['id'])
        yield handler.put()
        self.assertEqual(self.responses[0]['gpg_key_fingerprint'],
                         u'C6DAF5B34D5960883C7A9552AACA3A01C2752D4B')

        # ok, now has been imported the key, but we can't perform encryption
        body = ''.join(unichr(x) for x in range(0x370, 0x3FF))
        fake_serialized_receiver = {
            'gpg_key_armor': unicode(ExpiredKey.__doc__),
            'gpg_key_fingerprint': self.responses[0]['gpg_key_fingerprint'],
            'username': u'*****@*****.**',
        }
        gpob = GLBGPG(fake_serialized_receiver)
        self.assertTrue(gpob.validate_key(VALID_PGP_KEY))
        self.assertRaises(errors.GPGKeyInvalid, gpob.encrypt_message, body)
Пример #9
0
    def pgp_validation_check(self, store):

        rcvrs = store.find(Receiver)

        for rcvr in rcvrs:

            fake_receiver_dict = {'username': rcvr.user.username}

            gnob = GLBGPG(fake_receiver_dict)

            if rcvr.gpg_key_armor and gnob.validate_key(rcvr.gpg_key_armor):
                rcvr.gpg_key_info = gnob.keyinfo
                rcvr.gpg_key_fingerprint = gnob.fingerprint
                rcvr.gpg_key_status = u'Enabled'
                rcvr.gpg_enable_notification = True
            else:
                rcvr.gpg_key_info = None
                rcvr.gpg_key_fingerprint = None
                rcvr.gpg_key_status = u'Disabled'
                rcvr.gpg_key_armor = None
                rcvr.gpg_enable_notification = False

            gnob.destroy_environment()
Пример #10
0
    def test_Class_encryption_message(self):

        dummy_template = "In %EventTime% you've got a crush for Taryn Southern, yay!! \
                         more info on: https://www.youtube.com/watch?v=C7JZ4F3zJdY \
                         and know that you're not alone!"

        mock_event = Event(type=u'encrypted_tip', trigger='Tip',
                    notification_settings = dummy_template,
                    trigger_info = {
                        'creation_date': '2013-05-13T17:49:26.105485', #epoch!
                        'id': 'useless',
                        'wb_steps' : fill_random_fields(self.dummyContext['id']),
                    },
                    node_info = MockDict().dummyNode,
                    receiver_info = MockDict().dummyReceiver,
                    context_info = MockDict().dummyContext,
                    steps_info = {},
                    plugin = MailNotification(),
                    trigger_parent = {} )

        mail_content = Templating().format_template(dummy_template, mock_event)

        # setup the GPG key before
        GLSetting.gpgroot = GPGROOT

        fake_receiver_desc = {
            'gpg_key_armor': unicode(VALID_PGP_KEY),
            'gpg_key_fingerprint': u"CF4A22020873A76D1DCB68D32B25551568E49345",
            'gpg_key_status': Receiver._gpg_types[1],
            'username': u'*****@*****.**',
        }

        gpob = GLBGPG(fake_receiver_desc)
        self.assertTrue(gpob.validate_key(VALID_PGP_KEY))

        encrypted_body = gpob.encrypt_message(mail_content)
        self.assertSubstring('-----BEGIN PGP MESSAGE-----', encrypted_body)
Пример #11
0
def fsops_gpg_encrypt(fpath, recipient_gpg):
    """
    return
        path of encrypted file,
        length of the encrypted file

    this function is used to encrypt a file for a specific recipient.
    commonly 'receiver_desc' is expected as second argument;
    anyhow a simpler dict can be used.

    required keys are checked on top

    """
    assert isinstance(recipient_gpg, dict), "invalid recipient"
    assert recipient_gpg.has_key('gpg_key_armor'), "missing key"
    assert recipient_gpg.has_key('gpg_key_status'), "missing status"
    assert recipient_gpg['gpg_key_status'] == u'Enabled', "GPG not enabled"
    assert recipient_gpg.has_key('name'), "missing recipient Name"

    gpoj = GLBGPG(recipient_gpg)

    if not gpoj.validate_key(recipient_gpg['gpg_key_armor']):
        raise Exception("Unable to validate key")

    filepath = os.path.join(GLSetting.submission_path, fpath)

    with GLSecureFile(filepath) as f:
        encrypted_file_path, encrypted_file_size = \
            gpoj.encrypt_file(filepath, f, GLSetting.submission_path)

    gpoj.destroy_environment()

    assert (encrypted_file_size > 1), "File generated is empty or size is 0"
    assert os.path.isfile(
        encrypted_file_path), "Output generated is not a file!"

    return encrypted_file_path, encrypted_file_size
Пример #12
0
def fsops_gpg_encrypt(fpath, recipient_gpg):
    """
    return
        path of encrypted file,
        length of the encrypted file

    this function is used to encrypt a file for a specific recipient.
    commonly 'receiver_desc' is expected as second argument;
    anyhow a simpler dict can be used.

    required keys are checked on top

    """
    assert isinstance(recipient_gpg, dict), "invalid recipient"
    assert recipient_gpg.has_key('gpg_key_armor'), "missing key"
    assert recipient_gpg.has_key('gpg_key_status'), "missing status"
    assert recipient_gpg['gpg_key_status'] == u'Enabled', "GPG not enabled"
    assert recipient_gpg.has_key('name'), "missing recipient Name"

    gpoj = GLBGPG(recipient_gpg)

    if not gpoj.validate_key(recipient_gpg['gpg_key_armor']):
        raise Exception("Unable to validate key")

    filepath = os.path.join(GLSetting.submission_path, fpath)

    with GLSecureFile(filepath) as f:
        encrypted_file_path, encrypted_file_size = \
            gpoj.encrypt_file(filepath, f, GLSetting.submission_path)

    gpoj.destroy_environment()

    assert (encrypted_file_size > 1), "File generated is empty or size is 0"
    assert os.path.isfile(encrypted_file_path), "Output generated is not a file!"

    return encrypted_file_path, encrypted_file_size
Пример #13
0
    def do_notify(self, event):

        # check if exists the conf
        if not self.validate_admin_opt(event.notification_settings):
            log.info('invalid configuration for admin email!')
            return None

        # At the moment the language used is a system language, not
        # Receiver preferences language ?
        if event.type == u'encrypted_tip':
            body = Templating().format_template(
                event.notification_settings['encrypted_tip_template'], event)
            title = Templating().format_template(
                event.notification_settings['encrypted_tip_mail_title'], event)
        elif event.type == u'plaintext_tip':
            body = Templating().format_template(
                event.notification_settings['plaintext_tip_template'], event)
            title = Templating().format_template(
                event.notification_settings['plaintext_tip_mail_title'], event)
        elif event.type == u'encrypted_file':
            body = Templating().format_template(
                event.notification_settings['encrypted_file_template'], event)
            title = Templating().format_template(
                event.notification_settings['encrypted_file_mail_title'],
                event)
        elif event.type == u'plaintext_file':
            body = Templating().format_template(
                event.notification_settings['plaintext_file_template'], event)
            title = Templating().format_template(
                event.notification_settings['plaintext_file_mail_title'],
                event)
        elif event.type == u'encrypted_comment':
            body = Templating().format_template(
                event.notification_settings['encrypted_comment_template'],
                event)
            title = Templating().format_template(
                event.notification_settings['encrypted_comment_mail_title'],
                event)
        elif event.type == u'plaintext_comment':
            body = Templating().format_template(
                event.notification_settings['plaintext_comment_template'],
                event)
            title = Templating().format_template(
                event.notification_settings['plaintext_comment_mail_title'],
                event)
        elif event.type == u'encrypted_message':
            body = Templating().format_template(
                event.notification_settings['encrypted_message_template'],
                event)
            title = Templating().format_template(
                event.notification_settings['encrypted_message_mail_title'],
                event)
        elif event.type == u'plaintext_message':
            body = Templating().format_template(
                event.notification_settings['plaintext_message_template'],
                event)
            title = Templating().format_template(
                event.notification_settings['plaintext_message_mail_title'],
                event)
        else:
            raise NotImplementedError("At the moment, only Tip expected")

        # If the receiver has encryption enabled (for notification), encrypt the mail body
        if event.receiver_info['gpg_key_status'] == Receiver._gpg_types[1] and \
           event.receiver_info['gpg_enable_notification']:

            try:
                gpob = GLBGPG(event.receiver_info)

                if not gpob.validate_key(event.receiver_info['gpg_key_armor']):
                    log.err("unable to validated GPG key for receiver %s" %
                            event.receiver_info['username'])
                    return None

                body = gpob.encrypt_message(body)
                gpob.destroy_environment()

            except Exception as excep:
                log.err(
                    "Error in GPG interface object (for %s: %s)! (notification+encryption)"
                    % (event.receiver_info['username'], str(excep)))
                return None

        receiver_mail = event.receiver_info['mail_address']

        # XXX here can be catch the subject (may change if encrypted or whatever)
        message = MIME_mail_build(GLSetting.memory_copy.notif_source_name,
                                  GLSetting.memory_copy.notif_source_email,
                                  event.receiver_info['name'], receiver_mail,
                                  title, body)

        if not message:
            log.err("Unable to format (and then notify!) email for %s" %
                    receiver_mail)
            log.debug(body)
            return None

        self.finished = self.mail_flush(
            event.notification_settings['source_email'], [receiver_mail],
            message, event)

        return self.finished
Пример #14
0
    def do_notify(self, event):

        # check if exists the conf
        if not self.validate_admin_opt(event.notification_settings):
            log.info('invalid configuration for admin email!')
            return None

        # At the moment the language used is a system language, not
        # Receiver preferences language ?
        if event.type == u'tip':
            body = self.format_template(
                event.notification_settings['tip_template'], event)
            title = self.format_template(
                event.notification_settings['tip_mail_title'], event)
        elif event.type == u'comment':
            body = self.format_template(
                event.notification_settings['comment_template'], event)
            title = self.format_template(
                event.notification_settings['comment_mail_title'], event)
        elif event.type == u'file':
            body = self.format_template(
                event.notification_settings['file_template'], event)
            title = self.format_template(
                event.notification_settings['file_mail_title'], event)
        else:
            raise NotImplementedError("At the moment, only Tip expected")

        # If the receiver has encryption enabled (for notification), encrypt the mail body
        if event.receiver_info['gpg_key_status'] == Receiver._gpg_types[1] and \
           event.receiver_info['gpg_enable_notification']:

            try:
                gpob = GLBGPG(event.receiver_info)

                if not gpob.validate_key(event.receiver_info['gpg_key_armor']):
                    log.err("unable to validated GPG key for receiver %s" %
                            event.receiver_info['username'])
                    return None

                body = gpob.encrypt_message(body)
                gpob.destroy_environment()

            except Exception as excep:
                log.err("Error in GPG interface object (for %s: %s)! (notification+encryption)" %
                        (event.receiver_info['username'], str(excep) ))
                return None

        receiver_mail = event.receiver_info['notification_fields']['mail_address']

        # Compose the email having the system+subject+recipient data
        mail_building = ["Date: %s" % rfc822_date(),
                         "From: \"%s\" <%s>" % (
                             GLSetting.memory_copy.notif_source_name,
                             GLSetting.memory_copy.notif_source_email ),
                         "To: %s" % receiver_mail,
                         "Subject: %s" % title,
                         "Content-Type: text/plain; charset=ISO-8859-1",
                         "Content-Transfer-Encoding: 8bit",
                         None,
                         body]

        # XXX here can be catch the subject (may change if encrypted or whatever)

        # appending 'None' it's used to mean "\n" without being escaped by collapse_mail_content

        message = collapse_mail_content(mail_building)

        if not message:
            log.err("Unable to format (and then notify!) email for %s" % receiver_mail)
            log.debug(mail_building)
            return None

        self.finished = self.mail_flush(event.notification_settings['source_email'],
                                        [ receiver_mail ], message, event)

        return self.finished
Пример #15
0
    def do_notify(self, event):

        # check if exists the conf
        if not self.validate_admin_opt(event.notification_settings):
            log.info('invalid configuration for admin email!')
            return None

        # At the moment the language used is a system language, not
        # Receiver preferences language ?
        if event.type == u'encrypted_tip':
            body = Templating().format_template(
                event.notification_settings['encrypted_tip_template'], event)
            title = Templating().format_template(
                event.notification_settings['encrypted_tip_mail_title'], event)
        elif event.type == u'plaintext_tip':
            body = Templating().format_template(
                event.notification_settings['plaintext_tip_template'], event)
            title = Templating().format_template(
                event.notification_settings['plaintext_tip_mail_title'], event)
        elif event.type == u'encrypted_file':
            body = Templating().format_template(
                event.notification_settings['encrypted_file_template'], event)
            title = Templating().format_template(
                event.notification_settings['encrypted_file_mail_title'], event)
        elif event.type == u'plaintext_file':
            body = Templating().format_template(
                event.notification_settings['plaintext_file_template'], event)
            title = Templating().format_template(
                event.notification_settings['plaintext_file_mail_title'], event)
        elif event.type == u'encrypted_comment':
            body = Templating().format_template(
                event.notification_settings['encrypted_comment_template'], event)
            title = Templating().format_template(
                event.notification_settings['encrypted_comment_mail_title'], event)
        elif event.type == u'plaintext_comment':
            body = Templating().format_template(
                event.notification_settings['plaintext_comment_template'], event)
            title = Templating().format_template(
                event.notification_settings['plaintext_comment_mail_title'], event)
        elif event.type == u'encrypted_message':
            body = Templating().format_template(
                event.notification_settings['encrypted_message_template'], event)
            title = Templating().format_template(
                event.notification_settings['encrypted_message_mail_title'], event)
        elif event.type == u'plaintext_message':
            body = Templating().format_template(
                event.notification_settings['plaintext_message_template'], event)
            title = Templating().format_template(
                event.notification_settings['plaintext_message_mail_title'], event)
        else:
            raise NotImplementedError("At the moment, only Tip expected")

        # If the receiver has encryption enabled (for notification), encrypt the mail body
        if event.receiver_info['gpg_key_status'] == Receiver._gpg_types[1] and \
           event.receiver_info['gpg_enable_notification']:

            try:
                gpob = GLBGPG(event.receiver_info)

                if not gpob.validate_key(event.receiver_info['gpg_key_armor']):
                    log.err("unable to validated GPG key for receiver %s" %
                            event.receiver_info['username'])
                    return None

                body = gpob.encrypt_message(body)
                gpob.destroy_environment()

            except Exception as excep:
                log.err("Error in GPG interface object (for %s: %s)! (notification+encryption)" %
                        (event.receiver_info['username'], str(excep) ))
                return None

        receiver_mail = event.receiver_info['mail_address']

        # XXX here can be catch the subject (may change if encrypted or whatever)
        message = MIME_mail_build(GLSetting.memory_copy.notif_source_name,
                                  GLSetting.memory_copy.notif_source_email,
                                  event.receiver_info['name'],
                                  receiver_mail,
                                  title,
                                  body)

        if not message:
            log.err("Unable to format (and then notify!) email for %s" % receiver_mail)
            log.debug(body)
            return None

        self.finished = self.mail_flush(event.notification_settings['source_email'],
                                        [ receiver_mail ], message, event)

        return self.finished