)]}'
{"test/unit/common/middleware/crypto_helpers.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return dec_val"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def fake_iv(self):"},{"line_number":43,"context_line":"    return \"This is an IV123\""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_7008ef91","line":42,"updated":"2015-12-18 14:51:52.000000000","message":"remove self arg - see comment in test_decrypter\n\n...and update all the call sites to not pass \u0027self\u0027","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return dec_val"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def fake_iv(self):"},{"line_number":43,"context_line":"    return \"This is an IV123\""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_6360ebcf","line":42,"in_reply_to":"3a7e1126_7008ef91","updated":"2015-12-21 08:51:31.000000000","message":"I removed it here but I need it in get_crypto_meta since encrypter calls it with a self.","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def fake_iv(self):"},{"line_number":43,"context_line":"    return \"This is an IV123\""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_702f8ff6","line":43,"updated":"2015-12-18 14:51:52.000000000","message":"or:\n\n  \"This is a nonce!\"\n\n:)\n\nThat\u0027s just a (bad) joke.","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def fake_iv(self):"},{"line_number":43,"context_line":"    return \"This is an IV123\""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_43892f74","line":43,"in_reply_to":"3a7e1126_702f8ff6","updated":"2015-12-21 08:51:31.000000000","message":"I took it in stride and didn\u0027t change to nonce ;)","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d6a01f4781500f8cf0e3b9a4302834aa2a159b2f","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def fake_iv():"},{"line_number":43,"context_line":"    return \"This is an IV123\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def fake_get_crypto_meta(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_d54d3073","line":43,"updated":"2016-01-04 02:37:06.000000000","message":"This iv is too short to work.  At least, that is my understanding.  Check-out the test in test_crypto.py called test_invalid_iv.  That same error should be happening when testing with this fake_iv.","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"9940aa27bbfc83bf29a829615044184e32dc22c7","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def fake_iv():"},{"line_number":43,"context_line":"    return \"This is an IV123\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def fake_get_crypto_meta(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_6ae0d396","line":43,"in_reply_to":"fa69d971_d54d3073","updated":"2016-01-05 15:36:18.000000000","message":"That error doesn\u0027t happen with this iv (I tested it as well). Because iv is 128 bits i.e. 16 bytes. This fake_iv is 16 bytes.","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"}],"test/unit/common/middleware/test_decrypter.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"18223fc2dac40600a7640b748347e07be11a3099","unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"def encrypt(key, iv, val):"},{"line_number":401,"context_line":"    enc_ctxt \u003d Crypto({}).create_encryption_ctxt(key, iv)"},{"line_number":402,"context_line":"    enc_val \u003d enc_ctxt.update(val)"},{"line_number":403,"context_line":"    return enc_val"},{"line_number":404,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_5dd3a438","line":401,"updated":"2015-08-24 15:37:10.000000000","message":"The same encryption context needs to be used for the whole object body.  I think this will fix the multiseg cases.","commit_id":"de142bcb89e0f31a6f3e6d7949bb59c8b09ce1ba"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"a2d8aa71db717faf55d21c69f28d060f24428d08","unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"def encrypt(key, iv, val):"},{"line_number":401,"context_line":"    enc_ctxt \u003d Crypto({}).create_encryption_ctxt(key, iv)"},{"line_number":402,"context_line":"    enc_val \u003d enc_ctxt.update(val)"},{"line_number":403,"context_line":"    return enc_val"},{"line_number":404,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_8cbc896d","line":401,"in_reply_to":"fa1b9901_5dd3a438","updated":"2015-08-25 08:46:53.000000000","message":"But in Line 155, that is what is happening right?","commit_id":"de142bcb89e0f31a6f3e6d7949bb59c8b09ce1ba"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"fae7a82c3c1a5e8bb71af3f5fcaa40b0d929b5cc","unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"def encrypt(key, iv, val):"},{"line_number":401,"context_line":"    enc_ctxt \u003d Crypto({}).create_encryption_ctxt(key, iv)"},{"line_number":402,"context_line":"    enc_val \u003d enc_ctxt.update(val)"},{"line_number":403,"context_line":"    return enc_val"},{"line_number":404,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_d12e838b","line":401,"in_reply_to":"fa1b9901_8cbc896d","updated":"2015-08-25 20:00:51.000000000","message":"No, there is a new context created each time that \"create_encryption_ctxt(key, iv)\" is called.  So, this \"encrypt\" method will need to change to take the context as an argument, and then you need to pass in the same context object for each call associated to one object body. (so, for each \"segment\" or \"chunk\" for one object).","commit_id":"de142bcb89e0f31a6f3e6d7949bb59c8b09ce1ba"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        raise HTTPInternalServerError(self.get_error_msg())"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def get_crypto_meta(self):"},{"line_number":43,"context_line":"    return {\u0027iv\u0027: fake_iv(self), \u0027cipher\u0027: Crypto({}).get_cipher()}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_d073e37e","line":42,"updated":"2015-12-18 14:51:52.000000000","message":"\u0027self\u0027 is by convention used as the first arg name for a method in a class so its confusing to see it in a module function arg list. Also, its not used in the function so should be removed anyway.","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        raise HTTPInternalServerError(self.get_error_msg())"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def get_crypto_meta(self):"},{"line_number":43,"context_line":"    return {\u0027iv\u0027: fake_iv(self), \u0027cipher\u0027: Crypto({}).get_cipher()}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_c34aff25","line":42,"in_reply_to":"3a7e1126_d073e37e","updated":"2015-12-21 08:51:31.000000000","message":"The reason I used was, get_crypto_meta calls it using self. But now, I removed it here and faking get_Crypto_meta and using a self there (encrypter calls it with a self)","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    return {\u0027iv\u0027: fake_iv(self), \u0027cipher\u0027: Crypto({}).get_cipher()}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def get_crypto_meta_header(self, crypto_meta\u003dNone):"},{"line_number":47,"context_line":"    if crypto_meta is None:"},{"line_number":48,"context_line":"        crypto_meta \u003d get_crypto_meta(self)"},{"line_number":49,"context_line":"    return urllib.quote_plus("}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_3013470f","line":46,"updated":"2015-12-18 14:51:52.000000000","message":"ditto - remove self (and update the call sites)","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def get_content_type():"},{"line_number":56,"context_line":"    return \u0027text/plain\u0027"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def encrypt_and_append_meta(self, value, key, crypto_meta\u003dNone):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_86d2fb5a","line":56,"updated":"2015-12-18 14:51:52.000000000","message":"nothing to do with this patch but this does not need to be a function","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def get_content_type():"},{"line_number":56,"context_line":"    return \u0027text/plain\u0027"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def encrypt_and_append_meta(self, value, key, crypto_meta\u003dNone):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_835077d5","line":56,"in_reply_to":"3a7e1126_86d2fb5a","updated":"2015-12-21 08:51:31.000000000","message":"Done","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    return \u0027text/plain\u0027"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def encrypt_and_append_meta(self, value, key, crypto_meta\u003dNone):"},{"line_number":60,"context_line":"    return \u0027%s; meta\u003d%s\u0027 % ("},{"line_number":61,"context_line":"        base64.b64encode(encrypt(value, key, fake_iv(self))),"},{"line_number":62,"context_line":"        get_crypto_meta_header(self, crypto_meta))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_d0e8c3e4","line":59,"updated":"2015-12-18 14:51:52.000000000","message":"ditto remove self","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    return \u0027%s; meta\u003d%s\u0027 % ("},{"line_number":61,"context_line":"        base64.b64encode(encrypt(value, key, fake_iv(self))),"},{"line_number":62,"context_line":"        get_crypto_meta_header(self, crypto_meta))"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.create_iv\u0027, fake_iv)"},{"line_number":66,"context_line":"class TestDecrypterObjectRequests(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_86ebdb12","line":63,"updated":"2015-12-18 14:51:52.000000000","message":"Perhaps move these methods to the crypto_helpers.py module? Not essential but could prove useful to have them there to share in future.","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    return \u0027%s; meta\u003d%s\u0027 % ("},{"line_number":61,"context_line":"        base64.b64encode(encrypt(value, key, fake_iv(self))),"},{"line_number":62,"context_line":"        get_crypto_meta_header(self, crypto_meta))"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.create_iv\u0027, fake_iv)"},{"line_number":66,"context_line":"class TestDecrypterObjectRequests(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_83c39756","line":63,"in_reply_to":"3a7e1126_86ebdb12","updated":"2015-12-21 08:51:31.000000000","message":"I could, but moving this will mean I need to import base 64 and move get_crypto_meta_header, which means importing and moving some more dependency stuff. I think for now, it is good here?","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                \u0027content-length\u0027: len(enc_body),"},{"line_number":80,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Etag\u0027:"},{"line_number":81,"context_line":"                    base64.b64encode(encrypt(md5hex(body), key,"},{"line_number":82,"context_line":"                                             fake_iv(self))),"},{"line_number":83,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027:"},{"line_number":84,"context_line":"                    get_crypto_meta_header(self),"},{"line_number":85,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta\u0027: get_crypto_meta_header(self),"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_8b4c5071","line":82,"updated":"2015-12-18 14:51:52.000000000","message":"Once you remove self arg from call to fake_iv then the line break will not be required","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                \u0027content-length\u0027: len(enc_body),"},{"line_number":80,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Etag\u0027:"},{"line_number":81,"context_line":"                    base64.b64encode(encrypt(md5hex(body), key,"},{"line_number":82,"context_line":"                                             fake_iv(self))),"},{"line_number":83,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027:"},{"line_number":84,"context_line":"                    get_crypto_meta_header(self),"},{"line_number":85,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta\u0027: get_crypto_meta_header(self),"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_836717b6","line":82,"in_reply_to":"3a7e1126_8b4c5071","updated":"2015-12-21 08:51:31.000000000","message":"Done","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        #   with self.assertRaises(HTTPException) as catcher:"},{"line_number":121,"context_line":"        #       resp.body"},{"line_number":122,"context_line":"        # self.assertEqual(catcher.exception.body,"},{"line_number":123,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":126,"context_line":"        # make headers encrypted so that decrypter context will blow up during"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_2bce7cb4","line":123,"updated":"2015-12-18 14:51:52.000000000","message":"Are you planning to reinstate the commented code - as it stands this test makes no assertions","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        #   with self.assertRaises(HTTPException) as catcher:"},{"line_number":121,"context_line":"        #       resp.body"},{"line_number":122,"context_line":"        # self.assertEqual(catcher.exception.body,"},{"line_number":123,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":126,"context_line":"        # make headers encrypted so that decrypter context will blow up during"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_0f0fd088","line":123,"in_reply_to":"3a7e1126_2bce7cb4","updated":"2015-12-21 08:51:31.000000000","message":"I wasn\u0027t sure if FakeCryptoThrows makes any more sense, since there is no FakeCrypto now. And Crypto doesn\u0027t throw an error. I wanted to get your thoughts on this?","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":126,"context_line":"        # make headers encrypted so that decrypter context will blow up during"},{"line_number":127,"context_line":"        # header processing"},{"line_number":128,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: method,"},{"line_number":129,"context_line":"               \u0027swift.crypto.fetch_crypto_keys\u0027: fetch_crypto_keys}"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_6bd7a423","line":126,"updated":"2015-12-18 14:51:52.000000000","message":"comment no longer makes sense - something like \u0027use bad key so that...\u0027","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":126,"context_line":"        # make headers encrypted so that decrypter context will blow up during"},{"line_number":127,"context_line":"        # header processing"},{"line_number":128,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: method,"},{"line_number":129,"context_line":"               \u0027swift.crypto.fetch_crypto_keys\u0027: fetch_crypto_keys}"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_e3adbb84","line":126,"in_reply_to":"3a7e1126_6bd7a423","updated":"2015-12-21 08:51:31.000000000","message":"Done","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        except ValueError as e:"},{"line_number":152,"context_line":"            # self.assertEqual(resp.status, \u0027500 Internal Error\u0027)"},{"line_number":153,"context_line":"            self.assertTrue(e.message.startswith(\u0027Invalid key\u0027))"},{"line_number":154,"context_line":"        # return resp"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def test_head_req_hdr_decrypt_throws(self):"},{"line_number":157,"context_line":"        self._test_req_hdr_decrypt_throws(\u0027HEAD\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_4ba2e8af","line":154,"updated":"2015-12-18 14:51:52.000000000","message":"Without digging more I don\u0027t understand why we no longer see the 500 response always.\n\nThis suggests that maybe there is a ValueError that the decrypter *should* be catching and handling, but is not. Perhaps you could dig a bit deeper into thhe exception trace and figure out why we see this?\n\nThe test seems good i.e. test what happens if the key is bad.","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        except ValueError as e:"},{"line_number":152,"context_line":"            # self.assertEqual(resp.status, \u0027500 Internal Error\u0027)"},{"line_number":153,"context_line":"            self.assertTrue(e.message.startswith(\u0027Invalid key\u0027))"},{"line_number":154,"context_line":"        # return resp"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def test_head_req_hdr_decrypt_throws(self):"},{"line_number":157,"context_line":"        self._test_req_hdr_decrypt_throws(\u0027HEAD\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_23066386","line":154,"in_reply_to":"3a7e1126_4ba2e8af","updated":"2015-12-21 08:51:31.000000000","message":"500 error was because of FakeCryptoThrows where we\u0027re making it throw HTTPInternalServerError. Decrypter doesn\u0027t do this. I think it works as expected?","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":159,"context_line":"    def test_get_req_hdr_decrypt_throws(self):"},{"line_number":160,"context_line":"        self._test_req_hdr_decrypt_throws(\u0027GET\u0027)"},{"line_number":161,"context_line":"        # resp \u003d self._test_req_hdr_decrypt_throws(\u0027GET\u0027)"},{"line_number":162,"context_line":"        # self.assertEqual(FakeContextThrows.get_error_msg(), resp.body)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def test_basic_head_req(self):"},{"line_number":165,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027HEAD\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_8bae9083","line":162,"updated":"2015-12-18 14:51:52.000000000","message":"I\u0027d like to see this assertion re-instated (by sorting out whatever is now happening in _test_req_hdr_decrypt_throws)","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d6a01f4781500f8cf0e3b9a4302834aa2a159b2f","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        #   with self.assertRaises(HTTPException) as catcher:"},{"line_number":112,"context_line":"        #       resp.body"},{"line_number":113,"context_line":"        # self.assertEqual(catcher.exception.body,"},{"line_number":114,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":117,"context_line":"        # use bad key so that it throws valueerror with a message"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_55738080","line":114,"range":{"start_line":114,"start_character":57,"end_line":114,"end_character":60},"updated":"2016-01-04 02:37:06.000000000","message":"From the name of the test, it sounds like this should be asserting that something throws (name should be changed to raised, by the way). In the past, it was testing that an exception raised from crypto would be handled correctly by the decrypter (so the error message of the exception matched that of the expected crypto error).\n\nI think we want to do something to cause crypto to fail in this case.  The only 2 ways to make crypto raise an exception is to either have a bad key, or have a bad iv, ... AFAIK. (just like the test_req_hdr_decrypt_throws below)\n\nOTOH, if this test case was intended to test that we catch trying to decrypt an unencrypted body, then this needs to change entirely.  It is expected that the keymaster will properly set the override flag if the body is not encrypted, and there is a case for that - IIRC.  Otherwise, the decrypter does not and cannot detect whether the output has been properly decrypted.  I believe it is a probe test that we have that will test that the input body equals the output body when run through encrypt/decrypt.","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"9940aa27bbfc83bf29a829615044184e32dc22c7","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        #   with self.assertRaises(HTTPException) as catcher:"},{"line_number":112,"context_line":"        #       resp.body"},{"line_number":113,"context_line":"        # self.assertEqual(catcher.exception.body,"},{"line_number":114,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":117,"context_line":"        # use bad key so that it throws valueerror with a message"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_ca09bf85","line":114,"range":{"start_line":114,"start_character":57,"end_line":114,"end_character":60},"in_reply_to":"fa69d971_55738080","updated":"2016-01-05 15:36:18.000000000","message":"Yeah, I also think that the only errors raised would be on bad key and bad iv","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d6a01f4781500f8cf0e3b9a4302834aa2a159b2f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        # self.assertEqual(catcher.exception.body,"},{"line_number":114,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":117,"context_line":"        # use bad key so that it throws valueerror with a message"},{"line_number":118,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: method,"},{"line_number":119,"context_line":"               \u0027swift.crypto.fetch_crypto_keys\u0027: fetch_crypto_keys}"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_75e32406","line":116,"updated":"2016-01-04 02:37:06.000000000","message":"Go ahead and change all the \"throws\" to \"raises\" in this file.","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"9940aa27bbfc83bf29a829615044184e32dc22c7","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        # self.assertEqual(catcher.exception.body,"},{"line_number":114,"context_line":"        #                 FakeContextThrows.get_error_msg())"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _test_req_hdr_decrypt_throws(self, method):"},{"line_number":117,"context_line":"        # use bad key so that it throws valueerror with a message"},{"line_number":118,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: method,"},{"line_number":119,"context_line":"               \u0027swift.crypto.fetch_crypto_keys\u0027: fetch_crypto_keys}"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_4a1e2fbc","line":116,"in_reply_to":"fa69d971_75e32406","updated":"2016-01-05 15:36:18.000000000","message":"Done","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d6a01f4781500f8cf0e3b9a4302834aa2a159b2f","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    def test_get_req_hdr_decrypt_throws(self):"},{"line_number":146,"context_line":"        self._test_req_hdr_decrypt_throws(\u0027GET\u0027)"},{"line_number":147,"context_line":"        # resp \u003d self._test_req_hdr_decrypt_throws(\u0027GET\u0027)"},{"line_number":148,"context_line":"        # self.assertEqual(FakeContextThrows.get_error_msg(), resp.body)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def test_basic_head_req(self):"},{"line_number":151,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027HEAD\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_95b498f2","line":148,"updated":"2016-01-04 02:37:06.000000000","message":"remove these comments","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"9940aa27bbfc83bf29a829615044184e32dc22c7","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    def test_get_req_hdr_decrypt_throws(self):"},{"line_number":146,"context_line":"        self._test_req_hdr_decrypt_throws(\u0027GET\u0027)"},{"line_number":147,"context_line":"        # resp \u003d self._test_req_hdr_decrypt_throws(\u0027GET\u0027)"},{"line_number":148,"context_line":"        # self.assertEqual(FakeContextThrows.get_error_msg(), resp.body)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def test_basic_head_req(self):"},{"line_number":151,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027HEAD\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_6a1bf3ca","line":148,"in_reply_to":"fa69d971_95b498f2","updated":"2016-01-05 15:36:18.000000000","message":"Done","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                    base64.b64encode(encrypt(\u0027encrypt me\u0027, key, fake_iv())),"},{"line_number":70,"context_line":"                \u0027x-object-sysmeta-crypto-meta-test\u0027:"},{"line_number":71,"context_line":"                    get_crypto_meta_header(),"},{"line_number":72,"context_line":"                \u0027x-object-sysmeta-test\u0027: \u0027do not encrypt me\u0027}"},{"line_number":73,"context_line":"        app.register(\u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003denc_body, headers\u003dhdrs)"},{"line_number":74,"context_line":"        resp \u003d req.get_response(decrypter.Decrypter(app, {}))"},{"line_number":75,"context_line":"        self.assertEqual(resp.body, body)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_a4057014","line":72,"updated":"2016-01-06 15:58:36.000000000","message":"there are several lines in this dict declaration ^^ that do not need to be split across multiple lines","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        self.assertEqual(resp.headers[\u0027x-object-sysmeta-test\u0027],"},{"line_number":81,"context_line":"                         \u0027do not encrypt me\u0027)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _test_req_hdr_decrypt_raises(self, method):"},{"line_number":84,"context_line":"        # use bad key so that it raises valueerror with a message"},{"line_number":85,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: method,"},{"line_number":86,"context_line":"               \u0027swift.crypto.fetch_crypto_keys\u0027: fetch_crypto_keys}"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_d76135d4","line":83,"updated":"2016-01-06 15:58:36.000000000","message":"this test name was always quite cryptic :)\n\nI think what we want here is to to test that we always get a 500 status response when various errors occur in the decryption path: bad iv for header, bad iv for body, bad key","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        body \u003d \u0027FAKE APP\u0027"},{"line_number":89,"context_line":"        key \u003d \u0027badkey\u0027"},{"line_number":90,"context_line":"        try:"},{"line_number":91,"context_line":"            enc_body \u003d encrypt(body, key, fake_iv())"},{"line_number":92,"context_line":"            content_type \u003d encrypt_and_append_meta(\u0027text/plain\u0027, key)"},{"line_number":93,"context_line":"            app \u003d FakeSwift()"},{"line_number":94,"context_line":"            hdrs \u003d {\u0027Etag\u0027: \u0027hashOfCiphertext\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_45b26ee6","line":91,"updated":"2016-01-06 15:58:36.000000000","message":"the value error is raised here, rest of test is skipped","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                         headers\u003dhdrs)"},{"line_number":104,"context_line":"            resp \u003d req.get_response(decrypter.Decrypter(app, {}))"},{"line_number":105,"context_line":"            return resp"},{"line_number":106,"context_line":"        except ValueError as e:"},{"line_number":107,"context_line":"            self.assertTrue(e.message.startswith(\u0027Invalid key\u0027))"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_head_req_hdr_decrypt_raises(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_25e65ae8","line":106,"updated":"2016-01-06 15:58:36.000000000","message":"actually, we do not want this to happen, we want a 500 response status - see my diff","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                \u0027content-length\u0027: len(enc_body),"},{"line_number":195,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Etag\u0027:"},{"line_number":196,"context_line":"                    base64.b64encode(encrypt(md5hex(body), key,"},{"line_number":197,"context_line":"                                             fake_iv())),"},{"line_number":198,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027:"},{"line_number":199,"context_line":"                    get_crypto_meta_header(),"},{"line_number":200,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta\u0027: get_crypto_meta_header(),"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_d76b7583","line":197,"updated":"2016-01-06 15:58:36.000000000","message":"unnecessary line split...and so on through rest of file","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"679a176ffefbcd3fd28a71d1a47c031311407863","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        body \u003d \u0027FAKE APP\u0027"},{"line_number":91,"context_line":"        key \u003d fetch_crypto_keys()[\u0027object\u0027]"},{"line_number":92,"context_line":"        bad_crypto_meta \u003d fake_get_crypto_meta()"},{"line_number":93,"context_line":"        bad_crypto_meta[\u0027iv\u0027] \u003d \u0027bad_iv\u0027"},{"line_number":94,"context_line":"        enc_body \u003d encrypt(body, key, fake_iv())"},{"line_number":95,"context_line":"        content_type \u003d encrypt_and_append_meta(\u0027text/plain\u0027, key)"},{"line_number":96,"context_line":"        app \u003d FakeSwift()"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa69d971_16324fa7","line":93,"range":{"start_line":93,"start_character":39,"end_line":93,"end_character":40},"updated":"2016-01-07 06:51:13.000000000","message":"A bad iv is needed in this test too?","commit_id":"efadfb27eed33ddf405de68a77814d847f5b4707"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"679a176ffefbcd3fd28a71d1a47c031311407863","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":118,"context_line":"        self.assertEqual(\u0027Error decrypting header value\u0027, resp.body)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _test_bad_iv_for_user_metadata(self, method):"},{"line_number":121,"context_line":"        # use bad iv for metadata headers"},{"line_number":122,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: method,"},{"line_number":123,"context_line":"               \u0027swift.crypto.fetch_crypto_keys\u0027: fetch_crypto_keys}"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa69d971_565c4718","line":120,"range":{"start_line":120,"start_character":51,"end_line":120,"end_character":53},"updated":"2016-01-07 06:51:13.000000000","message":"Looks like this one covers both bad iv for user metadata and body? Maybe you\u0027re catching the exception both cases, hence two tests?","commit_id":"efadfb27eed33ddf405de68a77814d847f5b4707"}],"test/unit/common/middleware/test_encrypter.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"c26a6148d4eb7a651693532c11636f9dee67c6c3","unresolved":false,"context_lines":[{"line_number":236,"context_line":"    return None"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.create_iv\u0027,"},{"line_number":240,"context_line":"            side_effect\u003dfake_iv)"},{"line_number":241,"context_line":"class TestEncrypter(unittest.TestCase):"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_06e9971a","line":239,"updated":"2015-08-17 15:23:55.000000000","message":"The encrypter get_crypto method was being mocked in the unit tests. It is no longer being mocked, and can be removed (just put the contents in the place of the method call).","commit_id":"57cf0753a421a737facbbecd901a7f6fd15c8fd4"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"d3074aea3a2f65f3341dc51d6756a8e4f1ec9306","unresolved":false,"context_lines":[{"line_number":236,"context_line":"    return None"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.create_iv\u0027,"},{"line_number":240,"context_line":"            side_effect\u003dfake_iv)"},{"line_number":241,"context_line":"class TestEncrypter(unittest.TestCase):"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_68062122","line":239,"in_reply_to":"fa1b9901_06e9971a","updated":"2015-08-17 16:00:34.000000000","message":"but here, I\u0027m mocking \"create_iv\" and not get_crypto?","commit_id":"57cf0753a421a737facbbecd901a7f6fd15c8fd4"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"604106bfce2c9b0a5385d8ece531f71b7582634b","unresolved":false,"context_lines":[{"line_number":236,"context_line":"    return None"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.create_iv\u0027,"},{"line_number":240,"context_line":"            side_effect\u003dfake_iv)"},{"line_number":241,"context_line":"class TestEncrypter(unittest.TestCase):"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_574e58c2","line":239,"in_reply_to":"fa1b9901_68062122","updated":"2015-08-17 17:49:11.000000000","message":"yes, that is right.  Since get_crypto is no longer being mocked (since it is create_iv instead), there is no need for get_crypto to exist.","commit_id":"57cf0753a421a737facbbecd901a7f6fd15c8fd4"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7425734345f8ed8dedefd35637a347228c49ec89","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                encrypt(\u0027text/plain; foo\u003dbar\u0027, key, fake_iv(self)))"},{"line_number":179,"context_line":"            print(expected_ctype)"},{"line_number":180,"context_line":"            print(parts[0])"},{"line_number":181,"context_line":"            print(parts[1])"},{"line_number":182,"context_line":"            self.assertEqual(expected_ctype.split(\u0027;\u0027)[0], parts[0])"},{"line_number":183,"context_line":"            actual_meta \u003d json.loads(urllib.unquote_plus("},{"line_number":184,"context_line":"                parts[1].lstrip(\u0027 meta\u003d\u0027)))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_c3047519","line":181,"updated":"2015-12-18 14:51:52.000000000","message":"oops: some prints hanging over here","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"fe07af9ad26be657a6a46199abda13ca1f40cc2b","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                encrypt(\u0027text/plain; foo\u003dbar\u0027, key, fake_iv(self)))"},{"line_number":179,"context_line":"            print(expected_ctype)"},{"line_number":180,"context_line":"            print(parts[0])"},{"line_number":181,"context_line":"            print(parts[1])"},{"line_number":182,"context_line":"            self.assertEqual(expected_ctype.split(\u0027;\u0027)[0], parts[0])"},{"line_number":183,"context_line":"            actual_meta \u003d json.loads(urllib.unquote_plus("},{"line_number":184,"context_line":"                parts[1].lstrip(\u0027 meta\u003d\u0027)))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a7e1126_a341f3aa","line":181,"in_reply_to":"3a7e1126_c3047519","updated":"2015-12-21 08:51:31.000000000","message":"oops! removed.","commit_id":"538b8103d6991ff6be210407452259cd6fd90105"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"d6a01f4781500f8cf0e3b9a4302834aa2a159b2f","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        #                          fake_iv()), actual_etag)"},{"line_number":80,"context_line":"        # actual_meta \u003d json.loads(actual_meta.lstrip(\u0027 meta\u003d\u0027))"},{"line_number":81,"context_line":"        # self.assertEqual(Crypto({}).get_cipher(), actual_meta[\u0027cipher\u0027])"},{"line_number":82,"context_line":"        # self.assertEqual(fake_iv(), base64.b64decode(actual_meta[\u0027iv\u0027]))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # content-type is encrypted"},{"line_number":85,"context_line":"        actual \u003d req_hdrs[\u0027Content-Type\u0027]"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_7591e451","line":82,"updated":"2016-01-04 02:37:06.000000000","message":"i suppose we may as well remove this block since we will have verion one without container encryption.","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"9940aa27bbfc83bf29a829615044184e32dc22c7","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        #                          fake_iv()), actual_etag)"},{"line_number":80,"context_line":"        # actual_meta \u003d json.loads(actual_meta.lstrip(\u0027 meta\u003d\u0027))"},{"line_number":81,"context_line":"        # self.assertEqual(Crypto({}).get_cipher(), actual_meta[\u0027cipher\u0027])"},{"line_number":82,"context_line":"        # self.assertEqual(fake_iv(), base64.b64decode(actual_meta[\u0027iv\u0027]))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # content-type is encrypted"},{"line_number":85,"context_line":"        actual \u003d req_hdrs[\u0027Content-Type\u0027]"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_ea85a3ce","line":82,"in_reply_to":"fa69d971_7591e451","updated":"2016-01-05 15:36:18.000000000","message":"Done","commit_id":"1effeed590640a9dbe30b0a845fff93aa530d51a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.create_iv\u0027,"},{"line_number":38,"context_line":"            lambda *args: fake_iv())"},{"line_number":39,"context_line":"@mock.patch(\u0027swift.common.middleware.crypto.Crypto.get_crypto_meta\u0027,"},{"line_number":40,"context_line":"            lambda *args: fake_get_crypto_meta())"},{"line_number":41,"context_line":"class TestEncrypter(unittest.TestCase):"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def test_basic_put_req(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_77eac975","line":40,"updated":"2016-01-06 15:58:36.000000000","message":"the second mock is not required","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                parts[1].lstrip(\u0027 meta\u003d\u0027)))"},{"line_number":176,"context_line":"            self.assertEqual(Crypto({}).get_cipher(), actual_meta[\u0027cipher\u0027])"},{"line_number":177,"context_line":"            self.assertEqual(fake_iv(), base64.b64decode("},{"line_number":178,"context_line":"                actual_meta[\u0027iv\u0027]))"},{"line_number":179,"context_line":"            self.assertEqual(\u0027swift_bytes\u003d1234567890\u0027, parts[2].strip())"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        # encrypted version of content-type for object server"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_9a020409","line":178,"updated":"2016-01-06 15:58:36.000000000","message":"line split not needed","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"}],"test/unit/common/middleware/test_encrypter_decrypter.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"32f535696bd20cdc22b98390402d951c81a5b17d","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def encrypt_value(self, value, key, crypto_meta_json):"},{"line_number":77,"context_line":"        crypto_meta \u003d decrypter._load_crypto_meta(crypto_meta_json)"},{"line_number":78,"context_line":"        enc_ctxt \u003d encrypter.Crypto({}).create_encryption_ctxt("},{"line_number":79,"context_line":"            key, crypto_meta.get(\u0027iv\u0027))"},{"line_number":80,"context_line":"        return enc_ctxt.update(value)"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"fa69d971_9a77649f","line":78,"updated":"2016-01-06 15:58:36.000000000","message":"use the class directly by importing from crypto.py","commit_id":"71e1cb409df9c377b22dbd239d0a0b0f30b89a57"}]}
