)]}'
{"swift/common/crypto_utils.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"891a23ec1729b2538bbb1760a6e1ff0c1a425258","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        try:"},{"line_number":43,"context_line":"            keys \u003d fetch_crypto_keys()"},{"line_number":44,"context_line":"        except Exception as err:  # noqa"},{"line_number":45,"context_line":"            # TODO - change this case to use KeyMasterException when it exists"},{"line_number":46,"context_line":"            self.logger.exception(_("},{"line_number":47,"context_line":"                \u0027ERROR get_keys(): from swift.crypto.fetch_crypto_keys: %s\u0027)"},{"line_number":48,"context_line":"                % err)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_21cf9c80","line":45,"updated":"2016-04-15 03:05:23.000000000","message":"I dont think we are going to introduce a new exception type for this.  If not, then we can remove the TODO.","commit_id":"593cc8446eb9daf79df9ad9e4a5721207ae0ae36"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e9a772d50dee13a189d1e12e7f66896dbf5a88a6","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        try:"},{"line_number":43,"context_line":"            keys \u003d fetch_crypto_keys()"},{"line_number":44,"context_line":"        except Exception as err:  # noqa"},{"line_number":45,"context_line":"            # TODO - change this case to use KeyMasterException when it exists"},{"line_number":46,"context_line":"            self.logger.exception(_("},{"line_number":47,"context_line":"                \u0027ERROR get_keys(): from swift.crypto.fetch_crypto_keys: %s\u0027)"},{"line_number":48,"context_line":"                % err)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_bc74539c","line":45,"in_reply_to":"5a18252c_21cf9c80","updated":"2016-04-18 14:33:13.000000000","message":"Done","commit_id":"593cc8446eb9daf79df9ad9e4a5721207ae0ae36"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"437e23c89745a4e88c9d43f0f1ea5b21388d2720","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                \u0027ERROR get_keys(): from %(callback)s: %(err)s\u0027),"},{"line_number":51,"context_line":"                {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: str(err)})"},{"line_number":52,"context_line":"            raise HTTPInternalServerError("},{"line_number":53,"context_line":"                \"%(callback)s had exception: %(err)s\""},{"line_number":54,"context_line":"                % {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: err.message})"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        for name in required:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_6867504d","line":53,"updated":"2016-04-19 21:03:03.000000000","message":"I thinking this error message might not be very helpful to users.","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5c90dec3dc4286c5f90193cd16a34866477b22d2","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                \u0027ERROR get_keys(): from %(callback)s: %(err)s\u0027),"},{"line_number":51,"context_line":"                {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: str(err)})"},{"line_number":52,"context_line":"            raise HTTPInternalServerError("},{"line_number":53,"context_line":"                \"%(callback)s had exception: %(err)s\""},{"line_number":54,"context_line":"                % {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: err.message})"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        for name in required:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_e8e692e6","line":53,"in_reply_to":"1a122d0e_2753c66c","updated":"2016-04-20 18:31:04.000000000","message":"I was just thinking of something more user friendly, maybe something like: \"Unable to retrieve keys necessary encrypt/decrypt object\"","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"f180f661ba253209c9b00e391eeddbc3afa3facf","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                \u0027ERROR get_keys(): from %(callback)s: %(err)s\u0027),"},{"line_number":51,"context_line":"                {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: str(err)})"},{"line_number":52,"context_line":"            raise HTTPInternalServerError("},{"line_number":53,"context_line":"                \"%(callback)s had exception: %(err)s\""},{"line_number":54,"context_line":"                % {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: err.message})"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        for name in required:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_2753c66c","line":53,"in_reply_to":"1a122d0e_6867504d","updated":"2016-04-19 22:15:20.000000000","message":"I see your point.  If the message is removed from the error raised, it would be good to provide an error log with these details for debugging the issue.","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbb710b04a33069a1233201336c52f53ea21cafd","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                \u0027ERROR get_keys(): from %(callback)s: %(err)s\u0027),"},{"line_number":51,"context_line":"                {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: str(err)})"},{"line_number":52,"context_line":"            raise HTTPInternalServerError("},{"line_number":53,"context_line":"                \"%(callback)s had exception: %(err)s\""},{"line_number":54,"context_line":"                % {\u0027callback\u0027: CRYPTO_KEY_CALLBACK, \u0027err\u0027: err.message})"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        for name in required:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_11a55646","line":53,"in_reply_to":"1a122d0e_e8e692e6","updated":"2016-05-04 16:28:55.000000000","message":"Done","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    \"\"\""},{"line_number":27,"context_line":"    Base class for contexts used by crypto middlewares."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    def __init__(self, filter, server_type, logger):"},{"line_number":30,"context_line":"        super(CryptoWSGIContext, self).__init__(filter.app)"},{"line_number":31,"context_line":"        self.crypto \u003d filter.crypto"},{"line_number":32,"context_line":"        self.logger \u003d logger"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_c0721f7c","line":29,"range":{"start_line":29,"start_character":23,"end_line":29,"end_character":29},"updated":"2016-05-06 21:25:34.000000000","message":"Off-topic: At some point, we should probably stop overriding the built-in `filter`.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    \"\"\""},{"line_number":27,"context_line":"    Base class for contexts used by crypto middlewares."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    def __init__(self, filter, server_type, logger):"},{"line_number":30,"context_line":"        super(CryptoWSGIContext, self).__init__(filter.app)"},{"line_number":31,"context_line":"        self.crypto \u003d filter.crypto"},{"line_number":32,"context_line":"        self.logger \u003d logger"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_36cd0b5e","line":29,"range":{"start_line":29,"start_character":23,"end_line":29,"end_character":29},"in_reply_to":"dab17558_c0721f7c","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            except ValueError as e:"},{"line_number":68,"context_line":"                # don\u0027t include the key in any messages!"},{"line_number":69,"context_line":"                self.logger.exception(_(\"Bad key for %r: %s\") % (name, str(e)))"},{"line_number":70,"context_line":"                raise HTTPInternalServerError("},{"line_number":71,"context_line":"                    \"Unable to retrieve encryption keys.\")"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        return keys"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_a010bb4f","line":70,"updated":"2016-05-06 21:25:34.000000000","message":"Maybe worth adding a continue at the end of the try, then raise outside the except? As in\n\n        for name in required:\n            try:\n                key \u003d keys[name]\n                self.crypto.check_key(key)\n                continue\n            except KeyError:\n                self.logger.exception(_(\"Missing key for %r\") % name)\n            except TypeError:\n                self.logger.exception(_(\"Did not get a keys dict\"))\n            except ValueError as e:\n                # don\u0027t include the key in any messages!\n                self.logger.exception(_(\"Bad key for %r: %s\") % (name, str(e)))\n            raise HTTPInternalServerError(\n                    \"Unable to retrieve encryption keys.\")","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            except ValueError as e:"},{"line_number":68,"context_line":"                # don\u0027t include the key in any messages!"},{"line_number":69,"context_line":"                self.logger.exception(_(\"Bad key for %r: %s\") % (name, str(e)))"},{"line_number":70,"context_line":"                raise HTTPInternalServerError("},{"line_number":71,"context_line":"                    \"Unable to retrieve encryption keys.\")"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        return keys"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_56552f4e","line":70,"in_reply_to":"dab17558_a010bb4f","updated":"2016-05-09 17:05:32.000000000","message":"Done. nice trick. I had tried to think of a way to have as single raise.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            return key"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        keys[\u0027object\u0027] \u003d _validate_key(\u0027X-Crypto-Object-Key\u0027)"},{"line_number":154,"context_line":"        keys[\u0027container\u0027] \u003d _validate_key(\u0027X-Crypto-Container-Key\u0027)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    return keys"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_eb56a328","line":154,"range":{"start_line":154,"start_character":43,"end_line":154,"end_character":65},"updated":"2016-05-10 20:13:43.000000000","message":"Off topic: So with BYOK, you *must* provide a container key even on object GET? Only, it could be *any* key, right? Since we\u0027d never actually use it...","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9bf7c10a75859fa4c0681270f71ef7144177bc00","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            return key"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        keys[\u0027object\u0027] \u003d _validate_key(\u0027X-Crypto-Object-Key\u0027)"},{"line_number":154,"context_line":"        keys[\u0027container\u0027] \u003d _validate_key(\u0027X-Crypto-Container-Key\u0027)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    return keys"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_12ecc128","line":154,"range":{"start_line":154,"start_character":43,"end_line":154,"end_character":65},"in_reply_to":"dab17558_c711f505","updated":"2016-05-11 19:12:40.000000000","message":"\u003e Also, BYOK won\u0027t be proposed to master, but I haven\u0027t ripped it out of feature/crypto.\n\nRight, I remember. Like I said, off-topic.\n\n\u003e once we change the object\u0027s etag metadata to be encrypted\n\nAh, I think I get it now... so the encrypted ETag will be the same on both container and object servers.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            return key"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        keys[\u0027object\u0027] \u003d _validate_key(\u0027X-Crypto-Object-Key\u0027)"},{"line_number":154,"context_line":"        keys[\u0027container\u0027] \u003d _validate_key(\u0027X-Crypto-Container-Key\u0027)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    return keys"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_c711f505","line":154,"range":{"start_line":154,"start_character":43,"end_line":154,"end_character":65},"in_reply_to":"dab17558_eb56a328","updated":"2016-05-11 18:38:14.000000000","message":"We\u0027re going to use it once we change the object\u0027s etag metadata to be encrypted using the container key in same way as the container update version.\n\nAlso, BYOK won\u0027t be proposed to master, but I haven\u0027t ripped it out of feature/crypto. Confusing, I know.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"}],"swift/common/middleware/crypto.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        \"\"\""},{"line_number":123,"context_line":"        if meta[\u0027cipher\u0027] !\u003d self.get_cipher():"},{"line_number":124,"context_line":"            raise ValueError(\"Cipher must be %s\" % self.get_cipher())"},{"line_number":125,"context_line":"        if len(meta[\u0027iv\u0027]) !\u003d 16:"},{"line_number":126,"context_line":"            raise ValueError(\"IV must be length 16\")"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_00aee784","line":125,"range":{"start_line":125,"start_character":30,"end_line":125,"end_character":32},"updated":"2016-05-06 21:25:34.000000000","message":"Maybe better to use algorithms.AES.block_size/self.get_block_size()?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        \"\"\""},{"line_number":123,"context_line":"        if meta[\u0027cipher\u0027] !\u003d self.get_cipher():"},{"line_number":124,"context_line":"            raise ValueError(\"Cipher must be %s\" % self.get_cipher())"},{"line_number":125,"context_line":"        if len(meta[\u0027iv\u0027]) !\u003d 16:"},{"line_number":126,"context_line":"            raise ValueError(\"IV must be length 16\")"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_b61bbb7f","line":125,"range":{"start_line":125,"start_character":30,"end_line":125,"end_character":32},"in_reply_to":"dab17558_00aee784","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        :param iv: 128-bit iv or nonce used for decryption"},{"line_number":60,"context_line":"        :param offset: offset into the message; used for range reads"},{"line_number":61,"context_line":"        :returns: an instance of :class:`CryptoContext`"},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":"        if offset \u003e 0:"},{"line_number":64,"context_line":"            # Adjust IV so that it is correct for decryption at offset."},{"line_number":65,"context_line":"            # ( 1\u003c\u003c (16 *8)) is to make \u0027ivl\u0027 big enough so that the following"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_370e17e5","line":62,"updated":"2016-05-11 18:38:14.000000000","message":"we should check_key again here because the AES engine will accept sizes other than 32 but we only want 32.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    def get_cipher(self):"},{"line_number":103,"context_line":"        return \u0027AES_CTR_256\u0027"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_crypto_meta(self, iv_base\u003dNone):"},{"line_number":106,"context_line":"        # create a set of parameters"},{"line_number":107,"context_line":"        return {\u0027iv\u0027: self.create_iv(iv_base), \u0027cipher\u0027: self.get_cipher()}"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_e1cccd36","line":105,"updated":"2016-05-11 18:38:14.000000000","message":"we have a method with same name in decrypter.py, rename this one to create_crypto_meta","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                                          % self.get_cipher())"},{"line_number":120,"context_line":"            if len(meta[\u0027iv\u0027]) !\u003d self.get_required_iv_length():"},{"line_number":121,"context_line":"                raise EncryptionException("},{"line_number":122,"context_line":"                    \u0027Bad crypto meta: IV must be length %s\u0027"},{"line_number":123,"context_line":"                    % self.get_required_iv_length())"},{"line_number":124,"context_line":"        except KeyError as err:"},{"line_number":125,"context_line":"            raise EncryptionException("}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_ee1b5171","line":122,"updated":"2016-05-10 20:13:43.000000000","message":"Bits or bytes? Might be worth adding a unit here. I know I wasn\u0027t paying enough attention to that on my last review.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                                          % self.get_cipher())"},{"line_number":120,"context_line":"            if len(meta[\u0027iv\u0027]) !\u003d self.get_required_iv_length():"},{"line_number":121,"context_line":"                raise EncryptionException("},{"line_number":122,"context_line":"                    \u0027Bad crypto meta: IV must be length %s\u0027"},{"line_number":123,"context_line":"                    % self.get_required_iv_length())"},{"line_number":124,"context_line":"        except KeyError as err:"},{"line_number":125,"context_line":"            raise EncryptionException("}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_c73d74c5","line":122,"in_reply_to":"dab17558_ee1b5171","updated":"2016-05-11 18:38:14.000000000","message":"Done. and similar in check_key","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"}],"swift/common/middleware/decrypter.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"891a23ec1729b2538bbb1760a6e1ff0c1a425258","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        super(DecrypterObjContext, self).__init__(decrypter, \u0027object\u0027, logger)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _decrypt_header(self, header, value, key, crypto_meta_header,"},{"line_number":134,"context_line":"                        required\u003dFalse):"},{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        Attempt to decrypt a header that may be encrypted."},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_e63e55b7","line":134,"updated":"2016-04-15 03:05:23.000000000","message":"good addition","commit_id":"593cc8446eb9daf79df9ad9e4a5721207ae0ae36"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"891a23ec1729b2538bbb1760a6e1ff0c1a425258","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                if decrypted_value:"},{"line_number":177,"context_line":"                    result.append((name, decrypted_value))"},{"line_number":178,"context_line":"                    self.logger.debug(\"decrypted user metadata %s \u003d %s\""},{"line_number":179,"context_line":"                                      % (name, decrypted_value))"},{"line_number":180,"context_line":"        return result"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def decrypt_resp_headers(self, keys):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_7c793b93","line":179,"updated":"2016-04-15 03:05:23.000000000","message":"I think it\u0027s time to take out the logging of the decrypted value.  We could keep a log of the metadata name, but not the value.","commit_id":"593cc8446eb9daf79df9ad9e4a5721207ae0ae36"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e9a772d50dee13a189d1e12e7f66896dbf5a88a6","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                if decrypted_value:"},{"line_number":177,"context_line":"                    result.append((name, decrypted_value))"},{"line_number":178,"context_line":"                    self.logger.debug(\"decrypted user metadata %s \u003d %s\""},{"line_number":179,"context_line":"                                      % (name, decrypted_value))"},{"line_number":180,"context_line":"        return result"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def decrypt_resp_headers(self, keys):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_7c1e3b64","line":179,"in_reply_to":"5a18252c_7c793b93","updated":"2016-04-18 14:33:13.000000000","message":"Done","commit_id":"593cc8446eb9daf79df9ad9e4a5721207ae0ae36"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"437e23c89745a4e88c9d43f0f1ea5b21388d2720","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def __init__(self, decrypter, logger):"},{"line_number":67,"context_line":"        super(BaseDecrypterContext, self).__init__(decrypter, logger)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def _check_cipher(self, cipher):"},{"line_number":70,"context_line":"        \"\"\""},{"line_number":71,"context_line":"        Checks that a cipher is supported."},{"line_number":72,"context_line":"        :param cipher: name of cipher, a string"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_b20f1787","side":"PARENT","line":69,"updated":"2016-04-19 21:03:03.000000000","message":"moved to crypto.check_crypto_meta! L62","commit_id":"5ed98eaa5ab5d14fe4088786587036061f26c441"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5c90dec3dc4286c5f90193cd16a34866477b22d2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self.crypto.check_crypto_meta(crypto_meta)"},{"line_number":63,"context_line":"            return crypto_meta"},{"line_number":64,"context_line":"        except (KeyError, ValueError, TypeError) as err:"},{"line_number":65,"context_line":"            msg \u003d \u0027Bad crypto meta %r: %s\u0027 % (value, err)"},{"line_number":66,"context_line":"            raise EncryptionException(msg)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def get_crypto_meta(self, header_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_3c539e18","line":65,"range":{"start_line":65,"start_character":35,"end_line":65,"end_character":37},"updated":"2016-04-20 18:31:04.000000000","message":"maybe change to %s.\n\nWith %r I got a msg like this: \n\u0027Error decrypting header X-Object-Meta-Test: Bad crypto meta \\\u0027{\"cipher\": \"AES_CTR_256\", \"iv\": \"YmFkX2l2MTIzNDU2Nzg5MDEyMzQ1\"}\\\u0027: IV must be length 16\u0027\n\nwith %s it removed the \\\n\u0027Error decrypting header X-Object-Meta-Test: Bad crypto meta {\"cipher\": \"AES_CTR_256\", \"iv\": \"YmFkX2l2MTIzNDU2Nzg5MDEyMzQ1\"}: IV must be length 16\u0027","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbb710b04a33069a1233201336c52f53ea21cafd","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self.crypto.check_crypto_meta(crypto_meta)"},{"line_number":63,"context_line":"            return crypto_meta"},{"line_number":64,"context_line":"        except (KeyError, ValueError, TypeError) as err:"},{"line_number":65,"context_line":"            msg \u003d \u0027Bad crypto meta %r: %s\u0027 % (value, err)"},{"line_number":66,"context_line":"            raise EncryptionException(msg)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def get_crypto_meta(self, header_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_1a672bb8","line":65,"range":{"start_line":65,"start_character":35,"end_line":65,"end_character":37},"in_reply_to":"1a122d0e_3c539e18","updated":"2016-05-04 16:28:55.000000000","message":"Done","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"437e23c89745a4e88c9d43f0f1ea5b21388d2720","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                # This is not an error - some user meta headers may not"},{"line_number":161,"context_line":"                # be encrypted"},{"line_number":162,"context_line":"                return None"},{"line_number":163,"context_line":"        except EncryptionException as e:"},{"line_number":164,"context_line":"            msg \u003d \"Error decrypting header %s: %s\" % (header, e)"},{"line_number":165,"context_line":"            self.logger.error(msg)"},{"line_number":166,"context_line":"            raise HTTPInternalServerError(body\u003dmsg, content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_edaed2e4","line":163,"updated":"2016-04-19 21:03:03.000000000","message":"If I followed correctly, this except would log error raised back in check_crypto_meta. I couldn\u0027t find any test for this, would be nice to add.","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbb710b04a33069a1233201336c52f53ea21cafd","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                # This is not an error - some user meta headers may not"},{"line_number":161,"context_line":"                # be encrypted"},{"line_number":162,"context_line":"                return None"},{"line_number":163,"context_line":"        except EncryptionException as e:"},{"line_number":164,"context_line":"            msg \u003d \"Error decrypting header %s: %s\" % (header, e)"},{"line_number":165,"context_line":"            self.logger.error(msg)"},{"line_number":166,"context_line":"            raise HTTPInternalServerError(body\u003dmsg, content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_e525740a","line":163,"in_reply_to":"1a122d0e_8366e14e","updated":"2016-05-04 16:28:55.000000000","message":"Done see test_GET_with_bad_iv_for_user_metadata","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5c90dec3dc4286c5f90193cd16a34866477b22d2","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                # This is not an error - some user meta headers may not"},{"line_number":161,"context_line":"                # be encrypted"},{"line_number":162,"context_line":"                return None"},{"line_number":163,"context_line":"        except EncryptionException as e:"},{"line_number":164,"context_line":"            msg \u003d \"Error decrypting header %s: %s\" % (header, e)"},{"line_number":165,"context_line":"            self.logger.error(msg)"},{"line_number":166,"context_line":"            raise HTTPInternalServerError(body\u003dmsg, content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_8366e14e","line":163,"in_reply_to":"1a122d0e_ca893728","updated":"2016-04-20 18:31:04.000000000","message":"In that case it was testing missing meta. I was thinking of another scenario where the length of IV was not 16 for example.\n\nI wanted to see what the full message would look like. E.g.:\n\n\u0027Error decrypting header X-Object-Meta-Test: Bad crypto meta {\"cipher\": \"AES_CTR_256\", \"iv\": \"YmFkX2l2MTIzNDU2Nzg5MDEyMzQ1\"}: IV must be length 16\u0027\n\nwhich is ok...","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"f180f661ba253209c9b00e391eeddbc3afa3facf","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                # This is not an error - some user meta headers may not"},{"line_number":161,"context_line":"                # be encrypted"},{"line_number":162,"context_line":"                return None"},{"line_number":163,"context_line":"        except EncryptionException as e:"},{"line_number":164,"context_line":"            msg \u003d \"Error decrypting header %s: %s\" % (header, e)"},{"line_number":165,"context_line":"            self.logger.error(msg)"},{"line_number":166,"context_line":"            raise HTTPInternalServerError(body\u003dmsg, content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_ca893728","line":163,"in_reply_to":"1a122d0e_edaed2e4","updated":"2016-04-19 22:15:20.000000000","message":"The new test_GET_missing_etag_crypto_meta in test_decrypter enters this case.","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(BaseDecrypterContext, self).__init__("},{"line_number":41,"context_line":"            decrypter, server_type, logger)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def _load_crypto_meta(self, value):"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        Build the crypto_meta from the json object."},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_dbee92eb","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":25},"updated":"2016-05-06 21:25:34.000000000","message":"I feel like the serializing/deserializing of crypto meta ought to be together (dangling off of CryptoWSGIContext, maybe?) rather than split between BaseDecrypterContext and _dump_crypto_meta. Maybe that\u0027s just me, though.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(BaseDecrypterContext, self).__init__("},{"line_number":41,"context_line":"            decrypter, server_type, logger)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def _load_crypto_meta(self, value):"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        Build the crypto_meta from the json object."},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_560d2f3d","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":25},"in_reply_to":"dab17558_dbee92eb","updated":"2016-05-09 17:05:32.000000000","message":"Agree. _dump_crypto_meta is called from contexts that do not have a ref to a CryptoContext so moved both methods to be module methods in crypto_utils. That in turn meant moving check_crypto_meta() call out of load_crypto_meta.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                value, param \u003d parts"},{"line_number":105,"context_line":"                if param.strip().startswith(\u0027meta\u003d\u0027):"},{"line_number":106,"context_line":"                    param \u003d param.strip()[5:]"},{"line_number":107,"context_line":"                    crypto_meta \u003d self._load_crypto_meta(param)"},{"line_number":108,"context_line":"        if crypto_meta is None:"},{"line_number":109,"context_line":"            # it\u0027s not an error to have been passed an unencrypted value"},{"line_number":110,"context_line":"            return value"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_fbf27699","line":107,"updated":"2016-05-06 21:25:34.000000000","message":"So we can now raise EncryptionExceptions here where we used to bail and assume the value wasn\u0027t encrypted. That seems likely to be appropriate; just making sure I understand what\u0027s changing.\n\nIs there any chance we\u0027ll try to decrypt a value where the user may have set their own meta parameter?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                value, param \u003d parts"},{"line_number":105,"context_line":"                if param.strip().startswith(\u0027meta\u003d\u0027):"},{"line_number":106,"context_line":"                    param \u003d param.strip()[5:]"},{"line_number":107,"context_line":"                    crypto_meta \u003d self._load_crypto_meta(param)"},{"line_number":108,"context_line":"        if crypto_meta is None:"},{"line_number":109,"context_line":"            # it\u0027s not an error to have been passed an unencrypted value"},{"line_number":110,"context_line":"            return value"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_08a53ba1","line":107,"in_reply_to":"dab17558_fbf27699","updated":"2016-05-09 17:05:32.000000000","message":"We only call decrypt_value with crypto_meta \u003d None when attempting to decrypt etag values in container listings. These can not have user supplied meta \"params\". When we are decrypting object headers we always pass crypto_meta in.\n\nThat said, i think this would be more obvious if the two cases were split into separate methods.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"47fd2172a435e1ad9ef8d2aeb152b2b0e9e3c6e1","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                value, param \u003d parts"},{"line_number":105,"context_line":"                if param.strip().startswith(\u0027meta\u003d\u0027):"},{"line_number":106,"context_line":"                    param \u003d param.strip()[5:]"},{"line_number":107,"context_line":"                    crypto_meta \u003d self._load_crypto_meta(param)"},{"line_number":108,"context_line":"        if crypto_meta is None:"},{"line_number":109,"context_line":"            # it\u0027s not an error to have been passed an unencrypted value"},{"line_number":110,"context_line":"            return value"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_a8d7e6eb","line":107,"in_reply_to":"dab17558_fbf27699","updated":"2016-05-08 19:06:06.000000000","message":"good question - on setting a custom meta parameter.  Currently, you would have to override the \"Crypto\" class get_crypto_meta method.  The Crypto class is attempting to encapsulate the crypto choices that may change in the future.  But I don\u0027t think we want to encourage a plugin replacement.  I\u0027d like to hear other thoughts on the topic.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            decrypted_etag \u003d self._decrypt_header("},{"line_number":197,"context_line":"                etag_header, encrypted_etag, keys[self.server_type],"},{"line_number":198,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027, required\u003dTrue)"},{"line_number":199,"context_line":"            mod_hdr_pairs.append((\u0027Etag\u0027, decrypted_etag))"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        # Decrypt all user metadata"},{"line_number":202,"context_line":"        mod_hdr_pairs.extend(self.decrypt_user_metadata(keys))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_1b73f981","line":199,"updated":"2016-05-06 21:25:34.000000000","message":"Remind me: where did we pop off the ciphertext etag?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            decrypted_etag \u003d self._decrypt_header("},{"line_number":197,"context_line":"                etag_header, encrypted_etag, keys[self.server_type],"},{"line_number":198,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027, required\u003dTrue)"},{"line_number":199,"context_line":"            mod_hdr_pairs.append((\u0027Etag\u0027, decrypted_etag))"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        # Decrypt all user metadata"},{"line_number":202,"context_line":"        mod_hdr_pairs.extend(self.decrypt_user_metadata(keys))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_a8ecef8f","line":199,"in_reply_to":"dab17558_1b73f981","updated":"2016-05-09 17:05:32.000000000","message":"It\u0027s done below (line 205) where any name in mod_hdr_pairs is filtered out from self._response_headers. So if we have found X-Object-Sysmeta-Crypto-Etag and therefore added Etag to mod_hdr_paris, then the original ciphertext Etag will be removed from response headers before we append the modified value.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"47fd2172a435e1ad9ef8d2aeb152b2b0e9e3c6e1","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            decrypted_etag \u003d self._decrypt_header("},{"line_number":197,"context_line":"                etag_header, encrypted_etag, keys[self.server_type],"},{"line_number":198,"context_line":"                \u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027, required\u003dTrue)"},{"line_number":199,"context_line":"            mod_hdr_pairs.append((\u0027Etag\u0027, decrypted_etag))"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        # Decrypt all user metadata"},{"line_number":202,"context_line":"        mod_hdr_pairs.extend(self.decrypt_user_metadata(keys))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_a84526b4","line":199,"in_reply_to":"dab17558_1b73f981","updated":"2016-05-08 19:06:06.000000000","message":"the Etag will only be a ciphertext etag if there is an encrypted_etag present.  At least, that is the assumption.  If we pop the etag outside of this conditional, you would most likely be removing the correct non-ciphertext etag.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    def make_decryption_context(self, keys, crypto_meta, offset\u003d0):"},{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            return self.crypto.create_decryption_ctxt("},{"line_number":216,"context_line":"                keys[\u0027object\u0027], crypto_meta.get(\u0027iv\u0027), offset)"},{"line_number":217,"context_line":"        except ValueError as err:"},{"line_number":218,"context_line":"            msg \u003d \u0027Error creating decryption context for object body\u0027"},{"line_number":219,"context_line":"            self.logger.error(\u0027%s: %s\u0027 % (msg, str(err)))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_7b94c536","line":216,"range":{"start_line":216,"start_character":43,"end_line":216,"end_character":53},"updated":"2016-05-06 21:25:34.000000000","message":"Do we need to be this defensive? Have we called check_crypto_meta yet?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"47fd2172a435e1ad9ef8d2aeb152b2b0e9e3c6e1","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    def make_decryption_context(self, keys, crypto_meta, offset\u003d0):"},{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            return self.crypto.create_decryption_ctxt("},{"line_number":216,"context_line":"                keys[\u0027object\u0027], crypto_meta.get(\u0027iv\u0027), offset)"},{"line_number":217,"context_line":"        except ValueError as err:"},{"line_number":218,"context_line":"            msg \u003d \u0027Error creating decryption context for object body\u0027"},{"line_number":219,"context_line":"            self.logger.error(\u0027%s: %s\u0027 % (msg, str(err)))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_081392b9","line":216,"range":{"start_line":216,"start_character":43,"end_line":216,"end_character":53},"in_reply_to":"dab17558_7b94c536","updated":"2016-05-08 19:06:06.000000000","message":"It is true that I don\u0027t see any tests hitting the ValueError here.  If it is possible to reach the exception, then there should be a test for that.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    def make_decryption_context(self, keys, crypto_meta, offset\u003d0):"},{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            return self.crypto.create_decryption_ctxt("},{"line_number":216,"context_line":"                keys[\u0027object\u0027], crypto_meta.get(\u0027iv\u0027), offset)"},{"line_number":217,"context_line":"        except ValueError as err:"},{"line_number":218,"context_line":"            msg \u003d \u0027Error creating decryption context for object body\u0027"},{"line_number":219,"context_line":"            self.logger.error(\u0027%s: %s\u0027 % (msg, str(err)))"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_ceacdba2","line":216,"range":{"start_line":216,"start_character":43,"end_line":216,"end_character":53},"in_reply_to":"dab17558_7b94c536","updated":"2016-05-09 17:05:32.000000000","message":"We called check_crypto_meta in get_crypto_meta at line 286.\n\ncreate_decryption_ctxt might raise a ValueError if the keys are bad, but we checked those at line 271.\n\ncreate_decryption_ctxt might raise a ValueError if the offset is negative. But that should never be the case, right? Offset comes from the Content-Range header(s).\n\nIn which case I think the try/except is not needed and the method can be eliminated.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"47fd2172a435e1ad9ef8d2aeb152b2b0e9e3c6e1","unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"            if not crypto_meta:"},{"line_number":295,"context_line":"                self.logger.debug(\"No sysmeta-crypto-meta for body.\")"},{"line_number":296,"context_line":"                resp_iter \u003d app_resp"},{"line_number":297,"context_line":"            elif (self._get_status_int() \u003d\u003d 206 and"},{"line_number":298,"context_line":"                  content_type \u003d\u003d \u0027multipart/byteranges\u0027):"},{"line_number":299,"context_line":"                boundary \u003d dict(content_type_attrs)[\"boundary\"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_4b7d946d","line":296,"updated":"2016-05-08 19:06:06.000000000","message":"Interesting : I would suggest that this would be coded as an error case, except for the fact that we could have encrypted headers with an un-encrypted body (due to a POST against a legacy object).\n\nJust a reminder: If no decryption is necessary, then the override flag should have been set, and this line would never be reached.  Having no override means there is something to decrypt.  But we cannot tell if its the body part necessarily, or some header value.\n\nThe only danger is that if there was an error where there is encrypted data with no crypto-meta, we return junk. I suppose we could have flags for both body and user-meta.  but if user-meta is ever individually update-able on a POST, then we are back to the same issue.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"            if not crypto_meta:"},{"line_number":295,"context_line":"                self.logger.debug(\"No sysmeta-crypto-meta for body.\")"},{"line_number":296,"context_line":"                resp_iter \u003d app_resp"},{"line_number":297,"context_line":"            elif (self._get_status_int() \u003d\u003d 206 and"},{"line_number":298,"context_line":"                  content_type \u003d\u003d \u0027multipart/byteranges\u0027):"},{"line_number":299,"context_line":"                boundary \u003d dict(content_type_attrs)[\"boundary\"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_b92443af","line":296,"in_reply_to":"dab17558_4b7d946d","updated":"2016-05-09 17:05:32.000000000","message":"Its not an error for the reason you state - we could have unencrypted body but encrypted metadata headers. The override flag will not be set in that case.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        \"\"\""},{"line_number":71,"context_line":"        # try to extract crypto_meta from end of value"},{"line_number":72,"context_line":"        parts \u003d value.rsplit(\u0027;\u0027, 1)"},{"line_number":73,"context_line":"        if len(parts) \u003d\u003d 2:"},{"line_number":74,"context_line":"            value, param \u003d parts"},{"line_number":75,"context_line":"            if param.strip().startswith(\u0027meta\u003d\u0027):"},{"line_number":76,"context_line":"                param \u003d param.strip()[5:]"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_547ab924","line":73,"updated":"2016-05-11 18:38:14.000000000","message":"move the meta extraction and its counterpart into crypto_utils like we did for load_crypto_meta and dump_crypto_meta","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                return None"},{"line_number":147,"context_line":"        except EncryptionException as e:"},{"line_number":148,"context_line":"            msg \u003d \"Error decrypting header\""},{"line_number":149,"context_line":"            self.logger.error(\"%s %s: %s\" % (msg, header, e))"},{"line_number":150,"context_line":"            raise HTTPInternalServerError(body\u003dmsg, content_type\u003d\u0027text/plain\u0027)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def decrypt_user_metadata(self, keys):"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_4e125d0a","line":149,"updated":"2016-05-10 20:13:43.000000000","message":"nit: Shouldn\u0027t the logger do the interpolation for us if we just say\n\n self.logger.error(\"%s %s: %s\", msg, header, e)\n\n? I think there were a handful of other places like that...","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                return None"},{"line_number":147,"context_line":"        except EncryptionException as e:"},{"line_number":148,"context_line":"            msg \u003d \"Error decrypting header\""},{"line_number":149,"context_line":"            self.logger.error(\"%s %s: %s\" % (msg, header, e))"},{"line_number":150,"context_line":"            raise HTTPInternalServerError(body\u003dmsg, content_type\u003d\u0027text/plain\u0027)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def decrypt_user_metadata(self, keys):"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_87afec7b","line":149,"in_reply_to":"dab17558_4e125d0a","updated":"2016-05-11 18:38:14.000000000","message":"So it does. Fixed here and elsewhere.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"}],"swift/common/middleware/encrypter.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    enc_val \u003d base64.b64encode(crypto_ctxt.update(value))"},{"line_number":50,"context_line":"    if append_crypto_meta:"},{"line_number":51,"context_line":"        # Store the crypto-meta with the value itself"},{"line_number":52,"context_line":"        enc_val \u003d \u0027%s; meta\u003d%s\u0027 % (enc_val, dump_crypto_meta(crypto_meta))"},{"line_number":53,"context_line":"    return enc_val, crypto_meta"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_2e14399e","line":52,"range":{"start_line":52,"start_character":23,"end_line":52,"end_character":27},"updated":"2016-05-10 20:13:43.000000000","message":"Off topic: Are we going to be kicking ourselves for not making this `crypto_meta`?","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if append_crypto_meta:"},{"line_number":51,"context_line":"        # Store the crypto-meta with the value itself"},{"line_number":52,"context_line":"        enc_val \u003d \u0027%s; meta\u003d%s\u0027 % (enc_val, dump_crypto_meta(crypto_meta))"},{"line_number":53,"context_line":"    return enc_val, crypto_meta"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class EncInputWrapper(object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_aeb2e991","line":53,"range":{"start_line":53,"start_character":20,"end_line":53,"end_character":31},"updated":"2016-05-10 20:13:43.000000000","message":"So if the caller wants the serialized version of this (which seems to generally be the case), we\u0027ll have to dump_crypto_meta twice? I suppose it shouldn\u0027t add much overhead... but I would\u0027ve been tempted to fix the docstring instead.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if append_crypto_meta:"},{"line_number":51,"context_line":"        # Store the crypto-meta with the value itself"},{"line_number":52,"context_line":"        enc_val \u003d \u0027%s; meta\u003d%s\u0027 % (enc_val, dump_crypto_meta(crypto_meta))"},{"line_number":53,"context_line":"    return enc_val, crypto_meta"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class EncInputWrapper(object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_0a1dc165","line":53,"range":{"start_line":53,"start_character":20,"end_line":53,"end_character":31},"in_reply_to":"dab17558_aeb2e991","updated":"2016-05-11 18:38:14.000000000","message":"We never call this with append_crypto_meta\u003dTrue *and* use the returned crypto_meta value, but we do call this and not dumpt the crypto meta at all in _encrypt_conditional_etags, so although probably trivial, I went this way to avoid the unnecessary calls to _dump_crypto_meta.\n\nOn reflection I think this is another case where breaking the method up into simpler methods might prove to be more intuitive.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"}],"test/unit/common/middleware/test_crypto.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    def setUp(self):"},{"line_number":27,"context_line":"        self.crypto \u003d Crypto({})"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def test_basic_crypto(self):"},{"line_number":30,"context_line":"        value \u003d \u0027encrypt me\u0027"},{"line_number":31,"context_line":"        key \u003d \u0027objL7wjV6L79Sfs4y7dy41273l0k6Wki\u0027"},{"line_number":32,"context_line":"        iv \u003d self.crypto.create_iv()"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_44dfac39","line":29,"updated":"2016-05-11 18:38:14.000000000","message":"this test is weak, it does not actually assert that the encryption is using the expected algorithm.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def test_check_key(self):"},{"line_number":80,"context_line":"        for key in (\u0027objKey\u0027, \u0027a\u0027 * 31, \u0027a\u0027 * 33, \u0027a\u0027 * 16, \u0027a\u0027 * 24):"},{"line_number":81,"context_line":"            with self.assertRaises(ValueError) as cm:"},{"line_number":82,"context_line":"                self.crypto.check_key(key)"},{"line_number":83,"context_line":"            self.assertEqual(\"Invalid key: length should be 32\","},{"line_number":84,"context_line":"                             cm.exception.message)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_34764ca4","line":82,"range":{"start_line":82,"start_character":28,"end_line":82,"end_character":37},"updated":"2016-05-10 20:13:43.000000000","message":"We\u0027ve switched from testing create_encryption_ctxt / create_decryption_ctxt to testing check_key. Should we check that those actually call check_key?","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def test_check_key(self):"},{"line_number":80,"context_line":"        for key in (\u0027objKey\u0027, \u0027a\u0027 * 31, \u0027a\u0027 * 33, \u0027a\u0027 * 16, \u0027a\u0027 * 24):"},{"line_number":81,"context_line":"            with self.assertRaises(ValueError) as cm:"},{"line_number":82,"context_line":"                self.crypto.check_key(key)"},{"line_number":83,"context_line":"            self.assertEqual(\"Invalid key: length should be 32\","},{"line_number":84,"context_line":"                             cm.exception.message)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_49d345d5","line":82,"range":{"start_line":82,"start_character":28,"end_line":82,"end_character":37},"in_reply_to":"dab17558_34764ca4","updated":"2016-05-11 18:38:14.000000000","message":"OK. I found the original test names confusing, replaced them and lost the tests on the create_*_context in the process.\n\nBefore we ever call the create_*_ctxt methods the key validity is always checked in get_keys, and the crypto meta is either checked with check_crypto_meta or is freshly minted from crypto.get_crypto_meta.\n\nSo I don\u0027t think it is even necessary to call check_key() again in create_encryption_ctxt.\n\nI will add (put back) some tests on the create_*_ctxt methods.\n\nFWIW, I\u0027d prefer the crpto_meta to be more encapsulated in the Crypto class e.g. when I create an encrypter context it comes with a crypto_meta set up. At the moment we get crypto_meta from Crypto only to hand it back in create_encryption_context. But that\u0027s for later perhaps...","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9bf7c10a75859fa4c0681270f71ef7144177bc00","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def test_check_key(self):"},{"line_number":80,"context_line":"        for key in (\u0027objKey\u0027, \u0027a\u0027 * 31, \u0027a\u0027 * 33, \u0027a\u0027 * 16, \u0027a\u0027 * 24):"},{"line_number":81,"context_line":"            with self.assertRaises(ValueError) as cm:"},{"line_number":82,"context_line":"                self.crypto.check_key(key)"},{"line_number":83,"context_line":"            self.assertEqual(\"Invalid key: length should be 32\","},{"line_number":84,"context_line":"                             cm.exception.message)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_523ac9e7","line":82,"range":{"start_line":82,"start_character":28,"end_line":82,"end_character":37},"in_reply_to":"dab17558_49d345d5","updated":"2016-05-11 19:12:40.000000000","message":"\u003e Before we ever call the create_*_ctxt methods the key validity is always checked in get_keys, and the crypto meta is either checked with check_crypto_meta or is freshly minted from crypto.get_crypto_meta.\n\nYeah, I wasn\u0027t too worried about it as a result. Changing what gets tested just makes me squeamish (at least, when I notice it).","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def test_check_crypto_meta(self):"},{"line_number":87,"context_line":"        meta \u003d {\u0027cipher\u0027: \u0027AES_CTR_256\u0027}"},{"line_number":88,"context_line":"        with self.assertRaises(EncryptionException) as cm:"},{"line_number":89,"context_line":"            self.crypto.check_crypto_meta(meta)"},{"line_number":90,"context_line":"        self.assertEqual(\"Bad crypto meta: Missing \u0027iv\u0027\","},{"line_number":91,"context_line":"                         cm.exception.message)"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_d12f1286","line":89,"range":{"start_line":89,"start_character":24,"end_line":89,"end_character":41},"updated":"2016-05-10 20:13:43.000000000","message":"Similar to above, only we definitely *don\u0027t* call check_crypto_meta in create_encryption_ctxt / create_decryption_ctxt. What do we expect to happen if future-us munge or drop the IV? Or is it not worth worrying about?","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def test_check_crypto_meta(self):"},{"line_number":87,"context_line":"        meta \u003d {\u0027cipher\u0027: \u0027AES_CTR_256\u0027}"},{"line_number":88,"context_line":"        with self.assertRaises(EncryptionException) as cm:"},{"line_number":89,"context_line":"            self.crypto.check_crypto_meta(meta)"},{"line_number":90,"context_line":"        self.assertEqual(\"Bad crypto meta: Missing \u0027iv\u0027\","},{"line_number":91,"context_line":"                         cm.exception.message)"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_84f7d4d1","line":89,"range":{"start_line":89,"start_character":24,"end_line":89,"end_character":41},"in_reply_to":"dab17558_d12f1286","updated":"2016-05-11 18:38:14.000000000","message":"We\u0027d get a ValueError from cryptography lib. As above, will add direct test on create_encryption_ctxt to verify that.","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"}],"test/unit/common/middleware/test_crypto_utils.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"891a23ec1729b2538bbb1760a6e1ff0c1a425258","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from test.unit import FakeLogger"},{"line_number":21,"context_line":"from test.unit.common.middleware.crypto_helpers import fetch_crypto_keys"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"FETCH_KEYS_CALLBACK \u003d \u0027swift.crypto.fetch_crypto_keys\u0027"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class TestCryptoWsgiContext(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_d0a5d304","line":23,"updated":"2016-04-15 03:05:23.000000000","message":"thanks!  that will make this nice to merge later.","commit_id":"593cc8446eb9daf79df9ad9e4a5721207ae0ae36"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"437e23c89745a4e88c9d43f0f1ea5b21388d2720","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        with self.assertRaises(HTTPException) as cm:"},{"line_number":55,"context_line":"            self.crypto_context.get_keys({})"},{"line_number":56,"context_line":"        self.assertIn(\u0027500 Internal Error\u0027, cm.exception.message)"},{"line_number":57,"context_line":"        self.assertIn(\u0027%s not in env\u0027 % CRYPTO_KEY_CALLBACK, cm.exception.body)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # callback exception"},{"line_number":60,"context_line":"        def callback():"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_681910d7","line":57,"updated":"2016-04-19 21:03:03.000000000","message":"this error msg doesn\u0027t seem very helpful to users","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbb710b04a33069a1233201336c52f53ea21cafd","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        with self.assertRaises(HTTPException) as cm:"},{"line_number":55,"context_line":"            self.crypto_context.get_keys({})"},{"line_number":56,"context_line":"        self.assertIn(\u0027500 Internal Error\u0027, cm.exception.message)"},{"line_number":57,"context_line":"        self.assertIn(\u0027%s not in env\u0027 % CRYPTO_KEY_CALLBACK, cm.exception.body)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # callback exception"},{"line_number":60,"context_line":"        def callback():"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_a03a4ae5","line":57,"in_reply_to":"1a122d0e_681910d7","updated":"2016-05-04 16:28:55.000000000","message":"Done - made the client error generic and added assertions on the error log messages which have useful but internal messages.","commit_id":"130d374c805e3a6875a7ee9d9eab82d85548331b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        with self.assertRaises(HTTPException) as cm:"},{"line_number":87,"context_line":"            self.crypto_context.get_keys("},{"line_number":88,"context_line":"                {CRYPTO_KEY_CALLBACK: lambda: bad_keys},"},{"line_number":89,"context_line":"                required\u003d[\u0027object\u0027, \u0027container\u0027])"},{"line_number":90,"context_line":"        self.assertIn(\u0027500 Internal Error\u0027, cm.exception.message)"},{"line_number":91,"context_line":"        self.assertIn(\"Missing key for \u0027object\u0027\","},{"line_number":92,"context_line":"                      self.fake_logger.get_lines_for_level(\u0027error\u0027)[0])"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_fe6543e1","line":89,"updated":"2016-05-06 21:25:34.000000000","message":"Maybe worth having a similar test that checks that we only look for the required keys? Might not be worth it, as we don\u0027t actually have any code that depends on the behavior. (I.e., we never have an object context that only requires a container key, or vice-versa.)","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        with self.assertRaises(HTTPException) as cm:"},{"line_number":87,"context_line":"            self.crypto_context.get_keys("},{"line_number":88,"context_line":"                {CRYPTO_KEY_CALLBACK: lambda: bad_keys},"},{"line_number":89,"context_line":"                required\u003d[\u0027object\u0027, \u0027container\u0027])"},{"line_number":90,"context_line":"        self.assertIn(\u0027500 Internal Error\u0027, cm.exception.message)"},{"line_number":91,"context_line":"        self.assertIn(\"Missing key for \u0027object\u0027\","},{"line_number":92,"context_line":"                      self.fake_logger.get_lines_for_level(\u0027error\u0027)[0])"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_19d3cf05","line":89,"in_reply_to":"dab17558_fe6543e1","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b331386fa573b3cc4f006c2d91df9d09cb4d9f02","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    def test_append_crypto_meta(self):"},{"line_number":148,"context_line":"        actual \u003d crypto_utils.append_crypto_meta("},{"line_number":149,"context_line":"            \u0027abc\u0027, {\u0027iv\u0027: \u00270123456789abcdef\u0027, \u0027cipher\u0027: \u0027AES_CTR_256\u0027})"},{"line_number":150,"context_line":"        # the order of the dict serialization is unpredictable"},{"line_number":151,"context_line":"        expected \u003d ["},{"line_number":152,"context_line":"            \u0027abc; meta\u003d%7B%22cipher%22%3A+%22AES_CTR_256%22%2C+%22\u0027"},{"line_number":153,"context_line":"            \u0027iv%22%3A+%22MDEyMzQ1Njc4OWFiY2RlZg%3D%3D%22%7D\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"dab17558_6d660cee","line":150,"updated":"2016-05-11 19:12:59.000000000","message":"Maybe worth passing sort_keys\u003dTrue to json.dumps, then?","commit_id":"06e53041ed8a6fd52039dede17aa0347100b6b81"}],"test/unit/common/middleware/test_decrypter.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":536,"context_line":"            \u0027X-Object-Sysmeta-Crypto-Meta\u0027: get_crypto_meta_header()}"},{"line_number":537,"context_line":"        self.app.register(\u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003dciphertext,"},{"line_number":538,"context_line":"                          headers\u003dhdrs)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def test_GET_multipart_no_body_crypto_meta(self):"},{"line_number":541,"context_line":"        # build fake multipart response body"},{"line_number":542,"context_line":"        plaintext \u003d \u0027Cwm fjord veg balks nth pyx quiz\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_9e8fd722","line":539,"updated":"2016-05-06 21:25:34.000000000","message":"What about the rest of test_GET_multipart_content_type?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":536,"context_line":"            \u0027X-Object-Sysmeta-Crypto-Meta\u0027: get_crypto_meta_header()}"},{"line_number":537,"context_line":"        self.app.register(\u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003dciphertext,"},{"line_number":538,"context_line":"                          headers\u003dhdrs)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def test_GET_multipart_no_body_crypto_meta(self):"},{"line_number":541,"context_line":"        # build fake multipart response body"},{"line_number":542,"context_line":"        plaintext \u003d \u0027Cwm fjord veg balks nth pyx quiz\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_7935bbf5","line":539,"in_reply_to":"dab17558_9e8fd722","updated":"2016-05-09 17:05:32.000000000","message":":/ oops, bad cut/paste","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            \u0027Etag\u0027: plaintext_etag,"},{"line_number":559,"context_line":"            \u0027content-type\u0027: \u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":560,"context_line":"            \u0027content-length\u0027: len(body)}"},{"line_number":561,"context_line":"        self.app.register(\u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003dbody, headers\u003dhdrs)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        # issue request"},{"line_number":564,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_7eccb335","line":561,"range":{"start_line":561,"start_character":46,"end_line":561,"end_character":52},"updated":"2016-05-06 21:25:34.000000000","message":"Do you want a 200 here, or a 206?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            \u0027Etag\u0027: plaintext_etag,"},{"line_number":559,"context_line":"            \u0027content-type\u0027: \u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":560,"context_line":"            \u0027content-length\u0027: len(body)}"},{"line_number":561,"context_line":"        self.app.register(\u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003dbody, headers\u003dhdrs)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        # issue request"},{"line_number":564,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_341a1a6f","line":561,"range":{"start_line":561,"start_character":46,"end_line":561,"end_character":52},"in_reply_to":"dab17558_7eccb335","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        self.assertEqual(\u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":573,"context_line":"                         resp.headers[\u0027Content-Type\u0027])"},{"line_number":574,"context_line":""},{"line_number":575,"context_line":"        # the multipart headers could be re-ordered, so parse response body to"},{"line_number":576,"context_line":"        # verify expected content"},{"line_number":577,"context_line":"        resp_lines \u003d resp.body.split(\u0027\\r\\n\u0027)"},{"line_number":578,"context_line":"        resp_lines.reverse()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_be03bb72","line":575,"range":{"start_line":575,"start_character":10,"end_line":575,"end_character":51},"updated":"2016-05-06 21:25:34.000000000","message":"The middleware still parses and regurgitates the body? I thought we wouldn\u0027t do *any* processing on the response without crypto meta.\n\nFWIW, the test still passes if I add\n\n self.assertEqual(body, resp.body)","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        self.assertEqual(\u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":573,"context_line":"                         resp.headers[\u0027Content-Type\u0027])"},{"line_number":574,"context_line":""},{"line_number":575,"context_line":"        # the multipart headers could be re-ordered, so parse response body to"},{"line_number":576,"context_line":"        # verify expected content"},{"line_number":577,"context_line":"        resp_lines \u003d resp.body.split(\u0027\\r\\n\u0027)"},{"line_number":578,"context_line":"        resp_lines.reverse()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_d4cbcea3","line":575,"range":{"start_line":575,"start_character":10,"end_line":575,"end_character":51},"in_reply_to":"dab17558_be03bb72","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"47fd2172a435e1ad9ef8d2aeb152b2b0e9e3c6e1","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        self.assertEqual(\u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":573,"context_line":"                         resp.headers[\u0027Content-Type\u0027])"},{"line_number":574,"context_line":""},{"line_number":575,"context_line":"        # the multipart headers could be re-ordered, so parse response body to"},{"line_number":576,"context_line":"        # verify expected content"},{"line_number":577,"context_line":"        resp_lines \u003d resp.body.split(\u0027\\r\\n\u0027)"},{"line_number":578,"context_line":"        resp_lines.reverse()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_281016a8","line":575,"range":{"start_line":575,"start_character":10,"end_line":575,"end_character":51},"in_reply_to":"dab17558_be03bb72","updated":"2016-05-08 19:06:06.000000000","message":"I suppose this is meant to assert that?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def test_GET_multipart_bad_body_iv(self):"},{"line_number":638,"context_line":"        self._test_GET_multipart_bad_body_crypto_meta("},{"line_number":639,"context_line":"            {\u0027cipher\u0027: \u0027Mystery cipher\u0027, \u0027iv\u0027: \u0027too short\u0027})"},{"line_number":640,"context_line":"        self._test_GET_multipart_bad_body_crypto_meta("},{"line_number":641,"context_line":"            {\u0027cipher\u0027: \u0027AES_CTR_256\u0027, \u0027iv\u0027: \u0027a little too long\u0027})"},{"line_number":642,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_deb67f89","line":639,"range":{"start_line":639,"start_character":24,"end_line":639,"end_character":38},"updated":"2016-05-06 21:25:34.000000000","message":"Should this be AES_CTR_256?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def test_GET_multipart_bad_body_iv(self):"},{"line_number":638,"context_line":"        self._test_GET_multipart_bad_body_crypto_meta("},{"line_number":639,"context_line":"            {\u0027cipher\u0027: \u0027Mystery cipher\u0027, \u0027iv\u0027: \u0027too short\u0027})"},{"line_number":640,"context_line":"        self._test_GET_multipart_bad_body_crypto_meta("},{"line_number":641,"context_line":"            {\u0027cipher\u0027: \u0027AES_CTR_256\u0027, \u0027iv\u0027: \u0027a little too long\u0027})"},{"line_number":642,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_d442ae0f","line":639,"range":{"start_line":639,"start_character":24,"end_line":639,"end_character":38},"in_reply_to":"dab17558_deb67f89","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":639,"context_line":"            {\u0027cipher\u0027: \u0027Mystery cipher\u0027, \u0027iv\u0027: \u0027too short\u0027})"},{"line_number":640,"context_line":"        self._test_GET_multipart_bad_body_crypto_meta("},{"line_number":641,"context_line":"            {\u0027cipher\u0027: \u0027AES_CTR_256\u0027, \u0027iv\u0027: \u0027a little too long\u0027})"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"    def test_GET_etag_no_match(self):"},{"line_number":644,"context_line":"        self.skipTest(\u0027Etag verification not yet implemented\u0027)"},{"line_number":645,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_be729be3","line":642,"updated":"2016-05-06 21:25:34.000000000","message":"Should we have a test with missing cipher/iv keys?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":639,"context_line":"            {\u0027cipher\u0027: \u0027Mystery cipher\u0027, \u0027iv\u0027: \u0027too short\u0027})"},{"line_number":640,"context_line":"        self._test_GET_multipart_bad_body_crypto_meta("},{"line_number":641,"context_line":"            {\u0027cipher\u0027: \u0027AES_CTR_256\u0027, \u0027iv\u0027: \u0027a little too long\u0027})"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"    def test_GET_etag_no_match(self):"},{"line_number":644,"context_line":"        self.skipTest(\u0027Etag verification not yet implemented\u0027)"},{"line_number":645,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_14e9d6e6","line":642,"in_reply_to":"dab17558_be729be3","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"47fd2172a435e1ad9ef8d2aeb152b2b0e9e3c6e1","unresolved":false,"context_lines":[{"line_number":641,"context_line":"            {\u0027cipher\u0027: \u0027AES_CTR_256\u0027, \u0027iv\u0027: \u0027a little too long\u0027})"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"    def test_GET_etag_no_match(self):"},{"line_number":644,"context_line":"        self.skipTest(\u0027Etag verification not yet implemented\u0027)"},{"line_number":645,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027GET\u0027,"},{"line_number":646,"context_line":"               CRYPTO_KEY_CALLBACK: fetch_crypto_keys}"},{"line_number":647,"context_line":"        req \u003d Request.blank(\u0027/v1/a/c/o\u0027, environ\u003denv)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_0b00ac00","line":644,"updated":"2016-05-08 19:06:06.000000000","message":"I know this wasn\u0027t changed in this patch, but I am wondering if we ever want to add etag verification - and if that time is now.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":641,"context_line":"            {\u0027cipher\u0027: \u0027AES_CTR_256\u0027, \u0027iv\u0027: \u0027a little too long\u0027})"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"    def test_GET_etag_no_match(self):"},{"line_number":644,"context_line":"        self.skipTest(\u0027Etag verification not yet implemented\u0027)"},{"line_number":645,"context_line":"        env \u003d {\u0027REQUEST_METHOD\u0027: \u0027GET\u0027,"},{"line_number":646,"context_line":"               CRYPTO_KEY_CALLBACK: fetch_crypto_keys}"},{"line_number":647,"context_line":"        req \u003d Request.blank(\u0027/v1/a/c/o\u0027, environ\u003denv)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_942ca603","line":644,"in_reply_to":"dab17558_0b00ac00","updated":"2016-05-09 17:05:32.000000000","message":"OK I was never sure what this test was waiting for. How would we verify the ciphertext, or rather, what would we do if it turned out to be bad - the headers and decrypted body will have been sent to client before we know that the ciphertext was bad. The object server will quarantine the object if the problem was bitrot on disk.\n\n\nDeleting the test.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":746,"context_line":"            \u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003denc_body, headers\u003dhdrs)"},{"line_number":747,"context_line":"        resp \u003d req.get_response(self.decrypter)"},{"line_number":748,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":749,"context_line":"        self.assertIn(\u0027Error decrypting header X-Object-Sysmeta-Crypto-Etag\u0027,"},{"line_number":750,"context_line":"                      resp.body)"},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"    def test_GET_decryption_override(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_64f262d4","line":749,"updated":"2016-05-06 21:25:34.000000000","message":"What\u0027s the rest of resp.body look like?\n\n\"Bad crypto meta \u003cjson\u003e: Cipher must be AES_CTR_256\" or something like that, yeah?\n\nAnd that\u0027s the same for the container listings below, right?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":746,"context_line":"            \u0027GET\u0027, \u0027/v1/a/c/o\u0027, HTTPOk, body\u003denc_body, headers\u003dhdrs)"},{"line_number":747,"context_line":"        resp \u003d req.get_response(self.decrypter)"},{"line_number":748,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":749,"context_line":"        self.assertIn(\u0027Error decrypting header X-Object-Sysmeta-Crypto-Etag\u0027,"},{"line_number":750,"context_line":"                      resp.body)"},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"    def test_GET_decryption_override(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_0e737e4e","line":749,"in_reply_to":"dab17558_64f262d4","updated":"2016-05-09 17:05:32.000000000","message":"Yes but IMHO it should not - seems wrong to return information that is meaningless to a client and leaks system implementation detail. So i am gradually reducing the 500 response bodies to more general content such as \"Error decrypting header\" and ensuring the logs have the detail.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"13f985c85ad6b304aeb888db3c96116675dfaa6d","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        self.assertEqual(len(plaintext), int(resp.headers[\u0027Content-Length\u0027]))"},{"line_number":578,"context_line":"        self.assertEqual(\u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":579,"context_line":"                         resp.headers[\u0027Content-Type\u0027])"},{"line_number":580,"context_line":""},{"line_number":581,"context_line":"    def test_GET_multipart_no_body_crypto_meta(self):"},{"line_number":582,"context_line":"        # build fake multipart response body"},{"line_number":583,"context_line":"        plaintext \u003d \u0027Cwm fjord veg balks nth pyx quiz\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_f16a1680","line":580,"updated":"2016-05-10 20:13:43.000000000","message":"Still lost a line:\n\n self.assertEqual(plaintext, resp.body)","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"65d9bf22fef187be3398390d6990006824a85db5","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        self.assertEqual(len(plaintext), int(resp.headers[\u0027Content-Length\u0027]))"},{"line_number":578,"context_line":"        self.assertEqual(\u0027multipart/byteranges;boundary\u003dmultipartboundary\u0027,"},{"line_number":579,"context_line":"                         resp.headers[\u0027Content-Type\u0027])"},{"line_number":580,"context_line":""},{"line_number":581,"context_line":"    def test_GET_multipart_no_body_crypto_meta(self):"},{"line_number":582,"context_line":"        # build fake multipart response body"},{"line_number":583,"context_line":"        plaintext \u003d \u0027Cwm fjord veg balks nth pyx quiz\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_0f05bd0f","line":580,"in_reply_to":"dab17558_f16a1680","updated":"2016-05-11 18:38:14.000000000","message":"argh! sorry\n\nhonestly, i am NOT trying to remove *your* lines of code :P","commit_id":"8dec66cf709f0b56fcc548338bf3fa80ea745251"}],"test/unit/common/middleware/test_encrypter.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":476,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":477,"context_line":"        self.assertIn(\u0027%s not in env\u0027 % CRYPTO_KEY_CALLBACK,"},{"line_number":478,"context_line":"                      self.encrypter.logger.get_lines_for_level(\u0027error\u0027)[0])"},{"line_number":479,"context_line":"        self.assertIn(\u0027Unable to retrieve encryption keys.\u0027, resp.body)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def test_PUT_error_in_key_callback(self):"},{"line_number":482,"context_line":"        def raise_exc():"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_24969a4c","line":479,"range":{"start_line":479,"start_character":19,"end_line":479,"end_character":21},"updated":"2016-05-06 21:25:34.000000000","message":"In or Equal?","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":476,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":477,"context_line":"        self.assertIn(\u0027%s not in env\u0027 % CRYPTO_KEY_CALLBACK,"},{"line_number":478,"context_line":"                      self.encrypter.logger.get_lines_for_level(\u0027error\u0027)[0])"},{"line_number":479,"context_line":"        self.assertIn(\u0027Unable to retrieve encryption keys.\u0027, resp.body)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def test_PUT_error_in_key_callback(self):"},{"line_number":482,"context_line":"        def raise_exc():"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_cecdf65e","line":479,"range":{"start_line":479,"start_character":19,"end_line":479,"end_character":21},"in_reply_to":"dab17558_24969a4c","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":494,"context_line":"        self.assertIn(\u0027from %s: Testing\u0027 % CRYPTO_KEY_CALLBACK,"},{"line_number":495,"context_line":"                      self.encrypter.logger.get_lines_for_level(\u0027error\u0027)[0])"},{"line_number":496,"context_line":"        self.assertIn(\u0027Unable to retrieve encryption keys.\u0027, resp.body)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    def test_PUT_encryption_override(self):"},{"line_number":499,"context_line":"        # set crypto override to disable encryption."}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_6477023b","line":496,"updated":"2016-05-06 21:25:34.000000000","message":"Ditto.","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        self.assertEqual(\u0027500 Internal Error\u0027, resp.status)"},{"line_number":494,"context_line":"        self.assertIn(\u0027from %s: Testing\u0027 % CRYPTO_KEY_CALLBACK,"},{"line_number":495,"context_line":"                      self.encrypter.logger.get_lines_for_level(\u0027error\u0027)[0])"},{"line_number":496,"context_line":"        self.assertIn(\u0027Unable to retrieve encryption keys.\u0027, resp.body)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    def test_PUT_encryption_override(self):"},{"line_number":499,"context_line":"        # set crypto override to disable encryption."}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_6e05ea78","line":496,"in_reply_to":"dab17558_6477023b","updated":"2016-05-09 17:05:32.000000000","message":"Done","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"}],"test/unit/common/middleware/test_encrypter_decrypter.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.assertEqual(\u0027encrypt me is updated\u0027,"},{"line_number":113,"context_line":"                         resp_dec.headers[\u0027x-object-meta-test\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def encrypt_value(self, value, key, crypto_meta_json):"},{"line_number":116,"context_line":"        crypto_meta \u003d json.loads(urllib.unquote_plus(crypto_meta_json))"},{"line_number":117,"context_line":"        crypto_meta[\u0027iv\u0027] \u003d base64.b64decode(crypto_meta[\u0027iv\u0027])"},{"line_number":118,"context_line":"        enc_ctxt \u003d Crypto().create_encryption_ctxt("}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_e435b246","line":115,"updated":"2016-05-06 21:25:34.000000000","message":"I\u0027m not seeing any callers for this...","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"208d1dbfa9083916437030d282f4d0d7bbe03a52","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.assertEqual(\u0027encrypt me is updated\u0027,"},{"line_number":113,"context_line":"                         resp_dec.headers[\u0027x-object-meta-test\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def encrypt_value(self, value, key, crypto_meta_json):"},{"line_number":116,"context_line":"        crypto_meta \u003d json.loads(urllib.unquote_plus(crypto_meta_json))"},{"line_number":117,"context_line":"        crypto_meta[\u0027iv\u0027] \u003d base64.b64decode(crypto_meta[\u0027iv\u0027])"},{"line_number":118,"context_line":"        enc_ctxt \u003d Crypto().create_encryption_ctxt("}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_aeb7d284","line":115,"in_reply_to":"dab17558_e435b246","updated":"2016-05-09 17:05:32.000000000","message":"hmmm, not sure where I was going with that, but you\u0027re right!","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"889555093942812236f2060fb173602713f1f1f3","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def encrypt_value(self, value, key, crypto_meta_json):"},{"line_number":116,"context_line":"        crypto_meta \u003d json.loads(urllib.unquote_plus(crypto_meta_json))"},{"line_number":117,"context_line":"        crypto_meta[\u0027iv\u0027] \u003d base64.b64decode(crypto_meta[\u0027iv\u0027])"},{"line_number":118,"context_line":"        enc_ctxt \u003d Crypto().create_encryption_ctxt("},{"line_number":119,"context_line":"            key, crypto_meta.get(\u0027iv\u0027))"},{"line_number":120,"context_line":"        return enc_ctxt.update(value)"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_24f97a81","line":119,"range":{"start_line":117,"start_character":8,"end_line":119,"end_character":39},"updated":"2016-05-06 21:25:34.000000000","message":"Or just\n\n        enc_ctxt \u003d Crypto().create_encryption_ctxt(\n            key, base64.b64decode(crypto_meta[\u0027iv\u0027]))","commit_id":"4e338e8af4ca0ae05182af54dfe5429449dc8183"}]}
