)]}'
{"barbican/plugin/snakeoil_ca.py":[{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    @cert.setter"},{"line_number":127,"context_line":"    def cert(self, val):"},{"line_number":128,"context_line":"        if self.cert_path:"},{"line_number":129,"context_line":"            with open(self.cert_path, \u0027w\u0027) as cert_fh:"},{"line_number":130,"context_line":"                cert_fh.write(crypto.dump_certificate(crypto.FILETYPE_PEM,"},{"line_number":131,"context_line":"                                                      val).decode(\u0027utf-8\u0027))"},{"line_number":132,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_cb8655db","line":129,"updated":"2015-10-01 13:34:20.000000000","message":"Hum, why not opening the file in binary mode instead?","commit_id":"f211a8191fec37be6e9f582be739929496247838"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    @key.setter"},{"line_number":146,"context_line":"    def key(self, val):"},{"line_number":147,"context_line":"        if self.key_path:"},{"line_number":148,"context_line":"            with open(self.key_path, \u0027w\u0027) as key_fh:"},{"line_number":149,"context_line":"                key_fh.write(crypto.dump_privatekey(crypto.FILETYPE_PEM,"},{"line_number":150,"context_line":"                                                    val).decode(\u0027utf-8\u0027))"},{"line_number":151,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_8b693d28","line":148,"updated":"2015-10-01 13:34:20.000000000","message":"ditto","commit_id":"f211a8191fec37be6e9f582be739929496247838"}],"barbican/plugin/store_crypto.py":[{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                                           kek_meta_dto,"},{"line_number":135,"context_line":"                                           datum_model.kek_meta_extended,"},{"line_number":136,"context_line":"                                           context.project_model.external_id)"},{"line_number":137,"context_line":"        if six.PY2 or not isinstance(secret, str):"},{"line_number":138,"context_line":"            secret \u003d base64.b64encode(secret)"},{"line_number":139,"context_line":"        else:"},{"line_number":140,"context_line":"            secret \u003d base64.b64encode(secret.encode(\u0027utf-8\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_8bfe1d37","line":137,"updated":"2015-10-01 13:34:20.000000000","message":"Hum, I would prefer to write it like that:\n\nif isinstance(secret, six.text_type):\n    secret \u003d secret.encode(\u0027utf-8\u0027)\nsecret \u003d base64.b64encode(secret)","commit_id":"f211a8191fec37be6e9f582be739929496247838"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":312,"context_line":"    # setup and store encrypted datum"},{"line_number":313,"context_line":"    datum_model \u003d models.EncryptedDatum(secret_model, kek_datum_model)"},{"line_number":314,"context_line":"    datum_model.content_type \u003d context.content_type"},{"line_number":315,"context_line":"    if six.PY2 or not isinstance(generated_dto.cypher_text, str):"},{"line_number":316,"context_line":"        datum_model.cypher_text \u003d base64.b64encode(generated_dto.cypher_text)"},{"line_number":317,"context_line":"    else:"},{"line_number":318,"context_line":"        datum_model.cypher_text \u003d base64.b64encode("}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_ab6be1f0","line":315,"updated":"2015-10-01 13:34:20.000000000","message":"I would prefer to replace the test with:\n\nif isinstance(generated_dto.cypher_text, six.text_type):\n   ... encode\nelse:\n   ...","commit_id":"f211a8191fec37be6e9f582be739929496247838"}],"barbican/tests/plugin/test_snakeoil_ca.py":[{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        if six.PY2:"},{"line_number":159,"context_line":"            self.assertIs(\u0027\\x00\u0027, sig[0])"},{"line_number":160,"context_line":"        else:"},{"line_number":161,"context_line":"            self.assertIs(0, sig[0])"},{"line_number":162,"context_line":"        crypto.verify(self.ca.cert, sig[1:], der[0], \u0027sha256\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def test_gen_cert_no_file_storage(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_6612e05a","line":161,"updated":"2015-10-01 13:34:20.000000000","message":"Hum, I would prefer to write:\n\nself.assertEqual(b\u0027\\x00\u0027, sig[:1])\n\nor\n\nself.assertTrue(sig.startswith(b\u0027\\x00\u0027), sig)\n\nNote: assertIs() should not be used to compare string.","commit_id":"f211a8191fec37be6e9f582be739929496247838"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                                                     order_meta, {},"},{"line_number":222,"context_line":"                                                     self.barbican_meta_dto)"},{"line_number":223,"context_line":"        crypto.load_certificate("},{"line_number":224,"context_line":"            crypto.FILETYPE_PEM, decode(resp.certificate, \u0027base64\u0027))"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def test_issue_certificate_request_with_ca_id(self):"},{"line_number":227,"context_line":"        req \u003d certificate_utils.get_valid_csr_object()"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_8b213db7","line":224,"updated":"2015-10-01 13:34:20.000000000","message":"You can write:\n\nbase64.b64decode(resp.certificate)","commit_id":"f211a8191fec37be6e9f582be739929496247838"}],"barbican/tests/plugin/test_store_crypto.py":[{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        self.assertEqual(secret_store.SecretType.OPAQUE, secret_dto.type)"},{"line_number":237,"context_line":"        self.assertEqual("},{"line_number":238,"context_line":"            base64.encodestring(self.decrypted_secret.encode(\u0027utf-8\u0027))"},{"line_number":239,"context_line":"            .decode(\u0027utf-8\u0027).rstrip(\u0027\\n\u0027),"},{"line_number":240,"context_line":"            secret_dto.secret.decode(\u0027utf-8\u0027))"},{"line_number":241,"context_line":"        self.assertEqual("},{"line_number":242,"context_line":"            self.encrypted_datum_model.content_type, secret_dto.content_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_468c7c7f","line":239,"updated":"2015-10-01 13:34:20.000000000","message":"On Python 3, .rstrip(\u0027\\n\u0027) is wrong because encodestring() returns a byte string. Try to run the test using python3 -bb.\n\nYou should write .rstrip(b\u0027\\n\u0027)","commit_id":"f211a8191fec37be6e9f582be739929496247838"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"a48513ed255f583c2c4ee548a17690df1d95a741","unresolved":false,"context_lines":[{"line_number":709,"context_line":"            self.content_type, test_datum_model.content_type)"},{"line_number":710,"context_line":"        self.assertEqual("},{"line_number":711,"context_line":"            base64.encodestring(self.cypher_text.encode(\u0027utf-8\u0027))"},{"line_number":712,"context_line":"            .decode(\u0027utf-8\u0027).rstrip(\u0027\\n\u0027),"},{"line_number":713,"context_line":"            test_datum_model.cypher_text.decode(\u0027utf-8\u0027))"},{"line_number":714,"context_line":"        self.assertEqual("},{"line_number":715,"context_line":"            self.response_dto.kek_meta_extended,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_86d93486","line":712,"updated":"2015-10-01 13:34:20.000000000","message":"Ditto: .rstrip(b\u0027\\n\u0027)","commit_id":"f211a8191fec37be6e9f582be739929496247838"}]}
