)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"b996c314a613c0a626f5a1826efdbff1783ecae7","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kota Tsuyuzaki \u003ctsuyuzaki.kota@lab.ntt.co.jp\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-07-21 01:57:04 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Raise ValueError if empty value comming into encrypt_header_val"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"encrypt_header_val is used to translate a raw header value into a"},{"line_number":10,"context_line":"encrypted value. Semantically, a header with an empty value won\u0027t be stored"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"dada55a8_d659aa8f","line":7,"range":{"start_line":7,"start_character":32,"end_line":7,"end_character":39},"updated":"2016-07-21 09:13:46.000000000","message":"coming","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"40ea07800d5686ba6c06e4604e5af45ea1cfcdd1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kota Tsuyuzaki \u003ctsuyuzaki.kota@lab.ntt.co.jp\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-07-21 01:57:04 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Raise ValueError if empty value comming into encrypt_header_val"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"encrypt_header_val is used to translate a raw header value into a"},{"line_number":10,"context_line":"encrypted value. Semantically, a header with an empty value won\u0027t be stored"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"dada55a8_8a6422b9","line":7,"range":{"start_line":7,"start_character":32,"end_line":7,"end_character":39},"in_reply_to":"dada55a8_d659aa8f","updated":"2016-07-21 09:27:24.000000000","message":"Done","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"b996c314a613c0a626f5a1826efdbff1783ecae7","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Raise ValueError if empty value comming into encrypt_header_val"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"encrypt_header_val is used to translate a raw header value into a"},{"line_number":10,"context_line":"encrypted value. Semantically, a header with an empty value won\u0027t be stored"},{"line_number":11,"context_line":"and all callers seem to remove such a header before calling"},{"line_number":12,"context_line":"encrypted_header_val. (e.g. [1])"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"dada55a8_f652ee65","line":9,"range":{"start_line":9,"start_character":64,"end_line":9,"end_character":65},"updated":"2016-07-21 09:13:46.000000000","message":"an","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"40ea07800d5686ba6c06e4604e5af45ea1cfcdd1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Raise ValueError if empty value comming into encrypt_header_val"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"encrypt_header_val is used to translate a raw header value into a"},{"line_number":10,"context_line":"encrypted value. Semantically, a header with an empty value won\u0027t be stored"},{"line_number":11,"context_line":"and all callers seem to remove such a header before calling"},{"line_number":12,"context_line":"encrypted_header_val. (e.g. [1])"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"dada55a8_ea579ec7","line":9,"range":{"start_line":9,"start_character":64,"end_line":9,"end_character":65},"in_reply_to":"dada55a8_f652ee65","updated":"2016-07-21 09:27:24.000000000","message":"Done","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"590e6fb032ece4bda56f319cf9b7a25a1b87983e","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Plus this patch addes a few unit tests for those cases above."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"1: https://github.com/openstack/swift/blob/master/swift/common/middleware/crypto/encrypter.py#L211-L212"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ic1237f4afb8c0e466be5ce59fe31b667c39242b0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_d8cd4b67","line":20,"updated":"2016-07-21 12:22:54.000000000","message":"maybe split into two lines? Or remove it entirely, since with future changes in code, these reference lines will not be the same anymore.","commit_id":"3e5ef0d7531d818bd2a36e0c8d9f0e8e1c3f7574"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f07051e9c6356448028633543ac30f12a6380bbe","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Plus this patch addes a few unit tests for those cases above."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"1: https://github.com/openstack/swift/blob/master/swift/common/middleware/crypto/encrypter.py#L211-L212"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ic1237f4afb8c0e466be5ce59fe31b667c39242b0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_a0daba14","line":20,"in_reply_to":"dada55a8_d8cd4b67","updated":"2016-07-22 00:59:00.000000000","message":"Done","commit_id":"3e5ef0d7531d818bd2a36e0c8d9f0e8e1c3f7574"}],"swift/common/middleware/crypto/encrypter.py":[{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"b996c314a613c0a626f5a1826efdbff1783ecae7","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    :param crypto: a Crypto instance"},{"line_number":37,"context_line":"    :param value: value to encrypt"},{"line_number":38,"context_line":"    :param key: crypto key to use"},{"line_number":39,"context_line":"    :returns: a tuple of (encrypted value, crypto_meta) where crypto_meta is a"},{"line_number":40,"context_line":"        dict of form returned by"},{"line_number":41,"context_line":"        :py:func:`~swift.common.middleware.crypto.Crypto.get_crypto_meta`"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    if not value:"},{"line_number":44,"context_line":"        raise ValueError(\u0027empty value is not acceptable\u0027)"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_769b9e18","line":42,"range":{"start_line":39,"start_character":4,"end_line":42,"end_character":4},"updated":"2016-07-21 09:13:46.000000000","message":"Should add the fact to docstring that method can now raise an error.","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"40ea07800d5686ba6c06e4604e5af45ea1cfcdd1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    :param crypto: a Crypto instance"},{"line_number":37,"context_line":"    :param value: value to encrypt"},{"line_number":38,"context_line":"    :param key: crypto key to use"},{"line_number":39,"context_line":"    :returns: a tuple of (encrypted value, crypto_meta) where crypto_meta is a"},{"line_number":40,"context_line":"        dict of form returned by"},{"line_number":41,"context_line":"        :py:func:`~swift.common.middleware.crypto.Crypto.get_crypto_meta`"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    if not value:"},{"line_number":44,"context_line":"        raise ValueError(\u0027empty value is not acceptable\u0027)"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_4a718a43","line":42,"range":{"start_line":39,"start_character":4,"end_line":42,"end_character":4},"in_reply_to":"dada55a8_769b9e18","updated":"2016-07-21 09:27:24.000000000","message":"Done","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"b996c314a613c0a626f5a1826efdbff1783ecae7","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        :py:func:`~swift.common.middleware.crypto.Crypto.get_crypto_meta`"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    if not value:"},{"line_number":44,"context_line":"        raise ValueError(\u0027empty value is not acceptable\u0027)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    crypto_meta \u003d crypto.create_crypto_meta()"},{"line_number":47,"context_line":"    crypto_ctxt \u003d crypto.create_encryption_ctxt(key, crypto_meta[\u0027iv\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_96f1f26d","line":44,"range":{"start_line":44,"start_character":25,"end_line":44,"end_character":56},"updated":"2016-07-21 09:13:46.000000000","message":"A more detailed message would be good. And what about translations?","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"84fd767586fb308354aece4ce11f1e1ea17cf3cd","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        :py:func:`~swift.common.middleware.crypto.Crypto.get_crypto_meta`"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    if not value:"},{"line_number":44,"context_line":"        raise ValueError(\u0027empty value is not acceptable\u0027)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    crypto_meta \u003d crypto.create_crypto_meta()"},{"line_number":47,"context_line":"    crypto_ctxt \u003d crypto.create_encryption_ctxt(key, crypto_meta[\u0027iv\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_207b97c2","line":44,"range":{"start_line":44,"start_character":25,"end_line":44,"end_character":56},"in_reply_to":"dada55a8_6a772e02","updated":"2016-07-21 10:01:34.000000000","message":"I thought about on how this string literal is translated, and maybe should add to the language files too. But if you think that it never comes to the user, then fine.","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"40ea07800d5686ba6c06e4604e5af45ea1cfcdd1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        :py:func:`~swift.common.middleware.crypto.Crypto.get_crypto_meta`"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    if not value:"},{"line_number":44,"context_line":"        raise ValueError(\u0027empty value is not acceptable\u0027)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    crypto_meta \u003d crypto.create_crypto_meta()"},{"line_number":47,"context_line":"    crypto_ctxt \u003d crypto.create_encryption_ctxt(key, crypto_meta[\u0027iv\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_6a772e02","line":44,"range":{"start_line":44,"start_character":25,"end_line":44,"end_character":56},"in_reply_to":"dada55a8_96f1f26d","updated":"2016-07-21 09:27:24.000000000","message":"Sorry, what does \"what about translation\" mean?\n\nI think this Exception is just for safety in the future regression so I don\u0027t have better idea to make detailed message than this right now. Do you have any good idea?","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0ceeddbf8471fbd133ab482e6705bb6aa8861d25","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        \"\"\""},{"line_number":217,"context_line":"        prefix \u003d get_object_transient_sysmeta(\u0027crypto-meta-\u0027)"},{"line_number":218,"context_line":"        user_meta_headers \u003d [h for h in req.headers.items() if"},{"line_number":219,"context_line":"                             is_user_meta(self.server_type, h[0]) and h[1]]"},{"line_number":220,"context_line":"        crypto_meta \u003d None"},{"line_number":221,"context_line":"        for name, val in user_meta_headers:"},{"line_number":222,"context_line":"            short_name \u003d strip_user_meta_prefix(self.server_type, name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_0751e90e","line":219,"range":{"start_line":219,"start_character":66,"end_line":219,"end_character":74},"updated":"2016-07-22 20:25:19.000000000","message":"Right, so the user meta definitely won\u0027t trip the ValueError. Good.","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"}],"test/unit/common/middleware/crypto/test_encrypter.py":[{"author":{"_account_id":21239,"name":"Alex Szarka","email":"szarka@inf.u-szeged.hu","username":"xavvior"},"change_message_id":"f7f3c29d324637e0702f8cda2834a1faeaf7005d","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        self.assertEqual(FakeAppThatExcepts.MESSAGE, catcher.exception.body)"},{"line_number":818,"context_line":""},{"line_number":819,"context_line":"    def test_encrypt_header_val(self):"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        def get_encrypted_val(value):"},{"line_number":822,"context_line":"            crypto \u003d Crypto({})"},{"line_number":823,"context_line":"            root_secret \u003d base64.b64encode(\u0027a\u0027 * 32)"},{"line_number":824,"context_line":"            # set lambda instead of real app because"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_ef52bddc","line":821,"range":{"start_line":820,"start_character":0,"end_line":821,"end_character":2},"updated":"2016-07-04 07:10:59.000000000","message":"Please remove the empty line","commit_id":"9ec8b5be49c9b00a8931ed27185b76dacbc6b26f"},{"author":{"_account_id":21239,"name":"Alex Szarka","email":"szarka@inf.u-szeged.hu","username":"xavvior"},"change_message_id":"74bcbf95fe34fb2691a8b9cb53745bafae3afd9b","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        self.assertEqual(FakeAppThatExcepts.MESSAGE, catcher.exception.body)"},{"line_number":818,"context_line":""},{"line_number":819,"context_line":"    def test_encrypt_header_val(self):"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        def get_encrypted_val(value):"},{"line_number":822,"context_line":"            crypto \u003d Crypto({})"},{"line_number":823,"context_line":"            root_secret \u003d base64.b64encode(\u0027a\u0027 * 32)"},{"line_number":824,"context_line":"            # set lambda instead of real app because"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_3e9a3115","line":821,"range":{"start_line":820,"start_character":0,"end_line":821,"end_character":2},"in_reply_to":"1aa78d24_cf954141","updated":"2016-07-04 09:09:08.000000000","message":"Thank you. If the Jenkins give -1, then sorry. But it seems more nice.","commit_id":"9ec8b5be49c9b00a8931ed27185b76dacbc6b26f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"44f59615759006395839dac2e36c48288e0620a3","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        self.assertEqual(FakeAppThatExcepts.MESSAGE, catcher.exception.body)"},{"line_number":818,"context_line":""},{"line_number":819,"context_line":"    def test_encrypt_header_val(self):"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        def get_encrypted_val(value):"},{"line_number":822,"context_line":"            crypto \u003d Crypto({})"},{"line_number":823,"context_line":"            root_secret \u003d base64.b64encode(\u0027a\u0027 * 32)"},{"line_number":824,"context_line":"            # set lambda instead of real app because"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_cf954141","line":821,"range":{"start_line":820,"start_character":0,"end_line":821,"end_character":2},"in_reply_to":"1aa78d24_ef52bddc","updated":"2016-07-04 07:15:53.000000000","message":"Done. I think it\u0027s ok to add an empty line though.","commit_id":"9ec8b5be49c9b00a8931ed27185b76dacbc6b26f"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"34ab8c08174ddc1af9aa089a2b43e9c209c74f4b","unresolved":false,"context_lines":[{"line_number":835,"context_line":""},{"line_number":836,"context_line":"        # normal string can be crypted"},{"line_number":837,"context_line":"        crypted_val, crypt_info \u003d get_encrypted_val(\u0027aaa\u0027)"},{"line_number":838,"context_line":"        self.assertEqual(\u0027jal8\u0027, crypted_val)"},{"line_number":839,"context_line":"        self.assertEqual(expected_crypt_info, crypt_info)"},{"line_number":840,"context_line":""},{"line_number":841,"context_line":"        # empty string can return (\u0027\u0027, None)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_0cae2a85","line":838,"updated":"2016-07-04 11:19:07.000000000","message":"why not use encrypt helper function to assert like here - https://github.com/openstack/swift/blob/master/test/unit/common/middleware/crypto/test_encrypter.py#L60","commit_id":"c8ce0b9ec7812f3b141c6f6f8c663a0ab6c412e6"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"278c53a4105adf8459a5a0c19fc49a9e49c4075a","unresolved":false,"context_lines":[{"line_number":835,"context_line":""},{"line_number":836,"context_line":"        # normal string can be crypted"},{"line_number":837,"context_line":"        crypted_val, crypt_info \u003d get_encrypted_val(\u0027aaa\u0027)"},{"line_number":838,"context_line":"        self.assertEqual(\u0027jal8\u0027, crypted_val)"},{"line_number":839,"context_line":"        self.assertEqual(expected_crypt_info, crypt_info)"},{"line_number":840,"context_line":""},{"line_number":841,"context_line":"        # empty string can return (\u0027\u0027, None)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_7b3267a8","line":838,"in_reply_to":"1aa78d24_0cae2a85","updated":"2016-07-21 08:56:28.000000000","message":"Done","commit_id":"c8ce0b9ec7812f3b141c6f6f8c663a0ab6c412e6"},{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"b996c314a613c0a626f5a1826efdbff1783ecae7","unresolved":false,"context_lines":[{"line_number":908,"context_line":"        self.assertEqual(expected_crypt_info, crypt_info)"},{"line_number":909,"context_line":""},{"line_number":910,"context_line":"        # empty string raises a ValueError for safety"},{"line_number":911,"context_line":"        with self.assertRaises(ValueError):"},{"line_number":912,"context_line":"            get_encrypted_val(\u0027\u0027)"},{"line_number":913,"context_line":""},{"line_number":914,"context_line":""},{"line_number":915,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_ea567e04","line":912,"range":{"start_line":911,"start_character":8,"end_line":912,"end_character":33},"updated":"2016-07-21 09:13:46.000000000","message":"I think in this case using only self.assertRaises(ValueError, get_encrypted_val, \u0027\u0027) or something like this. As you don\u0027t want to use that raised error, only want to check if it\u0027s get raised.","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"40ea07800d5686ba6c06e4604e5af45ea1cfcdd1","unresolved":false,"context_lines":[{"line_number":908,"context_line":"        self.assertEqual(expected_crypt_info, crypt_info)"},{"line_number":909,"context_line":""},{"line_number":910,"context_line":"        # empty string raises a ValueError for safety"},{"line_number":911,"context_line":"        with self.assertRaises(ValueError):"},{"line_number":912,"context_line":"            get_encrypted_val(\u0027\u0027)"},{"line_number":913,"context_line":""},{"line_number":914,"context_line":""},{"line_number":915,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_cad3bad3","line":912,"range":{"start_line":911,"start_character":8,"end_line":912,"end_character":33},"in_reply_to":"dada55a8_ea567e04","updated":"2016-07-21 09:27:24.000000000","message":"Ah, just a missing for message check. Will add one more assertion using the context.","commit_id":"15428fd6cef5e4d0b9af18f1a78e371badc9daa9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"efea5db58c26a593bfda3b029fb00e1e85aaa385","unresolved":false,"context_lines":[{"line_number":888,"context_line":"        # this test only needs create_key method"},{"line_number":889,"context_line":"        key_master \u003d KeyMaster("},{"line_number":890,"context_line":"            lambda: None, {\u0027encryption_root_secret\u0027: root_secret})"},{"line_number":891,"context_line":"        key \u003d key_master.create_key(\u0027/a/c/o\u0027)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"        def get_encrypted_val(value):"},{"line_number":894,"context_line":"            crypto \u003d Crypto({})"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_b48f7bcb","line":891,"updated":"2016-07-22 16:08:12.000000000","message":"you can use the helper fetch_crypto_keys()[\u0027object\u0027] which is simpler and avoids depending on the KeyMaster in these unit tests","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b5cde015e7616240fda9cc6ec378d373f6e613dc","unresolved":false,"context_lines":[{"line_number":888,"context_line":"        # this test only needs create_key method"},{"line_number":889,"context_line":"        key_master \u003d KeyMaster("},{"line_number":890,"context_line":"            lambda: None, {\u0027encryption_root_secret\u0027: root_secret})"},{"line_number":891,"context_line":"        key \u003d key_master.create_key(\u0027/a/c/o\u0027)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"        def get_encrypted_val(value):"},{"line_number":894,"context_line":"            crypto \u003d Crypto({})"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_ba2a988e","line":891,"in_reply_to":"dada55a8_b48f7bcb","updated":"2016-07-25 02:07:53.000000000","message":"Nice, it\u0027s good to know. Thanks :-)","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"efea5db58c26a593bfda3b029fb00e1e85aaa385","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        key \u003d key_master.create_key(\u0027/a/c/o\u0027)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"        def get_encrypted_val(value):"},{"line_number":894,"context_line":"            crypto \u003d Crypto({})"},{"line_number":895,"context_line":"            encrypted \u003d encrypter.encrypt_header_val(crypto, value, key)"},{"line_number":896,"context_line":"            # sanity: return value is 2 item tuple"},{"line_number":897,"context_line":"            self.assertEqual(2, len(encrypted))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_14300707","line":894,"updated":"2016-07-22 16:08:12.000000000","message":"nit: {} is not necessary - the arg has a default","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b5cde015e7616240fda9cc6ec378d373f6e613dc","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        key \u003d key_master.create_key(\u0027/a/c/o\u0027)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"        def get_encrypted_val(value):"},{"line_number":894,"context_line":"            crypto \u003d Crypto({})"},{"line_number":895,"context_line":"            encrypted \u003d encrypter.encrypt_header_val(crypto, value, key)"},{"line_number":896,"context_line":"            # sanity: return value is 2 item tuple"},{"line_number":897,"context_line":"            self.assertEqual(2, len(encrypted))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_fabed062","line":894,"in_reply_to":"dada55a8_14300707","updated":"2016-07-25 02:07:53.000000000","message":"Done","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"efea5db58c26a593bfda3b029fb00e1e85aaa385","unresolved":false,"context_lines":[{"line_number":909,"context_line":""},{"line_number":910,"context_line":"        # empty string raises a ValueError for safety"},{"line_number":911,"context_line":"        with self.assertRaises(ValueError) as cm:"},{"line_number":912,"context_line":"            get_encrypted_val(\u0027\u0027)"},{"line_number":913,"context_line":""},{"line_number":914,"context_line":"        self.assertEqual(\u0027empty value is not acceptable\u0027,"},{"line_number":915,"context_line":"                         cm.exception.message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_cf3376f5","line":912,"updated":"2016-07-22 16:08:12.000000000","message":"it would be clearer to just call encrypt_header_val here:\n\n  with self.assertRaises(ValueError) as cm:\n      encrypter.encrypt_header_val(Crypto(), \u0027\u0027, key)","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b5cde015e7616240fda9cc6ec378d373f6e613dc","unresolved":false,"context_lines":[{"line_number":909,"context_line":""},{"line_number":910,"context_line":"        # empty string raises a ValueError for safety"},{"line_number":911,"context_line":"        with self.assertRaises(ValueError) as cm:"},{"line_number":912,"context_line":"            get_encrypted_val(\u0027\u0027)"},{"line_number":913,"context_line":""},{"line_number":914,"context_line":"        self.assertEqual(\u0027empty value is not acceptable\u0027,"},{"line_number":915,"context_line":"                         cm.exception.message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_1d9bdeca","line":912,"in_reply_to":"dada55a8_cf3376f5","updated":"2016-07-25 02:07:53.000000000","message":"Done","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"efea5db58c26a593bfda3b029fb00e1e85aaa385","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"        self.assertEqual(\u0027empty value is not acceptable\u0027,"},{"line_number":915,"context_line":"                         cm.exception.message)"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":""},{"line_number":918,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":919,"context_line":"    unittest.main()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_4fa4a607","line":916,"updated":"2016-07-22 16:08:12.000000000","message":"could we add a test for value\u003dNone?","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b5cde015e7616240fda9cc6ec378d373f6e613dc","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"        self.assertEqual(\u0027empty value is not acceptable\u0027,"},{"line_number":915,"context_line":"                         cm.exception.message)"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":""},{"line_number":918,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":919,"context_line":"    unittest.main()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dada55a8_fd9d2abc","line":916,"in_reply_to":"dada55a8_4fa4a607","updated":"2016-07-25 02:07:53.000000000","message":"Exactly, done","commit_id":"24ee9b8ba0cf199abd8193f95289b99adfe6a2ab"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"792d37b4a10e3ba7cbfdeb93b9bb7ef81e98547a","unresolved":false,"context_lines":[{"line_number":885,"context_line":"        # Prepare key and Crypto instance"},{"line_number":886,"context_line":"        object_key \u003d fetch_crypto_keys()[\u0027object\u0027]"},{"line_number":887,"context_line":""},{"line_number":888,"context_line":"        # - Normal string can be crypted"},{"line_number":889,"context_line":"        encrypted \u003d encrypter.encrypt_header_val(Crypto(), \u0027aaa\u0027, object_key)"},{"line_number":890,"context_line":"        # sanity: return value is 2 item tuple"},{"line_number":891,"context_line":"        self.assertEqual(2, len(encrypted))"}],"source_content_type":"text/x-python","patch_set":7,"id":"dada55a8_c81179b1","line":888,"updated":"2016-07-25 09:39:51.000000000","message":"nit: s/crypted/encrypted/ and also in other places crypted--\u003eencrypted","commit_id":"3a1a198780433e6ebf2bcc3862bd63c7d033930d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"792d37b4a10e3ba7cbfdeb93b9bb7ef81e98547a","unresolved":false,"context_lines":[{"line_number":889,"context_line":"        encrypted \u003d encrypter.encrypt_header_val(Crypto(), \u0027aaa\u0027, object_key)"},{"line_number":890,"context_line":"        # sanity: return value is 2 item tuple"},{"line_number":891,"context_line":"        self.assertEqual(2, len(encrypted))"},{"line_number":892,"context_line":"        crypted_val, crypt_info \u003d encrypted"},{"line_number":893,"context_line":"        expected_crypt_val \u003d base64.b64encode("},{"line_number":894,"context_line":"            encrypt(\u0027aaa\u0027, object_key, FAKE_IV))"},{"line_number":895,"context_line":"        expected_crypt_info \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"dada55a8_28d655c3","line":892,"updated":"2016-07-25 09:39:51.000000000","message":"nit: s/crypt_info/crypto_info/ and in other places crypt--\u003ecrypto","commit_id":"3a1a198780433e6ebf2bcc3862bd63c7d033930d"}]}
