)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"fe6a3e54ab23ca15247ea3e8ed24cffcea6bf7e8","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-02-26 15:52:36 -0600"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP - Provides a simple skeleton of middleware for encryption feature."},{"line_number":8,"context_line":"encrypt/decrypt functions actually modifying content is commented out because several functests fail when the content changes.  I am looking into what needs to be done for each of these tests."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: I0f886e8e10f24a269f8dbd0ec650e208c57b2968"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a80dd14_285063d3","line":8,"updated":"2015-03-07 01:55:19.000000000","message":"Please insert an empty line after the short description. Currently \"git revew -l\" looks kinda bad.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"440a093e1473645426f20ae3f30d5bc6fb70a07a","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-02-26 15:52:36 -0600"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP - Provides a simple skeleton of middleware for encryption feature."},{"line_number":8,"context_line":"encrypt/decrypt functions actually modifying content is commented out because several functests fail when the content changes.  I am looking into what needs to be done for each of these tests."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: I0f886e8e10f24a269f8dbd0ec650e208c57b2968"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a80dd14_6de11fd0","line":8,"in_reply_to":"9a80dd14_285063d3","updated":"2015-03-10 20:32:47.000000000","message":"Will do very soon.  I am planning to have another patch in a day or two.  If you need this sooner, please let me know.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"}],"swift/common/middleware/crypto.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2010-2012 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_2e8d5d7c","line":1,"updated":"2015-03-04 17:36:28.000000000","message":"nit: its 2015 !)\nhttps://wiki.openstack.org/wiki/LegalIssuesFAQ","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2010-2012 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_ac2ceb4b","line":1,"in_reply_to":"9a80dd14_2e8d5d7c","updated":"2015-03-04 21:42:08.000000000","message":"thx.  I changed this in all the new files.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"}],"swift/common/middleware/decrypter.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from swift.common.utils import (get_logger)"},{"line_number":17,"context_line":"from swift.common.swob import Request, HTTPException"},{"line_number":18,"context_line":"from swift.common.middleware.crypto import Crypto"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class Decrypter(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_dbed5c8d","line":18,"updated":"2015-03-04 17:36:28.000000000","message":"do we need a separate module for the crypto methods, they will presumably just call out to a crypto library. Maybe revisit that choice as things flesh out, if there is very little in crypto.py?","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from swift.common.utils import (get_logger)"},{"line_number":17,"context_line":"from swift.common.swob import Request, HTTPException"},{"line_number":18,"context_line":"from swift.common.middleware.crypto import Crypto"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class Decrypter(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_aca14bab","line":18,"in_reply_to":"9a80dd14_dbed5c8d","updated":"2015-03-04 21:42:08.000000000","message":"I would like to keep it separate for now, and like you said, revisit the choice later.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class Decrypter(object):"},{"line_number":22,"context_line":"    \"\"\""},{"line_number":23,"context_line":"    Encryption middleware using AES in CTR mode with 256-bit keys"},{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    def __init__(self, app, conf):"},{"line_number":26,"context_line":"        self.app \u003d app"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_221d7110","line":23,"updated":"2015-03-04 17:36:28.000000000","message":"nit: this is decryption middleware !","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class Decrypter(object):"},{"line_number":22,"context_line":"    \"\"\""},{"line_number":23,"context_line":"    Encryption middleware using AES in CTR mode with 256-bit keys"},{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    def __init__(self, app, conf):"},{"line_number":26,"context_line":"        self.app \u003d app"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_cc8d9f33","line":23,"in_reply_to":"9a80dd14_221d7110","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        try:"},{"line_number":40,"context_line":"            # object"},{"line_number":41,"context_line":"            # If override is set in env, then just pass along"},{"line_number":42,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":43,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":44,"context_line":"                if req.method \u003d\u003d \"GET\":"},{"line_number":45,"context_line":"                    return self.obj_decrypt(env, start_response)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_65b6933f","line":42,"updated":"2015-03-04 17:36:28.000000000","message":"avoid the \\ by enclosing entire if condition in ()\n\n    if (x and y\n        and z\n        and req.method in (\"GET\", \"HEAD)):","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        try:"},{"line_number":40,"context_line":"            # object"},{"line_number":41,"context_line":"            # If override is set in env, then just pass along"},{"line_number":42,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":43,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":44,"context_line":"                if req.method \u003d\u003d \"GET\":"},{"line_number":45,"context_line":"                    return self.obj_decrypt(env, start_response)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_8caac76e","line":42,"in_reply_to":"9a80dd14_65b6933f","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            # object"},{"line_number":41,"context_line":"            # If override is set in env, then just pass along"},{"line_number":42,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":43,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":44,"context_line":"                if req.method \u003d\u003d \"GET\":"},{"line_number":45,"context_line":"                    return self.obj_decrypt(env, start_response)"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_82bc5d6e","line":43,"updated":"2015-03-04 17:36:28.000000000","message":"perhaps:\n\n  and not config_true_value(env.get(\u0027swift.crypto.override\u0027))\n\nimported from common.utils","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            # object"},{"line_number":41,"context_line":"            # If override is set in env, then just pass along"},{"line_number":42,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":43,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":44,"context_line":"                if req.method \u003d\u003d \"GET\":"},{"line_number":45,"context_line":"                    return self.obj_decrypt(env, start_response)"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_8c9007ee","line":43,"in_reply_to":"9a80dd14_82bc5d6e","updated":"2015-03-04 21:42:08.000000000","message":"ah, thanks for showing me that one.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            # If override is set in env, then just pass along"},{"line_number":42,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":43,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":44,"context_line":"                if req.method \u003d\u003d \"GET\":"},{"line_number":45,"context_line":"                    return self.obj_decrypt(env, start_response)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        except HTTPException as err_resp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_0225cdc1","line":44,"updated":"2015-03-04 17:36:28.000000000","message":"add this condition into single if statement above.\n\nadd condition:\n  and get_object_info[\u0027sysmeta\u0027].get(\u0027crypto-meta\u0027 is not None)\n\nbecause that is the hint that the object has been encrypted.\n\nAlso you need to handle HEAD method since the user metadata is returned with a HEAD and will need decrypting.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            # If override is set in env, then just pass along"},{"line_number":42,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":43,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":44,"context_line":"                if req.method \u003d\u003d \"GET\":"},{"line_number":45,"context_line":"                    return self.obj_decrypt(env, start_response)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        except HTTPException as err_resp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_57c1387f","line":44,"in_reply_to":"9a80dd14_0225cdc1","updated":"2015-03-04 21:42:08.000000000","message":"I could add the crypto-meta check to the same conditional with the override check.  I have to also set that value in the encrypter, so both ends of that will be added in the next patch.  HEAD case will also be added.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                    start_response_args[0][1].append((\u0027Content-Length\u0027, \u00270\u0027))"},{"line_number":75,"context_line":"                elif isinstance(iterable, list):"},{"line_number":76,"context_line":"                    start_response_args[0][1].append("},{"line_number":77,"context_line":"                        (\u0027Content-Length\u0027, str(sum(len(i) for i in iterable))))"},{"line_number":78,"context_line":"            start_response(*start_response_args[0])"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_db039c71","line":77,"updated":"2015-03-04 17:36:28.000000000","message":"not sure we need any of lines 61 - 77, looks like stuff proxy_logging does to ensure every response has a content-length\n\nwhat we do need to do is decrypt metadata headers before calling start_response,\nand extract the iv from get_object_info[\u0027sysmeta\u0027].get(\u0027crypto-meta\u0027)[\u0027iv\u0027]","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                    start_response_args[0][1].append((\u0027Content-Length\u0027, \u00270\u0027))"},{"line_number":75,"context_line":"                elif isinstance(iterable, list):"},{"line_number":76,"context_line":"                    start_response_args[0][1].append("},{"line_number":77,"context_line":"                        (\u0027Content-Length\u0027, str(sum(len(i) for i in iterable))))"},{"line_number":78,"context_line":"            start_response(*start_response_args[0])"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_d77e08e4","line":77,"in_reply_to":"9a80dd14_db039c71","updated":"2015-03-04 21:42:08.000000000","message":"removed the superfluous lines.\n\nWorking now on the metadata headers.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                while chunk:"},{"line_number":82,"context_line":"                    # invoke crypto providing key and ciphertext"},{"line_number":83,"context_line":"                    # TODO - decrypt one block at a time"},{"line_number":84,"context_line":"                    yield crypto.perform_decrypt(keys, chunk)"},{"line_number":85,"context_line":"                    chunk \u003d iterator.next()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"            except StopIteration:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_db88fce9","line":84,"updated":"2015-03-04 17:36:28.000000000","message":"pas iv as an arg","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                while chunk:"},{"line_number":82,"context_line":"                    # invoke crypto providing key and ciphertext"},{"line_number":83,"context_line":"                    # TODO - decrypt one block at a time"},{"line_number":84,"context_line":"                    yield crypto.perform_decrypt(keys, chunk)"},{"line_number":85,"context_line":"                    chunk \u003d iterator.next()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"            except StopIteration:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_d7652846","line":84,"in_reply_to":"9a80dd14_db88fce9","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            iterable \u003d self.app(env, my_start_response)"},{"line_number":97,"context_line":"        except Exception:"},{"line_number":98,"context_line":"            # TODO - take appropriate action here"},{"line_number":99,"context_line":"            raise"},{"line_number":100,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_65f9334d","line":97,"updated":"2015-03-04 17:36:28.000000000","message":"can we narrow down the exception type we expect to handle here? I suspect there may be none i.e. try/except not required (exceptions will be caught in catch_errors middleware which is always first in the pipeline)","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            iterable \u003d self.app(env, my_start_response)"},{"line_number":97,"context_line":"        except Exception:"},{"line_number":98,"context_line":"            # TODO - take appropriate action here"},{"line_number":99,"context_line":"            raise"},{"line_number":100,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_b29b62c8","line":97,"in_reply_to":"9a80dd14_65f9334d","updated":"2015-03-04 21:42:08.000000000","message":"removed try/except","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":101,"context_line":"            # Get the key from the keymaster"},{"line_number":102,"context_line":"            keys \u003d None"},{"line_number":103,"context_line":"            if env.get(\u0027swift.crypto.fetch_crypto_keys\u0027) is not None:"},{"line_number":104,"context_line":"                keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            if not keys:"},{"line_number":107,"context_line":"                if env.get(\u0027swift.crypto.override\u0027):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_1837fae4","line":104,"updated":"2015-03-04 17:36:28.000000000","message":"or get rid of the if using:\n\n  keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027, lambda : None)()","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":101,"context_line":"            # Get the key from the keymaster"},{"line_number":102,"context_line":"            keys \u003d None"},{"line_number":103,"context_line":"            if env.get(\u0027swift.crypto.fetch_crypto_keys\u0027) is not None:"},{"line_number":104,"context_line":"                keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            if not keys:"},{"line_number":107,"context_line":"                if env.get(\u0027swift.crypto.override\u0027):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_f2415a0c","line":104,"in_reply_to":"9a80dd14_1837fae4","updated":"2015-03-04 21:42:08.000000000","message":"good to know a better way to do that, thx!","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            if not keys:"},{"line_number":107,"context_line":"                if env.get(\u0027swift.crypto.override\u0027):"},{"line_number":108,"context_line":"                    # Encryption is not applicable here, so just return"},{"line_number":109,"context_line":"                    return self.app(env, my_start_response)"},{"line_number":110,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_18937aa4","line":107,"updated":"2015-03-04 17:36:28.000000000","message":"we already checked this at line 43?","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            if not keys:"},{"line_number":107,"context_line":"                if env.get(\u0027swift.crypto.override\u0027):"},{"line_number":108,"context_line":"                    # Encryption is not applicable here, so just return"},{"line_number":109,"context_line":"                    return self.app(env, my_start_response)"},{"line_number":110,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_526f8692","line":107,"in_reply_to":"9a80dd14_18937aa4","updated":"2015-03-04 21:42:08.000000000","message":"there was some point in my testing that this wasn\u0027t set in the env in time for the earlier check, so this check was needed.  I need to revisit why the other one wasn\u0027t set in time.  I will remove the redundant check.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    return self.app(env, my_start_response)"},{"line_number":110,"context_line":"                else:"},{"line_number":111,"context_line":"                    # no keys is bad (wouldn\u0027t be here if not encrypted)"},{"line_number":112,"context_line":"                    # TODO - which type of Exception exactly?"},{"line_number":113,"context_line":"                    raise HTTPException("},{"line_number":114,"context_line":"                        \u0027ERROR: no crypto keys were found for %s\u0027 % env.path)"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_584b32b0","line":112,"updated":"2015-03-04 17:36:28.000000000","message":"Hmmm, 503?\n\nWe might want to differentiate in exception message between not finding \u0027swift.crypto.fetch_crypto_keys\u0027 vs. finding it, calling it and getting an empty dict or None. I can imagine that being useful at least during development and testing keymaster interactions.\n\nSo scrap my comment at line 104, maybe:\n\n  try:\n      fetch_crypto_keys \u003d env[\u0027swift.crypto.fetch_crypto_keys\u0027]\n      keys \u003d fetch_crypto_keys()\n  except KeyError:\n      self.logger.warn(\u0027swift.crypto.fetch_crypto_keys missing from request env\u0027)\n      raise HTTPServiceUnavailable()\n  except TypeError:\n      self.logger.warn(\u0027swift.crypto.fetch_crypto_keys not callable\u0027)\n      raise HTTPServiceUnavailable()\n  except Exception (or narrower e.g. KeyMasterException if that ever is a thing):\n      self.logger.warn(\u0027keymaster blew up\u0027)\n      raise HTTPServiceUnavailable()","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    return self.app(env, my_start_response)"},{"line_number":110,"context_line":"                else:"},{"line_number":111,"context_line":"                    # no keys is bad (wouldn\u0027t be here if not encrypted)"},{"line_number":112,"context_line":"                    # TODO - which type of Exception exactly?"},{"line_number":113,"context_line":"                    raise HTTPException("},{"line_number":114,"context_line":"                        \u0027ERROR: no crypto keys were found for %s\u0027 % env.path)"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_d29a9613","line":112,"in_reply_to":"9a80dd14_584b32b0","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        def iter_response(iterable, crypto_ctxt, etag, c_range):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"            plaintext_etag \u003d md5()"},{"line_number":75,"context_line":"            iterator \u003d iter(iterable)"},{"line_number":76,"context_line":"            bytes_processed \u003d 0"},{"line_number":77,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_a4c9937a","line":74,"updated":"2015-05-15 16:54:50.000000000","message":"Not sure why one should validate the plaintext etag here during a GET; is this also done with non-encrypted objects?  wouldn\u0027t the client do this with the Etag of plaintext, if it really wants to?  This just slows down proxy server processing, even if client doesn\u0027t ask for it.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        def iter_response(iterable, crypto_ctxt, etag, c_range):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"            plaintext_etag \u003d md5()"},{"line_number":75,"context_line":"            iterator \u003d iter(iterable)"},{"line_number":76,"context_line":"            bytes_processed \u003d 0"},{"line_number":77,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_855bb985","line":74,"in_reply_to":"7a016987_a4c9937a","updated":"2015-05-31 13:03:35.000000000","message":"removed this.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                if callable(close_method):"},{"line_number":91,"context_line":"                    close_method"},{"line_number":92,"context_line":"            actual_etag \u003d plaintext_etag.hexdigest()"},{"line_number":93,"context_line":"            # TODO - how can we validate the ranged GET body? etag is for whole"},{"line_number":94,"context_line":"            if not c_range and (etag !\u003d actual_etag):"},{"line_number":95,"context_line":"                self.logger.error(\u0027Error: Saved etag does not match body\u0027)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_849b3772","line":93,"updated":"2015-05-15 16:54:50.000000000","message":"You cannot, this case must be ignored.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                if callable(close_method):"},{"line_number":91,"context_line":"                    close_method"},{"line_number":92,"context_line":"            actual_etag \u003d plaintext_etag.hexdigest()"},{"line_number":93,"context_line":"            # TODO - how can we validate the ranged GET body? etag is for whole"},{"line_number":94,"context_line":"            if not c_range and (etag !\u003d actual_etag):"},{"line_number":95,"context_line":"                self.logger.error(\u0027Error: Saved etag does not match body\u0027)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_254d25c4","line":93,"in_reply_to":"7a016987_849b3772","updated":"2015-05-31 13:03:35.000000000","message":"removed comment.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                crypto_meta \u003d base64.b64decode(self._response_header_value("},{"line_number":221,"context_line":"                    \u0027X-Object-Massmeta-Crypto-Meta-\u0027 + short_name))"},{"line_number":222,"context_line":"                if crypto_meta:"},{"line_number":223,"context_line":"                    # must be encrypted and encoded"},{"line_number":224,"context_line":"                    mod_hdr_keys.append(hdr.lower())"},{"line_number":225,"context_line":"                    mod_hdr_pairs.append((hdr, extract_header_val("},{"line_number":226,"context_line":"                        self.decrypter.crypto, self.decrypter.logger,"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_44d77f23","line":223,"updated":"2015-05-15 16:54:50.000000000","message":"-\u003e decrypted and decoded","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                crypto_meta \u003d base64.b64decode(self._response_header_value("},{"line_number":221,"context_line":"                    \u0027X-Object-Massmeta-Crypto-Meta-\u0027 + short_name))"},{"line_number":222,"context_line":"                if crypto_meta:"},{"line_number":223,"context_line":"                    # must be encrypted and encoded"},{"line_number":224,"context_line":"                    mod_hdr_keys.append(hdr.lower())"},{"line_number":225,"context_line":"                    mod_hdr_pairs.append((hdr, extract_header_val("},{"line_number":226,"context_line":"                        self.decrypter.crypto, self.decrypter.logger,"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_85d299cf","line":223,"in_reply_to":"7a016987_44d77f23","updated":"2015-05-31 13:03:35.000000000","message":"clarified","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"def extract_header_val(crypto, logger, value, key, iv\u003dNone,"},{"line_number":271,"context_line":"                       crypto_meta_st\u003dNone, value_has_meta\u003dFalse,"},{"line_number":272,"context_line":"                       decode\u003dTrue):"},{"line_number":273,"context_line":"    \"\"\""},{"line_number":274,"context_line":"    Either iv is given, or a crypto_meta_st must be provided in order to"},{"line_number":275,"context_line":"    parse for cipher and iv."}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_249a4364","line":272,"updated":"2015-05-15 16:54:50.000000000","message":"Analogous to my comment on the encrypter, could this be called decrypt_header_val() ?\n\nHowever, elsewhere in the decrypter code, the process_resp_headers() fits\nwell and better than anything with _decrypt_ because of all the extra processing involved.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"def extract_header_val(crypto, logger, value, key, iv\u003dNone,"},{"line_number":271,"context_line":"                       crypto_meta_st\u003dNone, value_has_meta\u003dFalse,"},{"line_number":272,"context_line":"                       decode\u003dTrue):"},{"line_number":273,"context_line":"    \"\"\""},{"line_number":274,"context_line":"    Either iv is given, or a crypto_meta_st must be provided in order to"},{"line_number":275,"context_line":"    parse for cipher and iv."}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_65de7dde","line":272,"in_reply_to":"7a016987_249a4364","updated":"2015-05-31 13:03:35.000000000","message":"removed the term extract","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                                    # TODO -find out why this happens functests"},{"line_number":497,"context_line":"                                    #return None"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"                                if \u0027; meta\u0027 in orig:"},{"line_number":500,"context_line":"                                    # having implies encrypted and encoded"},{"line_number":501,"context_line":"                                    SubElement(obj_element, field).text \u003d \\"},{"line_number":502,"context_line":"                                        extract_header_val("}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_c49fef4e","line":499,"updated":"2015-05-15 16:54:50.000000000","message":"How robust is this check? If other functions would ever add \u0027; meta\u0027 into\ntheir headers, this might not be safe.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                                    # TODO -find out why this happens functests"},{"line_number":497,"context_line":"                                    #return None"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"                                if \u0027; meta\u0027 in orig:"},{"line_number":500,"context_line":"                                    # having implies encrypted and encoded"},{"line_number":501,"context_line":"                                    SubElement(obj_element, field).text \u003d \\"},{"line_number":502,"context_line":"                                        extract_header_val("}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_e5beed63","line":499,"in_reply_to":"7a016987_c49fef4e","updated":"2015-05-31 13:03:35.000000000","message":"I agree it isn\u0027t a great way.  This logic can change a bit when the need for fake_footers is removed, and we start processing the etag here.  When that is done, we can also go by the length of the etag.  If it is longer than the size it should be, AND it has the crypto-meta, then its pretty safe to assume all the metadata needs to be decrypted.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"}],"swift/common/middleware/encrypter.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from swift.common.utils import (get_logger)"},{"line_number":17,"context_line":"from swift.common.swob import Request, HTTPException"},{"line_number":18,"context_line":"from swift.common.middleware.crypto import Crypto"},{"line_number":19,"context_line":"from swift.common.wsgi import WSGIContext"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_1b5b7455","line":16,"updated":"2015-03-04 17:36:28.000000000","message":"nit: the () here seem anomalous w.r.t. the other import statements","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from swift.common.utils import (get_logger)"},{"line_number":17,"context_line":"from swift.common.swob import Request, HTTPException"},{"line_number":18,"context_line":"from swift.common.middleware.crypto import Crypto"},{"line_number":19,"context_line":"from swift.common.wsgi import WSGIContext"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_525b0654","line":16,"in_reply_to":"9a80dd14_1b5b7455","updated":"2015-03-04 21:42:08.000000000","message":"fixed in all the new files","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            return self.app(env, start_response)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        try:"},{"line_number":55,"context_line":"            # object"},{"line_number":56,"context_line":"            # If override is set in env, then just pass along"},{"line_number":57,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":58,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_563143eb","line":55,"updated":"2015-03-04 17:36:28.000000000","message":"we will need to add container and account support for encrypting their user metadata","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            return self.app(env, start_response)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        try:"},{"line_number":55,"context_line":"            # object"},{"line_number":56,"context_line":"            # If override is set in env, then just pass along"},{"line_number":57,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":58,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_ddd54744","line":55,"in_reply_to":"9a80dd14_563143eb","updated":"2015-03-04 21:42:08.000000000","message":"I saw that you mentioned later you were ok with focusing on only object for now.  I did add a \"TODO\" for the cont/acct block in both encrypter and decrypter, however.  :-)","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            # object"},{"line_number":56,"context_line":"            # If override is set in env, then just pass along"},{"line_number":57,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":58,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":59,"context_line":"                if req.method \u003d\u003d \"PUT\":"},{"line_number":60,"context_line":"                    return self.obj_encrypt(env, start_response)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_fb24e0c7","line":58,"updated":"2015-03-04 17:36:28.000000000","message":"check out swift.common.utils.config_true_value","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            # object"},{"line_number":56,"context_line":"            # If override is set in env, then just pass along"},{"line_number":57,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":58,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":59,"context_line":"                if req.method \u003d\u003d \"PUT\":"},{"line_number":60,"context_line":"                    return self.obj_encrypt(env, start_response)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_9d52efdb","line":58,"in_reply_to":"9a80dd14_fb24e0c7","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            # If override is set in env, then just pass along"},{"line_number":57,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":58,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":59,"context_line":"                if req.method \u003d\u003d \"PUT\":"},{"line_number":60,"context_line":"                    return self.obj_encrypt(env, start_response)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        except HTTPException as err_resp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_3b2f58a3","line":59,"updated":"2015-03-04 17:36:28.000000000","message":"or POST - we need to encrypt metadata headers on a POST","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            # If override is set in env, then just pass along"},{"line_number":57,"context_line":"            if path_acc and path_cont and path_obj and \\"},{"line_number":58,"context_line":"                    (env.get(\u0027swift.crypto.override\u0027) is None):"},{"line_number":59,"context_line":"                if req.method \u003d\u003d \"PUT\":"},{"line_number":60,"context_line":"                    return self.obj_encrypt(env, start_response)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        except HTTPException as err_resp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_dd0aa7d1","line":59,"in_reply_to":"9a80dd14_3b2f58a3","updated":"2015-03-04 21:42:08.000000000","message":"yes, added the POST case.  Working on the metadata changes now.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        # Get the key from the keymaster"},{"line_number":71,"context_line":"        keys \u003d None"},{"line_number":72,"context_line":"        if env.get(\u0027swift.crypto.fetch_crypto_keys\u0027) is not None:"},{"line_number":73,"context_line":"            keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if not keys:"},{"line_number":76,"context_line":"            if env.get(\u0027swift.crypto.override\u0027):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_d67373af","line":73,"updated":"2015-03-04 17:36:28.000000000","message":"see comment in decrypter about differentiating errorswhen interacting with keymaster","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        # Get the key from the keymaster"},{"line_number":71,"context_line":"        keys \u003d None"},{"line_number":72,"context_line":"        if env.get(\u0027swift.crypto.fetch_crypto_keys\u0027) is not None:"},{"line_number":73,"context_line":"            keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if not keys:"},{"line_number":76,"context_line":"            if env.get(\u0027swift.crypto.override\u0027):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_5df6b7d8","line":73,"in_reply_to":"9a80dd14_d67373af","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if not keys:"},{"line_number":76,"context_line":"            if env.get(\u0027swift.crypto.override\u0027):"},{"line_number":77,"context_line":"                # Encryption is not applicable here, so just return"},{"line_number":78,"context_line":"                return self.app(env, start_response)"},{"line_number":79,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_7682c753","line":76,"updated":"2015-03-04 17:36:28.000000000","message":"as per decrypter - already checked this condition","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            keys \u003d env.get(\u0027swift.crypto.fetch_crypto_keys\u0027)()"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if not keys:"},{"line_number":76,"context_line":"            if env.get(\u0027swift.crypto.override\u0027):"},{"line_number":77,"context_line":"                # Encryption is not applicable here, so just return"},{"line_number":78,"context_line":"                return self.app(env, start_response)"},{"line_number":79,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_7d49bbcf","line":76,"in_reply_to":"9a80dd14_7682c753","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                # TODO - which type of Exception exactly?"},{"line_number":82,"context_line":"                raise HTTPException("},{"line_number":83,"context_line":"                    \u0027ERROR: no crypto keys were found for %s\u0027 % env.path)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        enc_input_proxy \u003d EncInputProxy(env[\u0027wsgi.input\u0027], self.crypto, keys)"},{"line_number":86,"context_line":"        env[\u0027wsgi.input\u0027] \u003d enc_input_proxy"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_76bac7e2","line":84,"updated":"2015-03-04 17:36:28.000000000","message":"* generate an IV\n* encrypt metadata headers\n* add crypto-related headers","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                # TODO - which type of Exception exactly?"},{"line_number":82,"context_line":"                raise HTTPException("},{"line_number":83,"context_line":"                    \u0027ERROR: no crypto keys were found for %s\u0027 % env.path)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        enc_input_proxy \u003d EncInputProxy(env[\u0027wsgi.input\u0027], self.crypto, keys)"},{"line_number":86,"context_line":"        env[\u0027wsgi.input\u0027] \u003d enc_input_proxy"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_1dd7dfc2","line":84,"in_reply_to":"9a80dd14_76bac7e2","updated":"2015-03-04 21:42:08.000000000","message":"yes, working on these things now.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                raise HTTPException("},{"line_number":83,"context_line":"                    \u0027ERROR: no crypto keys were found for %s\u0027 % env.path)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        enc_input_proxy \u003d EncInputProxy(env[\u0027wsgi.input\u0027], self.crypto, keys)"},{"line_number":86,"context_line":"        env[\u0027wsgi.input\u0027] \u003d enc_input_proxy"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        return self.app(env, start_response)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_b6b43ff3","line":85,"updated":"2015-03-04 17:36:28.000000000","message":"pass iv as arg","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                raise HTTPException("},{"line_number":83,"context_line":"                    \u0027ERROR: no crypto keys were found for %s\u0027 % env.path)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        enc_input_proxy \u003d EncInputProxy(env[\u0027wsgi.input\u0027], self.crypto, keys)"},{"line_number":86,"context_line":"        env[\u0027wsgi.input\u0027] \u003d enc_input_proxy"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        return self.app(env, start_response)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_7de53ba7","line":85,"in_reply_to":"9a80dd14_b6b43ff3","updated":"2015-03-04 21:42:08.000000000","message":"Done","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":91,"context_line":"class EncInputProxy(object):"},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    File-like object that counts bytes read."},{"line_number":94,"context_line":"    To be swapped in for wsgi.input for accounting purposes."},{"line_number":95,"context_line":"    \"\"\""},{"line_number":96,"context_line":"    def __init__(self, wsgi_input, crypto, keys):"},{"line_number":97,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_36904f95","line":94,"updated":"2015-03-04 17:36:28.000000000","message":"whose accounting? :)","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":91,"context_line":"class EncInputProxy(object):"},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    File-like object that counts bytes read."},{"line_number":94,"context_line":"    To be swapped in for wsgi.input for accounting purposes."},{"line_number":95,"context_line":"    \"\"\""},{"line_number":96,"context_line":"    def __init__(self, wsgi_input, crypto, keys):"},{"line_number":97,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_7daa9b1a","line":94,"in_reply_to":"9a80dd14_36904f95","updated":"2015-03-04 21:42:08.000000000","message":"lol.  that was a copy/paste thing, but you probably knew that.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        :param wsgi_input: file-like object to wrap the functionality of"},{"line_number":99,"context_line":"        \"\"\""},{"line_number":100,"context_line":"        self.wsgi_input \u003d wsgi_input"},{"line_number":101,"context_line":"        self.bytes_received \u003d 0"},{"line_number":102,"context_line":"        self.client_disconnect \u003d False"},{"line_number":103,"context_line":"        self.crypto \u003d crypto"},{"line_number":104,"context_line":"        self.keys \u003d keys"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_96a65bc0","line":101,"updated":"2015-03-04 17:36:28.000000000","message":"we don\u0027t care about byte count","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        :param wsgi_input: file-like object to wrap the functionality of"},{"line_number":99,"context_line":"        \"\"\""},{"line_number":100,"context_line":"        self.wsgi_input \u003d wsgi_input"},{"line_number":101,"context_line":"        self.bytes_received \u003d 0"},{"line_number":102,"context_line":"        self.client_disconnect \u003d False"},{"line_number":103,"context_line":"        self.crypto \u003d crypto"},{"line_number":104,"context_line":"        self.keys \u003d keys"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_9d2cafad","line":101,"in_reply_to":"9a80dd14_96a65bc0","updated":"2015-03-04 21:42:08.000000000","message":"ok.  That was in the example I took this from, so I left it because I thought we might need it when we are encrypting block-by-block.  I can remove it now, and add back if needed.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a42bdba6e9de74abd0374937d1de95b34a8b3f01","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        :param wsgi_input: file-like object to wrap the functionality of"},{"line_number":99,"context_line":"        \"\"\""},{"line_number":100,"context_line":"        self.wsgi_input \u003d wsgi_input"},{"line_number":101,"context_line":"        self.bytes_received \u003d 0"},{"line_number":102,"context_line":"        self.client_disconnect \u003d False"},{"line_number":103,"context_line":"        self.crypto \u003d crypto"},{"line_number":104,"context_line":"        self.keys \u003d keys"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_9defe1e8","line":101,"in_reply_to":"9a80dd14_9d2cafad","updated":"2015-03-06 16:47:57.000000000","message":"Christian has begun to work on the actual crypto part, and has said that he needs to know at the time of the \"encrypt\" call whether it is the start, middle, or end of a message.  It seems like this would be an easy way to provide that, and the added info might be necessary for some keymasters : we want to keep the interface open to allow for different methods.  Let me know, though, if leaving the byte counting is a problem.","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            self.client_disconnect \u003d True"},{"line_number":131,"context_line":"            raise"},{"line_number":132,"context_line":"        self.bytes_received +\u003d len(line)"},{"line_number":133,"context_line":"        return line"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def filter_factory(global_conf, **local_conf):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_16926b57","line":133,"updated":"2015-03-04 17:36:28.000000000","message":"encrypt first","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            self.client_disconnect \u003d True"},{"line_number":131,"context_line":"            raise"},{"line_number":132,"context_line":"        self.bytes_received +\u003d len(line)"},{"line_number":133,"context_line":"        return line"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def filter_factory(global_conf, **local_conf):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_5810854e","line":133,"in_reply_to":"9a80dd14_16926b57","updated":"2015-03-04 21:42:08.000000000","message":"oops!  :-/","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                raise HTTPUnprocessableEntity(request\u003dreq)"},{"line_number":122,"context_line":"            # pass-in the container encrypted ct value"},{"line_number":123,"context_line":"            # Note: it is ok to re-use the iv because its a different key,"},{"line_number":124,"context_line":"            # and same content"},{"line_number":125,"context_line":"            req.headers[be_ct_key] \u003d prepare_header_val("},{"line_number":126,"context_line":"                self.encrypter.crypto, ct, keys[\u0027container\u0027],"},{"line_number":127,"context_line":"                crypto_meta\u003dct_crypto_meta)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_a46d139a","line":124,"updated":"2015-05-15 16:54:50.000000000","message":"You culd remove the 2nd part of this comment, only 1st part is relevant, the content doesn\u0027t matter.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                raise HTTPUnprocessableEntity(request\u003dreq)"},{"line_number":122,"context_line":"            # pass-in the container encrypted ct value"},{"line_number":123,"context_line":"            # Note: it is ok to re-use the iv because its a different key,"},{"line_number":124,"context_line":"            # and same content"},{"line_number":125,"context_line":"            req.headers[be_ct_key] \u003d prepare_header_val("},{"line_number":126,"context_line":"                self.encrypter.crypto, ct, keys[\u0027container\u0027],"},{"line_number":127,"context_line":"                crypto_meta\u003dct_crypto_meta)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_a56b55f0","line":124,"in_reply_to":"7a016987_a46d139a","updated":"2015-05-31 13:03:35.000000000","message":"done.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":226,"context_line":"    return Crypto(conf)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"def prepare_header_val(crypto, value, key, iv\u003dNone, crypto_meta\u003dNone):"},{"line_number":230,"context_line":"    \"\"\""},{"line_number":231,"context_line":"    encrypt, add crypto meta if supplied, encode."},{"line_number":232,"context_line":"    do not supply an iv if you supply a crypto_meta dict with iv."}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_84ba1709","line":229,"updated":"2015-05-15 16:54:50.000000000","message":"For alignment with other function names, and because it does much more\nthan preparing, I suggest to rename\n  prepare_header_val()\nto\n  process_header_val()\n\n... or even encrypt_header_val() ?","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":226,"context_line":"    return Crypto(conf)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"def prepare_header_val(crypto, value, key, iv\u003dNone, crypto_meta\u003dNone):"},{"line_number":230,"context_line":"    \"\"\""},{"line_number":231,"context_line":"    encrypt, add crypto meta if supplied, encode."},{"line_number":232,"context_line":"    do not supply an iv if you supply a crypto_meta dict with iv."}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_05a46948","line":229,"in_reply_to":"7a016987_84ba1709","updated":"2015-05-31 13:03:35.000000000","message":"changed to use encrypt instead of prepare","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":11330,"name":"Christian Cachin","email":"cca@zurich.ibm.com","username":"cca88"},"change_message_id":"1983fc0eca9835a3643e08a36850541c1b8f9a05","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            self.footers_to_add[\u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027] \u003d \\"},{"line_number":337,"context_line":"                base64.b64encode(str(etag_crypto_meta))"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"            # Note: ok to re-use iv because its a diff key, and same content"},{"line_number":340,"context_line":"            plaintext_etag_cek \u003d prepare_header_val("},{"line_number":341,"context_line":"                self.crypto, self.plaintext_etag, self.keys[\u0027container\u0027],"},{"line_number":342,"context_line":"                crypto_meta\u003detag_crypto_meta)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_44309f9e","line":339,"updated":"2015-05-15 16:54:50.000000000","message":"You culd remove the 2nd part of this comment, only 1st part is relevant, the content doesn\u0027t matter.","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"22d7ed2c23c1baecf6f654120c8fb6862cf65979","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            self.footers_to_add[\u0027X-Object-Sysmeta-Crypto-Meta-Etag\u0027] \u003d \\"},{"line_number":337,"context_line":"                base64.b64encode(str(etag_crypto_meta))"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"            # Note: ok to re-use iv because its a diff key, and same content"},{"line_number":340,"context_line":"            plaintext_etag_cek \u003d prepare_header_val("},{"line_number":341,"context_line":"                self.crypto, self.plaintext_etag, self.keys[\u0027container\u0027],"},{"line_number":342,"context_line":"                crypto_meta\u003detag_crypto_meta)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a016987_e565cd1d","line":339,"in_reply_to":"7a016987_44309f9e","updated":"2015-05-31 13:03:35.000000000","message":"done","commit_id":"4bfb4465dbe9d9c123b69d9e079e1d5a3cdeb6bc"}],"swift/common/middleware/keymaster.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        # TODO - check for X-Object-Sysmeta-Crypto-Meta data if object, etc."},{"line_number":40,"context_line":"        noEncryptMeta \u003d False"},{"line_number":41,"context_line":"        if noEncryptMeta:"},{"line_number":42,"context_line":"            env[\u0027swift.crypto.override\u0027] \u003d True"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def fetch_crypto_keys(self):"},{"line_number":45,"context_line":"        return self.current_keys"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_b69fdf02","line":42,"updated":"2015-03-04 17:36:28.000000000","message":"yup :)","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"52b2c5193826d40d7440e0d0775591fea7bbea1d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if noEncryptMeta:"},{"line_number":42,"context_line":"            env[\u0027swift.crypto.override\u0027] \u003d True"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def fetch_crypto_keys(self):"},{"line_number":45,"context_line":"        return self.current_keys"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_96f3bb72","line":44,"updated":"2015-03-04 17:36:28.000000000","message":"we probably want to generate a key based on the request path. What we could do is make the method signature be:\n\n  fetch_crypto_keys(self, env)\n\nso we get the request env when called back by de/en-crypter\n\nThen make \u0027swift.crypto.fetch_crypto_keys\u0027 a partial function at line 33:\n\n  env[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d functools.partial(self.fetch_crypto_keys, env)\n\nThere\u0027s an example of this pattern in keystoneauth line 170","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"aa84f5d08efc989db13dcbc6d36441cafbe9751c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if noEncryptMeta:"},{"line_number":42,"context_line":"            env[\u0027swift.crypto.override\u0027] \u003d True"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def fetch_crypto_keys(self):"},{"line_number":45,"context_line":"        return self.current_keys"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_58e4050d","line":44,"in_reply_to":"9a80dd14_96f3bb72","updated":"2015-03-04 21:42:08.000000000","message":"Since you said to not focus too much on keymaster in the IRC, I will note this for the future when the direction does come back to this.  I remember the spec saying that the fetch_crypto_keys should be a no-arg call.  I figured there was some reason for that restriction.  Is there not?","commit_id":"3c681513ee9c4810af3f9c766e13ca6ad5a262ee"}]}
