)]}'
{"etc/proxy-server.conf-sample":[{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"[pipeline:main]"},{"line_number":80,"context_line":"pipeline \u003d catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl ratelimit tempauth container-quotas account-quotas slo dlo proxy-logging proxy-server"},{"line_number":81,"context_line":"# Add trivialkeymaster between dlo and proxy-logging"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"[app:proxy-server]"},{"line_number":84,"context_line":"use \u003d egg:swift#proxy"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"3a50d1a3_26ad3a84","line":81,"updated":"2015-07-29 01:37:24.000000000","message":"I think generally the comment regarding where to add the middleware is just  in the filter definition (and you happen to already have that there : ), so just delete this line potentially ?","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"[pipeline:main]"},{"line_number":80,"context_line":"pipeline \u003d catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl ratelimit tempauth container-quotas account-quotas slo dlo proxy-logging proxy-server"},{"line_number":81,"context_line":"# Add trivialkeymaster between dlo and proxy-logging"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"[app:proxy-server]"},{"line_number":84,"context_line":"use \u003d egg:swift#proxy"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"3a50d1a3_ea408237","line":81,"in_reply_to":"3a50d1a3_26ad3a84","updated":"2015-08-01 19:00:08.000000000","message":"removed.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":705,"context_line":"# unwind the iterator of applications"},{"line_number":706,"context_line":"# unwind \u003d false"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline. "},{"line_number":709,"context_line":"[filter:trivialkeymaster]"},{"line_number":710,"context_line":"use \u003d egg:swift#trivialkeymaster"},{"line_number":711,"context_line":"# This option is part of enabling encryption"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"3a50d1a3_269c5a0d","line":708,"updated":"2015-07-29 01:37:24.000000000","message":"There\u0027s a trailing white space char (i.e. \u0027 \u0027)","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":705,"context_line":"# unwind the iterator of applications"},{"line_number":706,"context_line":"# unwind \u003d false"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline. "},{"line_number":709,"context_line":"[filter:trivialkeymaster]"},{"line_number":710,"context_line":"use \u003d egg:swift#trivialkeymaster"},{"line_number":711,"context_line":"# This option is part of enabling encryption"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"3a50d1a3_0a3ccebd","line":708,"in_reply_to":"3a50d1a3_269c5a0d","updated":"2015-08-01 19:00:08.000000000","message":"removed.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":708,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline. "},{"line_number":709,"context_line":"[filter:trivialkeymaster]"},{"line_number":710,"context_line":"use \u003d egg:swift#trivialkeymaster"},{"line_number":711,"context_line":"# This option is part of enabling encryption"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"3a50d1a3_a64b8ab0","line":711,"updated":"2015-07-29 01:37:24.000000000","message":"I find the example configuration files don\u0027t really stick to any one convention regarding where to put comments i.e. above and/or below the filter definition.  Maybe consider setting a precedence and keeping them all above for clarity ?","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":708,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline. "},{"line_number":709,"context_line":"[filter:trivialkeymaster]"},{"line_number":710,"context_line":"use \u003d egg:swift#trivialkeymaster"},{"line_number":711,"context_line":"# This option is part of enabling encryption"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"3a50d1a3_ca458643","line":711,"in_reply_to":"3a50d1a3_a64b8ab0","updated":"2015-08-01 19:00:08.000000000","message":"moved to the top.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":705,"context_line":"# unwind \u003d false"},{"line_number":706,"context_line":""},{"line_number":707,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline."},{"line_number":708,"context_line":"# This option is part of enabling encryption"},{"line_number":709,"context_line":"[filter:trivialkeymaster]"},{"line_number":710,"context_line":"use \u003d egg:swift#trivialkeymaster"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"3a50d1a3_459ba766","line":708,"updated":"2015-08-01 20:15:34.000000000","message":"This looks much better !  Maybe just add \"this option is part of enabling encryption for testing purposes\".  Just so its clear folks don\u0027t use this for production.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":705,"context_line":"# unwind \u003d false"},{"line_number":706,"context_line":""},{"line_number":707,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline."},{"line_number":708,"context_line":"# This option is part of enabling encryption"},{"line_number":709,"context_line":"[filter:trivialkeymaster]"},{"line_number":710,"context_line":"use \u003d egg:swift#trivialkeymaster"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"1a4dcd0f_5700dd65","line":708,"in_reply_to":"3a50d1a3_459ba766","updated":"2015-08-10 03:18:26.000000000","message":"done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":716,"context_line":"# allow_versioned_writes \u003d false"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline."},{"line_number":719,"context_line":"# This option is part of enabling encryption for testing purposes"},{"line_number":720,"context_line":"[filter:trivialkeymaster]"},{"line_number":721,"context_line":"use \u003d egg:swift#trivialkeymaster"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"da20952f_1b248db0","line":719,"updated":"2015-09-08 18:43:11.000000000","message":"NIT - End this sentence with a period.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":716,"context_line":"# allow_versioned_writes \u003d false"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"# Note: Put trivialkeymaster between dlo and proxy-logging in the pipeline."},{"line_number":719,"context_line":"# This option is part of enabling encryption for testing purposes"},{"line_number":720,"context_line":"[filter:trivialkeymaster]"},{"line_number":721,"context_line":"use \u003d egg:swift#trivialkeymaster"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"da20952f_06e416aa","line":719,"in_reply_to":"da20952f_1b248db0","updated":"2015-09-09 14:41:05.000000000","message":"Done","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":715,"context_line":"# deprecated. See documentation for more details."},{"line_number":716,"context_line":"# allow_versioned_writes \u003d false"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"# Note: Put trivial_keymaster between dlo and proxy-logging in the pipeline."},{"line_number":719,"context_line":"# This option is part of enabling encryption for testing purposes."},{"line_number":720,"context_line":"[filter:trivial_keymaster]"},{"line_number":721,"context_line":"use \u003d egg:swift#trivial_keymaster"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"da20952f_6d65981b","line":718,"updated":"2015-09-09 18:27:57.000000000","message":"NIT - Just thinking this through the trivial_keymaster is essentially useless on its own so I\u0027m not sure it makes much sense to state where it should go in relation to the rest of the pipeline vs say the other crypto middleware.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"}],"setup.cfg":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    xprofile \u003d swift.common.middleware.xprofile:filter_factory"},{"line_number":98,"context_line":"    versioned_writes \u003d swift.common.middleware.versioned_writes:filter_factory"},{"line_number":99,"context_line":"    fake_footers \u003d swift.common.middleware.fake_footers:filter_factory"},{"line_number":100,"context_line":"    test_fake_footers \u003d swift.common.middleware.test_fake_footers:filter_factory"},{"line_number":101,"context_line":"    trivialkeymaster \u003d swift.common.middleware.trivial_keymaster:filter_factory"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"[build_sphinx]"}],"source_content_type":"text/x-ttcn-cfg","patch_set":13,"id":"da20952f_e6bfa25e","line":100,"updated":"2015-09-09 14:41:05.000000000","message":"delete ^^","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    versioned_writes \u003d swift.common.middleware.versioned_writes:filter_factory"},{"line_number":99,"context_line":"    fake_footers \u003d swift.common.middleware.fake_footers:filter_factory"},{"line_number":100,"context_line":"    test_fake_footers \u003d swift.common.middleware.test_fake_footers:filter_factory"},{"line_number":101,"context_line":"    trivialkeymaster \u003d swift.common.middleware.trivial_keymaster:filter_factory"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"[build_sphinx]"},{"line_number":104,"context_line":"all_files \u003d 1"}],"source_content_type":"text/x-ttcn-cfg","patch_set":13,"id":"da20952f_bb3561dc","line":101,"updated":"2015-09-08 18:43:11.000000000","message":"For consistency should we rename the filter to trivial_keymaster ?","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    versioned_writes \u003d swift.common.middleware.versioned_writes:filter_factory"},{"line_number":99,"context_line":"    fake_footers \u003d swift.common.middleware.fake_footers:filter_factory"},{"line_number":100,"context_line":"    test_fake_footers \u003d swift.common.middleware.test_fake_footers:filter_factory"},{"line_number":101,"context_line":"    trivialkeymaster \u003d swift.common.middleware.trivial_keymaster:filter_factory"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"[build_sphinx]"},{"line_number":104,"context_line":"all_files \u003d 1"}],"source_content_type":"text/x-ttcn-cfg","patch_set":13,"id":"da20952f_86b4a682","line":101,"in_reply_to":"da20952f_bb3561dc","updated":"2015-09-09 14:41:05.000000000","message":"Done","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"}],"swift/common/exceptions.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"class StopEncryption(SwiftException):"},{"line_number":207,"context_line":"    pass"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"class ClientException(Exception):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_de78f6f4","line":207,"updated":"2015-07-01 00:14:46.000000000","message":"nit: pep8 has some thoughts on naming Exceptions [1] - which may or may not apply here...\n\n1. https://www.python.org/dev/peps/pep-0008/#exception-names","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"class StopEncryption(SwiftException):"},{"line_number":207,"context_line":"    pass"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"class ClientException(Exception):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_855c59ee","line":207,"in_reply_to":"ba3cc151_de78f6f4","updated":"2015-07-01 02:17:06.000000000","message":"This exception is used in the keymaster when a key is not found, typically.  This is not necessarily an error.  But thanks for pointing out the convention.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"}],"swift/common/middleware/keymaster.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":31,"context_line":"        self.server_type \u003d server_type"},{"line_number":32,"context_line":"        self.path \u003d path"},{"line_number":33,"context_line":"        self.keys \u003d {}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def handle_put(self, req, start_response):"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_f4a63952","line":33,"updated":"2015-07-01 00:14:46.000000000","message":"so Contexts are fresh for every [sub]request - so it\u0027s safe enough to hang state on the object like this - suggested pipeline positioning looks like we shouldn\u0027t have to deal with to many things tripping on multiple requests trying to share keys - the exceptions being of course - versioned objects and COPY - both of which have yet to be pulled out of the proxy.\n\nWe should put some more bodies behind reviewing the changes [1] pulling those out of the proxy.\n\n1. https://review.openstack.org/#/c/134347/","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":31,"context_line":"        self.server_type \u003d server_type"},{"line_number":32,"context_line":"        self.path \u003d path"},{"line_number":33,"context_line":"        self.keys \u003d {}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def handle_put(self, req, start_response):"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_e50445c1","line":33,"in_reply_to":"ba3cc151_f4a63952","updated":"2015-07-01 02:17:06.000000000","message":"I will take a look and see if I can help.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            (h, v) for h, v in self._response_headers"},{"line_number":90,"context_line":"            if h and (\u0027crypto-meta\u0027 in h.lower())]"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        if crypto_meta:"},{"line_number":93,"context_line":"            self.logger.error(\"Cannot get necessary keys for path %s\" %"},{"line_number":94,"context_line":"                              req.path)"},{"line_number":95,"context_line":"            raise HTTPUnprocessableEntity("}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_148de87a","line":92,"updated":"2015-07-01 00:14:46.000000000","message":"this compresses into the still pretty readable if any(\u003cgenerator expression\u003e) format:\n\n  if any(\u0027crypto-meta\u0027 in h.lower() for h in self._response_headers if h)\n\n... but what user meta?  x-object-meta-crypto-meta?","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            (h, v) for h, v in self._response_headers"},{"line_number":90,"context_line":"            if h and (\u0027crypto-meta\u0027 in h.lower())]"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        if crypto_meta:"},{"line_number":93,"context_line":"            self.logger.error(\"Cannot get necessary keys for path %s\" %"},{"line_number":94,"context_line":"                              req.path)"},{"line_number":95,"context_line":"            raise HTTPUnprocessableEntity("}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_85b8d9e6","line":92,"in_reply_to":"ba3cc151_148de87a","updated":"2015-07-01 02:17:06.000000000","message":"this is a check for any crypto-meta (could be for container, account, object, user-meta, object body, etc)\n\nIf there is any item at all that has a thing called \"crypto-meta\", then this middleware must provide keys - so not finding keys should be an error.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                        base64.b64encode(obj_key_path)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        except ValueError:"},{"line_number":157,"context_line":"            raise StopEncryption"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_5e84e6d2","line":157,"updated":"2015-07-01 00:14:46.000000000","message":"py2 will let you raise anything - even a string - but generally you want to raise *instances* of an exception - not the class itself\n\ns/raise StopEncrytpion/raise StopEncryption()/","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                        base64.b64encode(obj_key_path)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        except ValueError:"},{"line_number":157,"context_line":"            raise StopEncryption"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_c5a581b5","line":157,"in_reply_to":"ba3cc151_5e84e6d2","updated":"2015-07-01 02:17:06.000000000","message":"LOL.  I am still getting used to a functional language - that would have been a build error in my old world ;-)","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            key \u003d self.get_key(key_id)"},{"line_number":270,"context_line":"        except ValueError:"},{"line_number":271,"context_line":"            key \u003d self.create_key(key_id)"},{"line_number":272,"context_line":"            self.add_key(key_id, key)"},{"line_number":273,"context_line":"        return key"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def create_key(self, key_id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_b199a321","line":272,"updated":"2015-07-01 00:14:46.000000000","message":"was this meant to use create_add_add_key?","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            key \u003d self.get_key(key_id)"},{"line_number":270,"context_line":"        except ValueError:"},{"line_number":271,"context_line":"            key \u003d self.create_key(key_id)"},{"line_number":272,"context_line":"            self.add_key(key_id, key)"},{"line_number":273,"context_line":"        return key"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def create_key(self, key_id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_a5895d28","line":272,"in_reply_to":"ba3cc151_b199a321","updated":"2015-07-01 02:17:06.000000000","message":"thanks!  I think I made the combined method after this one.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def add_key(self, key_id, value):"},{"line_number":280,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":281,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":282,"context_line":"                          % self.internal_keys)"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_5184d7d2","line":280,"updated":"2015-07-01 00:14:46.000000000","message":"wow, so maybe it\u0027s in the spec - but this in-memory store is pretty volatile (i.e. if you restart proxy all your data is lost)\n\nIn fact you probably can\u0027t even use multiple workers :\\\n\nI\u0027m all for simple - but this might be too much.  Maybe take a look at some sort of k/v on disk thing [1].\n\n1. https://docs.python.org/2/library/dbm.html#module-dbm","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"77ba43918c782f9f569236deafbda82ae9a52095","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def add_key(self, key_id, value):"},{"line_number":280,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":281,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":282,"context_line":"                          % self.internal_keys)"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_878cb680","line":280,"in_reply_to":"ba3cc151_05aa8970","updated":"2015-07-06 03:30:05.000000000","message":"I am going to upload a patch that addresses all the comments, except for this one.  I would like to chat about what we want to do here.  There are some choices about how to proceed.\n\nKeep in mind that this is not storing the actual key (the key is derived).  So, this could run in a mode where it simply doesn\u0027t track what keys have been created.  That could be the mode used when running with multiple workers.\n\nThe purpose of the in-memory dict is to keep track of what keys had been created so that functests would fail if a key had not been created when it should have been.\n\nI will add a comment back to the next patch so that this is not lost.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def add_key(self, key_id, value):"},{"line_number":280,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":281,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":282,"context_line":"                          % self.internal_keys)"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_05aa8970","line":280,"in_reply_to":"ba3cc151_5184d7d2","updated":"2015-07-01 02:17:06.000000000","message":"I will work on a better solution.  thanks for the link","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"f191818e8f6ad5aae214894043a0058b165bb053","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        return self.keys"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"class TrivialKeyMaster(object):"},{"line_number":224,"context_line":"    \"\"\""},{"line_number":225,"context_line":"    Encryption keymaster middleware for testing.  Don\u0027t use in production."},{"line_number":226,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_4da9dade","line":223,"updated":"2015-07-06 14:55:12.000000000","message":"There is a KeyManager interface provided by Castellan. That interface is/will be used by other services such as Nova, Cinder, and Sahara.\n\nhttps://github.com/openstack/castellan/blob/master/castellan/key_manager/key_manager.py\n\nThat interface provides methods very similar to this. You could use that library. The nice part is that the library will provide plugins for Barbicans and KMIP. In the future someone could also support PKCS11 devices. Instead of having this library implement those different types of key management devices then you could reuse that code.","commit_id":"9b2fca4cfa02c3a611dc46e25fbc0cc8b6f8c38d"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"c6eb172f52cde42a70f7fe8c625cfffc11575237","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        return self.keys"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"class TrivialKeyMaster(object):"},{"line_number":224,"context_line":"    \"\"\""},{"line_number":225,"context_line":"    Encryption keymaster middleware for testing.  Don\u0027t use in production."},{"line_number":226,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_3e00bb00","line":223,"in_reply_to":"ba3cc151_4da9dade","updated":"2015-07-08 18:30:25.000000000","message":"Thanks, Nathan.  I had developed this keymaster for my immediate testing purposes, but there is somebody looking into using Castellan and other items to add to the keymaster to make it better.  I hope that there will be a patch out for review of a better keymaster sometime in the next few weeks.","commit_id":"9b2fca4cfa02c3a611dc46e25fbc0cc8b6f8c38d"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"c574d63f48936e232b0bb8982248b6e497ec68a5","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def add_key(self, key_id, value):"},{"line_number":281,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":282,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":283,"context_line":"                          % self.internal_keys)"},{"line_number":284,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_e73fc285","line":281,"updated":"2015-07-06 03:37:46.000000000","message":"As Clay pointed out in the previous patch, the in-memory list should probably be persisted.  See comments from the last patch.","commit_id":"9b2fca4cfa02c3a611dc46e25fbc0cc8b6f8c38d"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":31,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":32,"context_line":"        self.server_type \u003d server_type"},{"line_number":33,"context_line":"        self.path \u003d path"},{"line_number":34,"context_line":"        self.keys \u003d {}"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def handle_put(self, req, start_response):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_5c05870e","line":33,"updated":"2015-07-29 01:37:24.000000000","message":"I don\u0027t think we use this ?  Seems we use the path from the Request obj.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":31,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":32,"context_line":"        self.server_type \u003d server_type"},{"line_number":33,"context_line":"        self.path \u003d path"},{"line_number":34,"context_line":"        self.keys \u003d {}"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def handle_put(self, req, start_response):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_2a6d0acc","line":33,"in_reply_to":"3a50d1a3_5c05870e","updated":"2015-08-01 19:00:08.000000000","message":"removed.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            self.error_if_need_keys(req)"},{"line_number":42,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":43,"context_line":"            self.logger.debug(\"No encryption keys necessary for path %s\" %"},{"line_number":44,"context_line":"                              req.path)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        resp \u003d self._app_call(req.environ)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_b8e5b009","line":44,"updated":"2015-07-29 01:37:24.000000000","message":"I would add this to error_if_need_keys if we don\u0027t raise an exception.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            self.error_if_need_keys(req)"},{"line_number":42,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":43,"context_line":"            self.logger.debug(\"No encryption keys necessary for path %s\" %"},{"line_number":44,"context_line":"                              req.path)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        resp \u003d self._app_call(req.environ)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_6a81d24c","line":44,"in_reply_to":"3a50d1a3_b8e5b009","updated":"2015-08-01 19:00:08.000000000","message":"done.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":104,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":105,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":106,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":107,"context_line":"                acct_key_path)"},{"line_number":108,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_b76944c0","line":105,"updated":"2015-07-29 01:37:24.000000000","message":"To simplify this (and the other cases) below any reason not to just always call get_or_create_and_add_key ?","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":104,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":105,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":106,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":107,"context_line":"                acct_key_path)"},{"line_number":108,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_ca8a6664","line":105,"in_reply_to":"3a50d1a3_b76944c0","updated":"2015-08-01 19:00:08.000000000","message":"If there is a \"put\" against a path that was used before, then I was thinking the keymaster needs to be sure to create a new key that overrides that old one.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                self.keys[\u0027container\u0027] \u003d self.keymaster.get_key("},{"line_number":176,"context_line":"                    cont_key_path)"},{"line_number":177,"context_line":"                if path_obj:"},{"line_number":178,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":179,"context_line":"                    try:"},{"line_number":180,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":181,"context_line":"                            obj_key_path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_b98dab32","line":178,"updated":"2015-07-29 01:37:24.000000000","message":"Another option here is to always fetch ...-crypto-id and use it for the path, not sure it really cleans it up much though","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                self.keys[\u0027container\u0027] \u003d self.keymaster.get_key("},{"line_number":176,"context_line":"                    cont_key_path)"},{"line_number":177,"context_line":"                if path_obj:"},{"line_number":178,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":179,"context_line":"                    try:"},{"line_number":180,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":181,"context_line":"                            obj_key_path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_6ae8f216","line":178,"in_reply_to":"3a50d1a3_b98dab32","updated":"2015-08-01 19:00:08.000000000","message":"The \"crypto-id\" was a late addition, and I am not sure if that is a work-around that will be removed.  If we do end up going with that as a permanent solution to the versioned objects handling, then I will do that.  Good suggestion.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":226,"context_line":"    \"\"\""},{"line_number":227,"context_line":"    def __init__(self, app, conf):"},{"line_number":228,"context_line":"        self.app \u003d app"},{"line_number":229,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":230,"context_line":"        # collection of key ids to test inclusion"},{"line_number":231,"context_line":"        self.internal_keys \u003d set([])"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_2b439714","line":229,"updated":"2015-07-29 01:37:24.000000000","message":"Given folks may use this as an example to write other keymasters, and multiple keymasters can be utilized, I wonder if the we should use a more specific name (e.g. trivialKey) just as a precedence ?","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":226,"context_line":"    \"\"\""},{"line_number":227,"context_line":"    def __init__(self, app, conf):"},{"line_number":228,"context_line":"        self.app \u003d app"},{"line_number":229,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":230,"context_line":"        # collection of key ids to test inclusion"},{"line_number":231,"context_line":"        self.internal_keys \u003d set([])"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_4af5f6ea","line":229,"in_reply_to":"3a50d1a3_2b439714","updated":"2015-08-01 19:00:08.000000000","message":"done.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        self.app \u003d app"},{"line_number":229,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":230,"context_line":"        # collection of key ids to test inclusion"},{"line_number":231,"context_line":"        self.internal_keys \u003d set([])"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def __call__(self, env, start_response):"},{"line_number":234,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_28115d04","line":231,"updated":"2015-07-29 01:37:24.000000000","message":"Any reason for set([]) vs just set() for an empty set ?","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        self.app \u003d app"},{"line_number":229,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":230,"context_line":"        # collection of key ids to test inclusion"},{"line_number":231,"context_line":"        self.internal_keys \u003d set([])"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def __call__(self, env, start_response):"},{"line_number":234,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_0ad84e7e","line":231,"in_reply_to":"3a50d1a3_28115d04","updated":"2015-08-01 19:00:08.000000000","message":"reason: it used to be a different structure :-)\nchanged","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"a95bab8add3fa067490537404292c7090261121a","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                server_type \u003d \u0027Object\u0027"},{"line_number":245,"context_line":"            elif path_cont:"},{"line_number":246,"context_line":"                server_type \u003d \u0027Container\u0027"},{"line_number":247,"context_line":"            else:"},{"line_number":248,"context_line":"                server_type \u003d \u0027Account\u0027"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_cb031341","line":247,"updated":"2015-07-29 01:37:24.000000000","message":"Purely from an interface point of view its possible split_path only returns 1 element (i.e. path_ver) not sure if this can actually happen ?  And if it does does it imply something other then an account ?  May want to explicitly check for account (or require a minimum of 2 elements to be found).","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cd5c91351a93f7bc72815b2c41d4fa50c005ef46","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                server_type \u003d \u0027Object\u0027"},{"line_number":245,"context_line":"            elif path_cont:"},{"line_number":246,"context_line":"                server_type \u003d \u0027Container\u0027"},{"line_number":247,"context_line":"            else:"},{"line_number":248,"context_line":"                server_type \u003d \u0027Account\u0027"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_cae1062c","line":247,"in_reply_to":"3a50d1a3_cb031341","updated":"2015-08-01 19:00:08.000000000","message":"good catch.  When I changed this, my \"test_no_acct\" test failed, because it was asserting that the crypto override would still get set.  I don\u0027t remember why I had to set that flag for a HEAD against a path with no account.  I removed the test for now, because the flag should not be necessary in that case.  But when I rebase the later patches on this change, I might remember why I was setting the crypto override flag for the no account case.","commit_id":"b5dfa800625738b716eb225f483ddf940128f661"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"1a4dcd0f_4420fff7","updated":"2015-08-03 17:42:39.000000000","message":"we may want to name the file trivial_keymaster.py to its obvious what it is in the code tree.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        try:"},{"line_number":38,"context_line":"            self.provide_keys_put(req)"},{"line_number":39,"context_line":"        except StopEncryption:"},{"line_number":40,"context_line":"            self.error_if_need_keys(req)"},{"line_number":41,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        resp \u003d self._app_call(req.environ)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_8e3a9ecc","line":40,"updated":"2015-08-03 17:42:39.000000000","message":"I\u0027m struggling to see why this is called here? error_if_need_keys does:\n\n  if not hasattr(self, \u0027_response_headers\u0027):\n\t\t\t            return\n\nwon\u0027t that always be true at this moment?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        try:"},{"line_number":38,"context_line":"            self.provide_keys_put(req)"},{"line_number":39,"context_line":"        except StopEncryption:"},{"line_number":40,"context_line":"            self.error_if_need_keys(req)"},{"line_number":41,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        resp \u003d self._app_call(req.environ)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_7792b94d","line":40,"in_reply_to":"1a4dcd0f_8e3a9ecc","updated":"2015-08-10 03:18:26.000000000","message":"true.  this only made sense for get or head.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        path_ver, path_acc, path_cont, path_obj \u003d req.split_path(1, 4, True)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        if not path_ver or not path_acc:"},{"line_number":97,"context_line":"            raise StopEncryption()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_53f19fcc","line":96,"updated":"2015-08-03 17:42:39.000000000","message":"feels like we already checked this and could therefore never reach this condition?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        path_ver, path_acc, path_cont, path_obj \u003d req.split_path(1, 4, True)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        if not path_ver or not path_acc:"},{"line_number":97,"context_line":"            raise StopEncryption()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_77f1596a","line":96,"in_reply_to":"1a4dcd0f_53f19fcc","updated":"2015-08-10 03:18:26.000000000","message":"true.  I think this got here when the prior logic was different.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        if not path_ver or not path_acc:"},{"line_number":97,"context_line":"            raise StopEncryption()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_93d167fe","line":99,"updated":"2015-08-03 17:42:39.000000000","message":"nit: or just put os.sep as first arg to os.path.join","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        if not path_ver or not path_acc:"},{"line_number":97,"context_line":"            raise StopEncryption()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_7798791c","line":99,"in_reply_to":"1a4dcd0f_93d167fe","updated":"2015-08-10 03:18:26.000000000","message":"done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_d30b6f7c","line":101,"updated":"2015-08-03 17:42:39.000000000","message":"where did server_type get lower-cased? Its \u0027Account\u0027 below. lower case throughout would be best IMHO.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_7766392b","line":101,"in_reply_to":"1a4dcd0f_d30b6f7c","updated":"2015-08-10 03:18:26.000000000","message":"set to lower-cased.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":106,"context_line":"                acct_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_a5486bcd","line":103,"updated":"2015-08-01 20:15:34.000000000","message":"I suggested you always use get_or_create_and_add_key, and you correctly disagreed ; - )    I wonder to stop others from thinking the same, consider adding a comment \"For account PUT we always want to generate a new key even if the path is the same\" ?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":106,"context_line":"                acct_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_33cc1335","line":103,"in_reply_to":"3a50d1a3_a5486bcd","updated":"2015-08-03 17:42:39.000000000","message":"+1 would help me to know why :D","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":101,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":102,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":106,"context_line":"                acct_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_175d7546","line":103,"in_reply_to":"3a50d1a3_a5486bcd","updated":"2015-08-10 03:18:26.000000000","message":"done.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":106,"context_line":"                acct_key_path)"},{"line_number":107,"context_line":"        if path_cont:"},{"line_number":108,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":109,"context_line":"            if self.server_type \u003d\u003d \u0027container\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_e525130a","line":106,"updated":"2015-08-01 20:15:34.000000000","message":"Add a blank line for clarity.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                acct_key_path)"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":106,"context_line":"                acct_key_path)"},{"line_number":107,"context_line":"        if path_cont:"},{"line_number":108,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":109,"context_line":"            if self.server_type \u003d\u003d \u0027container\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_973745fe","line":106,"in_reply_to":"3a50d1a3_e525130a","updated":"2015-08-10 03:18:26.000000000","message":"done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                acct_key_path)"},{"line_number":107,"context_line":"        if path_cont:"},{"line_number":108,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":109,"context_line":"            if self.server_type \u003d\u003d \u0027container\u0027:"},{"line_number":110,"context_line":"                self.keys[\u0027container\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":111,"context_line":"                    cont_key_path)"},{"line_number":112,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_5358bf56","line":109,"updated":"2015-08-03 17:42:39.000000000","message":"ditto re lower case","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                acct_key_path)"},{"line_number":107,"context_line":"        if path_cont:"},{"line_number":108,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":109,"context_line":"            if self.server_type \u003d\u003d \u0027container\u0027:"},{"line_number":110,"context_line":"                self.keys[\u0027container\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":111,"context_line":"                    cont_key_path)"},{"line_number":112,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_573d3ddb","line":109,"in_reply_to":"1a4dcd0f_5358bf56","updated":"2015-08-10 03:18:26.000000000","message":"ditto done :-)","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                    cont_key_path)"},{"line_number":112,"context_line":"            else:"},{"line_number":113,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"},{"line_number":114,"context_line":"                    self.keymaster.get_or_create_and_add_key(cont_key_path)"},{"line_number":115,"context_line":"            if path_obj:"},{"line_number":116,"context_line":"                obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":117,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.get_or_create_and_add_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_05211ffc","line":114,"updated":"2015-08-01 20:15:34.000000000","message":"Add a blank line for clarity.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                    cont_key_path)"},{"line_number":112,"context_line":"            else:"},{"line_number":113,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"},{"line_number":114,"context_line":"                    self.keymaster.get_or_create_and_add_key(cont_key_path)"},{"line_number":115,"context_line":"            if path_obj:"},{"line_number":116,"context_line":"                obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":117,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.get_or_create_and_add_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_f728099c","line":114,"in_reply_to":"3a50d1a3_05211ffc","updated":"2015-08-10 03:18:26.000000000","message":"done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":118,"context_line":"                    obj_key_path)"},{"line_number":119,"context_line":"                # TODO - is saving this id the right approach to handle"},{"line_number":120,"context_line":"                # versioned objs?  It was needed because the path changes"},{"line_number":121,"context_line":"                id_name \u003d \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":122,"context_line":"                req.headers[id_name] \u003d \\"},{"line_number":123,"context_line":"                    base64.b64encode(obj_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_05683f20","line":120,"updated":"2015-08-01 20:15:34.000000000","message":"And the other idea is if we stick to this approach if we should just always check this instead of trying the path first (I\u0027ll comment about that in the other reviews though).  For the PUT case, does this come into play when we are overwriting an object and with versioning end up writing the original object to the versioning container instead ?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":118,"context_line":"                    obj_key_path)"},{"line_number":119,"context_line":"                # TODO - is saving this id the right approach to handle"},{"line_number":120,"context_line":"                # versioned objs?  It was needed because the path changes"},{"line_number":121,"context_line":"                id_name \u003d \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":122,"context_line":"                req.headers[id_name] \u003d \\"},{"line_number":123,"context_line":"                    base64.b64encode(obj_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_f23d77c4","line":120,"in_reply_to":"3a50d1a3_05683f20","updated":"2015-08-10 03:18:26.000000000","message":"because I am not sure if this is the way to go, I didn\u0027t want to change this yet.  So, I added this to the etherpad and we will be sure to address this.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                    obj_key_path)"},{"line_number":119,"context_line":"                # TODO - is saving this id the right approach to handle"},{"line_number":120,"context_line":"                # versioned objs?  It was needed because the path changes"},{"line_number":121,"context_line":"                id_name \u003d \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":122,"context_line":"                req.headers[id_name] \u003d \\"},{"line_number":123,"context_line":"                    base64.b64encode(obj_key_path)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_73905bed","line":121,"updated":"2015-08-03 17:42:39.000000000","message":"nice. defensive ;)","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                # versioned objs?  It was needed because the path changes"},{"line_number":121,"context_line":"                id_name \u003d \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":122,"context_line":"                req.headers[id_name] \u003d \\"},{"line_number":123,"context_line":"                    base64.b64encode(obj_key_path)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_d3436f6b","line":123,"updated":"2015-08-03 17:42:39.000000000","message":"So the idea here is that the trivial_km stores the value it used to compute key and then can retrieve that value to compute correct key when getting a copied object, correct?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                # versioned objs?  It was needed because the path changes"},{"line_number":121,"context_line":"                id_name \u003d \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":122,"context_line":"                req.headers[id_name] \u003d \\"},{"line_number":123,"context_line":"                    base64.b64encode(obj_key_path)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_5270eba3","line":123,"in_reply_to":"1a4dcd0f_d3436f6b","updated":"2015-08-10 03:18:26.000000000","message":"yes","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            raise StopEncryption()"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            # TODO - should this be only get_key for POST? fail if not there?"},{"line_number":136,"context_line":"            acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":137,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":138,"context_line":"                acct_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_2559bb8e","line":135,"updated":"2015-08-01 20:15:34.000000000","message":"I would think so given POST is only to update the headers, but will we have failed by this point if you try to POST a non-existing container / account / object ? :)","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            raise StopEncryption()"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            # TODO - should this be only get_key for POST? fail if not there?"},{"line_number":136,"context_line":"            acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":137,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":138,"context_line":"                acct_key_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_12dca371","line":135,"in_reply_to":"3a50d1a3_2559bb8e","updated":"2015-08-10 03:18:26.000000000","message":"I think this was a get_or_create because some accounts are automatically created, so there was no chance to create a key on the account PUT.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            # TODO - should this be only get_key for POST? fail if not there?"},{"line_number":136,"context_line":"            acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":137,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":138,"context_line":"                acct_key_path)"},{"line_number":139,"context_line":"            if path_cont:"},{"line_number":140,"context_line":"                cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":141,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_e553d36a","line":138,"updated":"2015-08-01 20:15:34.000000000","message":"Add a blank line.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            # TODO - should this be only get_key for POST? fail if not there?"},{"line_number":136,"context_line":"            acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":137,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":138,"context_line":"                acct_key_path)"},{"line_number":139,"context_line":"            if path_cont:"},{"line_number":140,"context_line":"                cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":141,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_923d1391","line":138,"in_reply_to":"3a50d1a3_e553d36a","updated":"2015-08-10 03:18:26.000000000","message":"done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":139,"context_line":"            if path_cont:"},{"line_number":140,"context_line":"                cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":141,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"},{"line_number":142,"context_line":"                    self.keymaster.get_or_create_and_add_key(cont_key_path)"},{"line_number":143,"context_line":"                if path_obj:"},{"line_number":144,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":145,"context_line":"                    self.keys[\u0027object\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_054fdfbe","line":142,"updated":"2015-08-01 20:15:34.000000000","message":"Add a blank line.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":139,"context_line":"            if path_cont:"},{"line_number":140,"context_line":"                cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":141,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"},{"line_number":142,"context_line":"                    self.keymaster.get_or_create_and_add_key(cont_key_path)"},{"line_number":143,"context_line":"                if path_obj:"},{"line_number":144,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":145,"context_line":"                    self.keys[\u0027object\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_3240bf06","line":142,"in_reply_to":"3a50d1a3_054fdfbe","updated":"2015-08-10 03:18:26.000000000","message":"Done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"57634414db6f83f99b24113d11912719755c3328","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                    id_name \u003d \\"},{"line_number":149,"context_line":"                        \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":150,"context_line":"                    req.headers[id_name] \u003d \\"},{"line_number":151,"context_line":"                        base64.b64encode(obj_key_path)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        except ValueError:"},{"line_number":154,"context_line":"            raise StopEncryption()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_d0d57743","line":151,"updated":"2015-08-04 13:55:15.000000000","message":"hmmm, so if the target object has been copied, this will replace the id set during its original PUT with a different value, which would mean that during a GET we\u0027d get the wrong id for the object body??","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                    id_name \u003d \\"},{"line_number":149,"context_line":"                        \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":150,"context_line":"                    req.headers[id_name] \u003d \\"},{"line_number":151,"context_line":"                        base64.b64encode(obj_key_path)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        except ValueError:"},{"line_number":154,"context_line":"            raise StopEncryption()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_f2757763","line":151,"in_reply_to":"1a4dcd0f_d0d57743","updated":"2015-08-10 03:18:26.000000000","message":"removed this.  it should not be there for post.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if not path_ver or not path_acc:"},{"line_number":163,"context_line":"            raise StopEncryption()"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        try:"},{"line_number":166,"context_line":"            acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":167,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_25e77bad","line":164,"updated":"2015-08-01 20:15:34.000000000","message":"Similar white space comments to above for section below (i.e. add a blank line before the a new IF block) I think it makes it more readable, but just personal preference so feel free to ignore !","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if not path_ver or not path_acc:"},{"line_number":163,"context_line":"            raise StopEncryption()"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        try:"},{"line_number":166,"context_line":"            acct_key_path \u003d os.sep + os.path.join(path_ver, path_acc)"},{"line_number":167,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.get_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_b26b6f84","line":164,"in_reply_to":"3a50d1a3_25e77bad","updated":"2015-08-10 03:18:26.000000000","message":"Done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                    except ValueError:"},{"line_number":179,"context_line":"                        # The req \"path\" didn\u0027t have a key, but maybe"},{"line_number":180,"context_line":"                        # there was a different path on the PUT"},{"line_number":181,"context_line":"                        # like in the case of versioning"},{"line_number":182,"context_line":"                        self.logger.debug(\"orig obj path: %s\" % obj_key_path)"},{"line_number":183,"context_line":"                        id_name \u003d \\"},{"line_number":184,"context_line":"                            \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_c5f6d75c","line":181,"updated":"2015-08-01 20:15:34.000000000","message":"Yea I wonder if we can always just use crypto-id as the path to check for get/head ?  It is uglier though given we need to decode first as opposed to just finding the path in our ist","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                    except ValueError:"},{"line_number":179,"context_line":"                        # The req \"path\" didn\u0027t have a key, but maybe"},{"line_number":180,"context_line":"                        # there was a different path on the PUT"},{"line_number":181,"context_line":"                        # like in the case of versioning"},{"line_number":182,"context_line":"                        self.logger.debug(\"orig obj path: %s\" % obj_key_path)"},{"line_number":183,"context_line":"                        id_name \u003d \\"},{"line_number":184,"context_line":"                            \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_f2fc97b9","line":181,"in_reply_to":"3a50d1a3_c5f6d75c","updated":"2015-08-10 03:18:26.000000000","message":"there is now a comment on the etherpad about whether we should stick with this approach for versioning.  will do this if we stick with that solution.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"57634414db6f83f99b24113d11912719755c3328","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                        self.logger.debug(\"obj key id: %s\" % obj_key_path)"},{"line_number":201,"context_line":"                        self.logger.debug(\"cont key id: %s\" % cont_key_path)"},{"line_number":202,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":203,"context_line":"                            obj_key_path)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        except ValueError:"},{"line_number":206,"context_line":"            raise StopEncryption()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_30cb7b55","line":203,"updated":"2015-08-04 13:55:15.000000000","message":"Does this assume that the account key path is unchanged? that may not be true e.g. if the object has been copied between accounts. So I think you also need to fetch the account key based on the key id returned with object.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                        self.logger.debug(\"obj key id: %s\" % obj_key_path)"},{"line_number":201,"context_line":"                        self.logger.debug(\"cont key id: %s\" % cont_key_path)"},{"line_number":202,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":203,"context_line":"                            obj_key_path)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        except ValueError:"},{"line_number":206,"context_line":"            raise StopEncryption()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_121fc308","line":203,"in_reply_to":"1a4dcd0f_30cb7b55","updated":"2015-08-10 03:18:26.000000000","message":"i haven\u0027t thought about copy at all yet, since we haven\u0027t implemented the copy request handling.  we would need to make a new key when the copy is done, and that would be identified by the new path, right?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        self.app \u003d app"},{"line_number":225,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":226,"context_line":"        # collection of key ids to test inclusion"},{"line_number":227,"context_line":"        self.internal_keys \u003d set()"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def __call__(self, env, start_response):"},{"line_number":230,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_987c2422","line":227,"updated":"2015-08-03 17:42:39.000000000","message":"If we have a test cluster with one than one proxy then this set will need to be visible to all proxies?? I\u0027m assuming that a key needs to be valid across several requests that could arrive at different proxies?\n\nIf so then perhaps use memcache in similar way to tempauth to store (key_id, key) as a pair.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        self.app \u003d app"},{"line_number":225,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":226,"context_line":"        # collection of key ids to test inclusion"},{"line_number":227,"context_line":"        self.internal_keys \u003d set()"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def __call__(self, env, start_response):"},{"line_number":230,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_5e81884c","line":227,"in_reply_to":"1a4dcd0f_987c2422","updated":"2015-08-10 03:18:26.000000000","message":"a note was made on the etherpad.  this will be done.  it wont be the very next patch, tho.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":227,"context_line":"        self.internal_keys \u003d set()"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def __call__(self, env, start_response):"},{"line_number":230,"context_line":"        req \u003d Request(env)"},{"line_number":231,"context_line":"        try:"},{"line_number":232,"context_line":"            path_ver, path_acc, path_cont, path_obj \u003d \\"},{"line_number":233,"context_line":"                req.split_path(1, 4, True)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_05c59f3b","line":230,"updated":"2015-08-01 20:15:34.000000000","message":"Add a blank line before the try block for clarity.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":227,"context_line":"        self.internal_keys \u003d set()"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def __call__(self, env, start_response):"},{"line_number":230,"context_line":"        req \u003d Request(env)"},{"line_number":231,"context_line":"        try:"},{"line_number":232,"context_line":"            path_ver, path_acc, path_cont, path_obj \u003d \\"},{"line_number":233,"context_line":"                req.split_path(1, 4, True)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_92c0b351","line":230,"in_reply_to":"3a50d1a3_05c59f3b","updated":"2015-08-10 03:18:26.000000000","message":"Done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        req \u003d Request(env)"},{"line_number":231,"context_line":"        try:"},{"line_number":232,"context_line":"            path_ver, path_acc, path_cont, path_obj \u003d \\"},{"line_number":233,"context_line":"                req.split_path(1, 4, True)"},{"line_number":234,"context_line":"        except ValueError:"},{"line_number":235,"context_line":"            return self.app(env, start_response)"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_1de246d6","line":233,"updated":"2015-08-03 17:42:39.000000000","message":"If this were:\n\n  req.split_path(1, 4, True)\n\nwould we not get ValueError here for paths with no account/c/o and pass request to self.app immediately rather than wait til line 246?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            path_ver, path_acc, path_cont, path_obj \u003d \\"},{"line_number":233,"context_line":"                req.split_path(1, 4, True)"},{"line_number":234,"context_line":"        except ValueError:"},{"line_number":235,"context_line":"            return self.app(env, start_response)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        try:"},{"line_number":238,"context_line":"            # Object, Account or Container"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_8425a7c3","line":235,"updated":"2015-08-03 17:42:39.000000000","message":"ok. so long as \u0027app\u0027 doesn\u0027t do any work before failing the request, which it doesnt because encrypter.py has the same logic :)","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":241,"context_line":"            elif path_cont:"},{"line_number":242,"context_line":"                server_type \u003d \u0027Container\u0027"},{"line_number":243,"context_line":"            elif path_acc:"},{"line_number":244,"context_line":"                server_type \u003d \u0027Account\u0027"},{"line_number":245,"context_line":"            else:"},{"line_number":246,"context_line":"                return self.app(env, start_response)"},{"line_number":247,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_1da006f4","line":244,"updated":"2015-08-03 17:42:39.000000000","message":"or...\n\n  try:\n      parts \u003d req.split_path(2, 4, True)\n  except ValueError:\n      return self.app(env, start_response)\n  types \u003d (\u0027Account\u0027, \u0027Container\u0027, \u0027Object\u0027)\n  server_type \u003d reduce(lambda x, y: y if y[0] else x, zip(parts, types))[0]\n\nmaybe?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":241,"context_line":"            elif path_cont:"},{"line_number":242,"context_line":"                server_type \u003d \u0027Container\u0027"},{"line_number":243,"context_line":"            elif path_acc:"},{"line_number":244,"context_line":"                server_type \u003d \u0027Account\u0027"},{"line_number":245,"context_line":"            else:"},{"line_number":246,"context_line":"                return self.app(env, start_response)"},{"line_number":247,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_d2715b0d","line":244,"in_reply_to":"1a4dcd0f_1da006f4","updated":"2015-08-10 03:18:26.000000000","message":"Done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                server_type \u003d \u0027Container\u0027"},{"line_number":243,"context_line":"            elif path_acc:"},{"line_number":244,"context_line":"                server_type \u003d \u0027Account\u0027"},{"line_number":245,"context_line":"            else:"},{"line_number":246,"context_line":"                return self.app(env, start_response)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_05f35fa0","line":245,"updated":"2015-08-01 20:15:34.000000000","message":"This is great !  Just to call it out, the other option is to change split_path to request a minimum of 2, less code overall ; )  But assuming 1 is possible, I\u0027m not sure if its good style to make the min 2 (which will probably log something even if we ignore), and in that case this approach is nicer.  No biggie either way !","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            elif path_acc:"},{"line_number":244,"context_line":"                server_type \u003d \u0027Account\u0027"},{"line_number":245,"context_line":"            else:"},{"line_number":246,"context_line":"                return self.app(env, start_response)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"},{"line_number":249,"context_line":"            if req.method \u003d\u003d \"PUT\":"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_ddeb7eaf","line":246,"updated":"2015-08-03 17:42:39.000000000","message":"see comment above - can\u0027t we catch this earlier?","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":246,"context_line":"                return self.app(env, start_response)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"},{"line_number":249,"context_line":"            if req.method \u003d\u003d \"PUT\":"},{"line_number":250,"context_line":"                return km_context.handle_put(req, start_response)"},{"line_number":251,"context_line":"            elif req.method \u003d\u003d \"POST\":"},{"line_number":252,"context_line":"                return km_context.handle_post(req, start_response)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_735ffb0e","line":249,"updated":"2015-08-03 17:42:39.000000000","message":"nit:\n\nyou could use the same trick as the object server i.e. name the TrivialKeyMastrContext methods GET, PUT etc and then do\n\n  if has_attr(km_context, req.method)\n      return getattr(km_context, req.method)(req, start_response)","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":246,"context_line":"                return self.app(env, start_response)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"},{"line_number":249,"context_line":"            if req.method \u003d\u003d \"PUT\":"},{"line_number":250,"context_line":"                return km_context.handle_put(req, start_response)"},{"line_number":251,"context_line":"            elif req.method \u003d\u003d \"POST\":"},{"line_number":252,"context_line":"                return km_context.handle_post(req, start_response)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_72f1676a","line":249,"in_reply_to":"1a4dcd0f_735ffb0e","updated":"2015-08-10 03:18:26.000000000","message":"Done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0941eaf4ccf6cfe756d8fbb96844d45cb35d364a","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        return hmac.new(bytes(\"secret\").encode(\u0027utf-8\u0027), key_id,"},{"line_number":276,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"    def add_key(self, key_id, value):"},{"line_number":279,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":280,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":281,"context_line":"                          % self.internal_keys)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_934ba72b","line":278,"updated":"2015-08-03 17:42:39.000000000","message":"value is not used (but maybe should be - see comment about memcache\u0027ing the keys)","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":296,"context_line":"    conf.update(local_conf)"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def trivialkeymaster_filter(app):"},{"line_number":299,"context_line":"        return TrivialKeyMaster(app, conf)"},{"line_number":300,"context_line":"    return trivialkeymaster_filter"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_c5a7b7a5","line":299,"updated":"2015-08-01 20:15:34.000000000","message":"I\u0027d add an empty line here before the filter_factory return call for clarity.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":296,"context_line":"    conf.update(local_conf)"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def trivialkeymaster_filter(app):"},{"line_number":299,"context_line":"        return TrivialKeyMaster(app, conf)"},{"line_number":300,"context_line":"    return trivialkeymaster_filter"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_12010338","line":299,"in_reply_to":"3a50d1a3_c5a7b7a5","updated":"2015-08-10 03:18:26.000000000","message":"Done","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"da20952f_36d3763a","updated":"2015-09-04 16:52:40.000000000","message":"change filename to trivial_keymaster.py","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        try:"},{"line_number":38,"context_line":"            self.provide_keys_put(req)"},{"line_number":39,"context_line":"        except StopEncryption:"},{"line_number":40,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        resp \u003d self._app_call(req.environ)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_d6355adb","line":39,"updated":"2015-09-04 16:52:40.000000000","message":"StopEncryption never raised","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"95d62d34720f89369a22f76b92cb9b9279e8ff7b","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        try:"},{"line_number":38,"context_line":"            self.provide_keys_put(req)"},{"line_number":39,"context_line":"        except StopEncryption:"},{"line_number":40,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        resp \u003d self._app_call(req.environ)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_2ea06d41","line":39,"in_reply_to":"da20952f_d6355adb","updated":"2015-09-07 04:19:22.000000000","message":"ok.  As for the usage here and the other places: I think that other changes have been made since that was added.  Or I expected to add something that would cause that, I don\u0027t know!","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            self.provide_keys_post(req)"},{"line_number":52,"context_line":"        except StopEncryption:"},{"line_number":53,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        resp \u003d self._app_call(req.environ)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_f6565e05","line":52,"updated":"2015-09-04 16:52:40.000000000","message":"StopEncryption never raised","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"ffc8b61be80c69ff5d0374e501585dd2e3dc5b51","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        try:"},{"line_number":71,"context_line":"            self.provide_keys_get_or_head(req)"},{"line_number":72,"context_line":"        except StopEncryption:"},{"line_number":73,"context_line":"            self.error_if_need_keys(req)"},{"line_number":74,"context_line":"            self.mark_no_encrypt(req.environ)"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_a2403b60","line":72,"updated":"2015-09-07 08:10:57.000000000","message":"I actually ran into this exception (self.error_if_need_keys was called) when I was testing for BYOK. We could include this again at a later point?","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if not hasattr(self, \u0027_response_headers\u0027):"},{"line_number":84,"context_line":"            return"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        if any(\u0027crypto-meta\u0027 in h.lower()"},{"line_number":87,"context_line":"               for (h, v) in self._response_headers if h):"},{"line_number":88,"context_line":"            self.logger.error(\"Cannot get necessary keys for path %s\" %"},{"line_number":89,"context_line":"                              req.path)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_4427ef11","line":86,"updated":"2015-09-04 16:52:40.000000000","message":"not safe - its ok to have x-object-meta-my-crypto-meta\n\nneed to check it is specifically x-object-sysmeta-crypto-meta","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"95d62d34720f89369a22f76b92cb9b9279e8ff7b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if not hasattr(self, \u0027_response_headers\u0027):"},{"line_number":84,"context_line":"            return"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        if any(\u0027crypto-meta\u0027 in h.lower()"},{"line_number":87,"context_line":"               for (h, v) in self._response_headers if h):"},{"line_number":88,"context_line":"            self.logger.error(\"Cannot get necessary keys for path %s\" %"},{"line_number":89,"context_line":"                              req.path)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_8e9179f3","line":86,"in_reply_to":"da20952f_4427ef11","updated":"2015-09-07 04:19:22.000000000","message":"agreed.","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                    self.keys[\u0027object\u0027] \u003d \\"},{"line_number":149,"context_line":"                        self.keymaster.get_or_create_and_add_key(obj_key_path)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        except ValueError:"},{"line_number":152,"context_line":"            raise StopEncryption()"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_f61f3e59","line":151,"updated":"2015-09-04 16:52:40.000000000","message":"ValueError is never raised","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                            obj_key_path)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        except ValueError:"},{"line_number":205,"context_line":"            raise StopEncryption()"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"},{"line_number":208,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_64cf9356","line":205,"updated":"2015-09-04 16:52:40.000000000","message":"this is the only place StopEncryption is raised - I suggest we just deal with the error right here and eliminate the new Exception class","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"95d62d34720f89369a22f76b92cb9b9279e8ff7b","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                            obj_key_path)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        except ValueError:"},{"line_number":205,"context_line":"            raise StopEncryption()"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        req.environ[\u0027swift.crypto.fetch_crypto_keys\u0027] \u003d self.fetch_crypto_keys"},{"line_number":208,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_4ebe0166","line":205,"in_reply_to":"da20952f_64cf9356","updated":"2015-09-07 04:19:22.000000000","message":"agreed.","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        types \u003d (\u0027account\u0027, \u0027container\u0027, \u0027object\u0027)"},{"line_number":237,"context_line":"        server_type \u003d \\"},{"line_number":238,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[0]"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_e4308358","line":238,"updated":"2015-09-04 16:52:40.000000000","message":"s/[0]/[1]/","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"95d62d34720f89369a22f76b92cb9b9279e8ff7b","unresolved":false,"context_lines":[{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        types \u003d (\u0027account\u0027, \u0027container\u0027, \u0027object\u0027)"},{"line_number":237,"context_line":"        server_type \u003d \\"},{"line_number":238,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[0]"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_2eb70d86","line":238,"in_reply_to":"da20952f_e4308358","updated":"2015-09-07 04:19:22.000000000","message":"now i am just wondering how the tests were working with this version ...","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        server_type \u003d \\"},{"line_number":238,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[0]"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, server_type, req.path)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            if hasattr(km_context, req.method):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_9b670bb7","line":240,"updated":"2015-09-04 16:52:40.000000000","message":"reduce scope of try - just make call to method in try/except","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c3261bc52249b964f593f558313eefdaf86b835b","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        self.logger.debug(\"There are keys for the following set of ids: %s\""},{"line_number":275,"context_line":"                          % self.internal_keys)"},{"line_number":276,"context_line":"        if key_id not in self.internal_keys:"},{"line_number":277,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # The key was available in the collection, so it is ok"},{"line_number":280,"context_line":"        # to simply return the derived key"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_f6e65ee7","line":277,"updated":"2015-09-04 16:52:40.000000000","message":"checking against internal_keys seems like a double-check - the object sysmeta has a key_id, so is that not sufficient to go ahead and return the key calculated from the key_id?\n\ni.e. we put the sysmeta\u003d\u003dkey_id, therefore we generated the key using that key_id, therefore we should re-generate it here, no questions asked?","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"95d62d34720f89369a22f76b92cb9b9279e8ff7b","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        self.logger.debug(\"There are keys for the following set of ids: %s\""},{"line_number":275,"context_line":"                          % self.internal_keys)"},{"line_number":276,"context_line":"        if key_id not in self.internal_keys:"},{"line_number":277,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # The key was available in the collection, so it is ok"},{"line_number":280,"context_line":"        # to simply return the derived key"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_6e4f4592","line":277,"in_reply_to":"da20952f_f6e65ee7","updated":"2015-09-07 04:19:22.000000000","message":"key_id was not supposed to be a permanent addition.  It was added as a work-around to the path name change for versioned objects.  When testing with versioning and COPY as middleware, I could remove the key-id with no issues.  But, if you think it is good to have anyway, then we can keep it around.","commit_id":"50cd6a4c8b917da901c1f7adba3a545d4280c3bb"}],"swift/common/middleware/trivial_keymaster.py":[{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"da20952f_901e37ba","updated":"2015-09-08 18:43:11.000000000","message":"I wonder if it\u0027s worth while to create a high level comment that explains the simple design here, maybe.\n\n\"The simple scheme used here for testing encryption feature in swift is as follows:  Every path is associated with a key, where the key is derived from the path itself in a deterministic fashion such that the key does not need to be stored.  This is meant to serve as a generic template for any keymaster, and as such some of the logic is not required for the simple encryption scheme utilized, but is included for clarity and future re-use.\"\n\nThoughts ?","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"da20952f_c6613e13","in_reply_to":"da20952f_901e37ba","updated":"2015-09-09 14:41:05.000000000","message":"Done - but for now I omitted claim that this is a generic template - lets live with it for a bit first.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                          req.path)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def provide_keys_put(self, req):"},{"line_number":81,"context_line":"        path_ver, path_acc, path_cont, path_obj \u003d req.split_path(1, 4, True)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        acct_key_path \u003d os.path.join(os.sep, path_ver, path_acc)"},{"line_number":84,"context_line":"        # server_type represents the item to \"PUT\""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_109d470a","line":81,"updated":"2015-09-08 18:43:11.000000000","message":"This should really use a min of \u00272\u0027 correct ? Though we really can\u0027t get here if there was just the version (TrivialKeyMaster would have filtered it out).","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def provide_keys_put(self, req):"},{"line_number":81,"context_line":"        path_ver, path_acc, path_cont, path_obj \u003d req.split_path(1, 4, True)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        acct_key_path \u003d os.path.join(os.sep, path_ver, path_acc)"},{"line_number":84,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":85,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_b3ed85b9","line":82,"updated":"2015-09-08 18:43:11.000000000","message":"I wonder if this code can be slightly refactored as the handling of the account / container keys are identical (e.g. a loop).  I can propose a patch set on top of this with what I have in mind.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        acct_key_path \u003d os.path.join(os.sep, path_ver, path_acc)"},{"line_number":84,"context_line":"        # server_type represents the item to \"PUT\""},{"line_number":85,"context_line":"        if self.server_type \u003d\u003d \u0027account\u0027:"},{"line_number":86,"context_line":"            # generate a new key even if an account with same path exists"},{"line_number":87,"context_line":"            self.keys[\u0027account\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":88,"context_line":"                acct_key_path)"},{"line_number":89,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_33f655fa","line":86,"updated":"2015-09-08 18:43:11.000000000","message":"Slightly expand the command to add the \"why\": \"generate a new key even if an account with same path exists so that if the account is re-created a new key is used\" ? Though with this scheme it wouldn\u0027t really matter given the derived key from the path. Good for others though as a baseline.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"            if self.server_type \u003d\u003d \u0027container\u0027:"},{"line_number":97,"context_line":"                self.keys[\u0027container\u0027] \u003d self.keymaster.create_and_add_key("},{"line_number":98,"context_line":"                    cont_key_path)"},{"line_number":99,"context_line":"            else:"},{"line_number":100,"context_line":"                self.keys[\u0027container\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_53ce69b8","line":97,"updated":"2015-09-08 18:43:11.000000000","message":"Maybe add a comment here like in the account case (i.e. for create_and_add usage).","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                obj_key_path \u003d os.path.join(cont_key_path, path_obj)"},{"line_number":105,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.get_or_create_and_add_key("},{"line_number":106,"context_line":"                    obj_key_path)"},{"line_number":107,"context_line":"                # TODO - is saving this id the right approach to handle"},{"line_number":108,"context_line":"                # versioned objs?  It was needed because the path changes"},{"line_number":109,"context_line":"                id_name \u003d \"%s-crypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":110,"context_line":"                req.headers[id_name] \u003d \\"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_a6c30157","line":107,"updated":"2015-09-08 18:43:11.000000000","message":"I think we can get rid of this with copy middleware we shouldn\u0027t need any of this logic anymore (will test).","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"ab024a0599a514124a85dcb2ed15d88d302e8513","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":143,"context_line":"            self.keys[\u0027container\u0027] \u003d self.keymaster.create_key("},{"line_number":144,"context_line":"                cont_key_path)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"            if path_obj:"},{"line_number":147,"context_line":"                try:"},{"line_number":148,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_4123e1a7","line":145,"updated":"2015-09-09 02:42:31.000000000","message":"I had been using get_key here because I was thinking it was good to test that in the flow, the key had already been generated for the container that is involved in a GET or HEAD. But, I suppose we could just leave that to the testing of a \u0027real\u0027 keymaster. For our trivial_keymaster, it will just always find a key. In that case, we may as well remove the key_ids collection and the get_key usage for everything, right? It seems like we have an inconsistent strategy right now.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"1d8875f1be8fdd52a909f973cc0ee547e412089f","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":143,"context_line":"            self.keys[\u0027container\u0027] \u003d self.keymaster.create_key("},{"line_number":144,"context_line":"                cont_key_path)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"            if path_obj:"},{"line_number":147,"context_line":"                try:"},{"line_number":148,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_ade3cca3","line":145,"in_reply_to":"da20952f_4123e1a7","updated":"2015-09-09 06:42:11.000000000","message":"I concur with this. Looks like we don\u0027t need to test key presence for trivial_keymaster. I don\u0027t see why we should, unless this is something related to the memcache to persist keys so that proxy can pick them up?","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":143,"context_line":"            self.keys[\u0027container\u0027] \u003d self.keymaster.create_key("},{"line_number":144,"context_line":"                cont_key_path)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"            if path_obj:"},{"line_number":147,"context_line":"                try:"},{"line_number":148,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_2c9b3974","line":145,"in_reply_to":"da20952f_4123e1a7","updated":"2015-09-09 14:41:05.000000000","message":"We do have a test that the same key is generated for consecutive requests. I know thats not quite what you are saying. But then existing tests should break if keymaster is being inconsistent with key generation.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            cont_key_path \u003d os.path.join(acct_key_path, path_cont)"},{"line_number":143,"context_line":"            self.keys[\u0027container\u0027] \u003d self.keymaster.create_key("},{"line_number":144,"context_line":"                cont_key_path)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"            if path_obj:"},{"line_number":147,"context_line":"                try:"},{"line_number":148,"context_line":"                    obj_key_path \u003d os.path.join(cont_key_path, path_obj)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_cc039dbd","line":145,"in_reply_to":"da20952f_ade3cca3","updated":"2015-09-09 14:41:05.000000000","message":"I switched this from get_key because I wanted to be able to manually test crypto with proxy restarts - the restart would lose the keys state and make it impossible to perform requests on any existing container.\n\nI agree it becomes inconsistent with the object case but I didn\u0027t change the object case for fear of breaking something w.r.t. versions/COPY - in that case the keys dict serves as a means to verify \"did this obj get written via keymaster?\" and if not allow the sysmeta key id to be used to lookup an alternative key for this path.\n\nBut I think the same can be achieved by looking at object sysmeta and always using its key id to create the key.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                    try:"},{"line_number":151,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":152,"context_line":"                            obj_key_path)"},{"line_number":153,"context_line":"                    except ValueError:"},{"line_number":154,"context_line":"                        # The req \"path\" didn\u0027t have a key, but maybe"},{"line_number":155,"context_line":"                        # there was a different path on the PUT"},{"line_number":156,"context_line":"                        # like in the case of versioning"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_c6c87559","line":153,"updated":"2015-09-08 18:43:11.000000000","message":"A lot of this logic can probably go as well if we can get rid of crypto-id","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                    try:"},{"line_number":151,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":152,"context_line":"                            obj_key_path)"},{"line_number":153,"context_line":"                    except ValueError:"},{"line_number":154,"context_line":"                        # The req \"path\" didn\u0027t have a key, but maybe"},{"line_number":155,"context_line":"                        # there was a different path on the PUT"},{"line_number":156,"context_line":"                        # like in the case of versioning"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_ecd6a126","line":153,"in_reply_to":"da20952f_c1185178","updated":"2015-09-09 14:41:05.000000000","message":"With versioning and COPY in middleware then IMHO we can lose crypto-id. But I would keep for now until we actually have COPY middleware.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"ab024a0599a514124a85dcb2ed15d88d302e8513","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                    try:"},{"line_number":151,"context_line":"                        self.keys[\u0027object\u0027] \u003d self.keymaster.get_key("},{"line_number":152,"context_line":"                            obj_key_path)"},{"line_number":153,"context_line":"                    except ValueError:"},{"line_number":154,"context_line":"                        # The req \"path\" didn\u0027t have a key, but maybe"},{"line_number":155,"context_line":"                        # there was a different path on the PUT"},{"line_number":156,"context_line":"                        # like in the case of versioning"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_c1185178","line":153,"in_reply_to":"da20952f_c6c87559","updated":"2015-09-09 02:42:31.000000000","message":"Because the versioning and COPY as middlware will land first, \nAND\nIf we change all the \"get_key\" calls to create_key, which would mean that we always derive the keys, \n\nthen we wouldn\u0027t need the crypto-id for anything.\n\nbut if we decide to keep the testing of the key presence (to test the flow of the tests themselves), then we could change the logic to go off of the presence of the crypto-id to determine whether there was a key created or not, at least for the object.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self.app \u003d app"},{"line_number":200,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":201,"context_line":"        # collection of key ids to test inclusion"},{"line_number":202,"context_line":"        self.internal_keys \u003d set()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def __call__(self, env, start_response):"},{"line_number":205,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_70ecc329","line":202,"updated":"2015-09-08 18:43:11.000000000","message":"I find this name confusing as it is not really a set of internal keys at all, could we call it key_paths or maybe key_ids?  Not sure that\u0027s perfect either though.  key_path seems clearer unless we\u0027re intentionally trying to hide the notion that we associate a path with a key.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self.app \u003d app"},{"line_number":200,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":201,"context_line":"        # collection of key ids to test inclusion"},{"line_number":202,"context_line":"        self.internal_keys \u003d set()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def __call__(self, env, start_response):"},{"line_number":205,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_8c8045f9","line":202,"in_reply_to":"da20952f_70ecc329","updated":"2015-09-09 14:41:05.000000000","message":"Lets just eliminate it :)","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        except ValueError:"},{"line_number":210,"context_line":"            return self.app(env, start_response)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        types \u003d (\u0027account\u0027, \u0027container\u0027, \u0027object\u0027)"},{"line_number":213,"context_line":"        server_type \u003d \\"},{"line_number":214,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[1]"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_bc46b71f","line":212,"updated":"2015-09-08 18:43:11.000000000","message":"This is really neet !  Mind you, not being very strong with python, it took me a while to understand and validate this was indeed doing what we want.  Very nice !","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        except ValueError:"},{"line_number":210,"context_line":"            return self.app(env, start_response)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        types \u003d (\u0027account\u0027, \u0027container\u0027, \u0027object\u0027)"},{"line_number":213,"context_line":"        server_type \u003d \\"},{"line_number":214,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[1]"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_ac9c295e","line":212,"in_reply_to":"da20952f_bc46b71f","updated":"2015-09-09 14:41:05.000000000","message":"Yah, I think i put a tongue-in-cheek when I suggested it, its a little opaque.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        types \u003d (\u0027account\u0027, \u0027container\u0027, \u0027object\u0027)"},{"line_number":213,"context_line":"        server_type \u003d \\"},{"line_number":214,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[1]"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        km_context \u003d TrivialKeyMasterContext(self, server_type)"},{"line_number":217,"context_line":"        if hasattr(km_context, req.method):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_7cfedfaf","line":214,"updated":"2015-09-08 18:43:11.000000000","message":"Actually one thought, could we have the lamda return y[1] and x[1] ... in my mind that\u0027s slightly clearer when compared to the trailing index, but that\u0027s probably just me (and your existing version is indeed shorter).","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        server_type \u003d \\"},{"line_number":214,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[1]"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        km_context \u003d TrivialKeyMasterContext(self, server_type)"},{"line_number":217,"context_line":"        if hasattr(km_context, req.method):"},{"line_number":218,"context_line":"            try:"},{"line_number":219,"context_line":"                return getattr(km_context, req.method)(req, start_response)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_442d18fc","line":216,"updated":"2015-09-09 14:41:05.000000000","message":"lets not create a km_context unless we are going to use it - do the hasattr on the class not th einstance","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            reduce(lambda x, y: y if y[0] else x, zip(parts, types))[1]"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        km_context \u003d TrivialKeyMasterContext(self, server_type)"},{"line_number":217,"context_line":"        if hasattr(km_context, req.method):"},{"line_number":218,"context_line":"            try:"},{"line_number":219,"context_line":"                return getattr(km_context, req.method)(req, start_response)"},{"line_number":220,"context_line":"            except HTTPException as err_resp:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_b0181b77","line":217,"updated":"2015-09-08 18:43:11.000000000","message":"Very nice and clean !  You could condense it a little by skipping the hasattr call and ignore the AttributeError exception potentially raised by getattr.  But I like the way you have it better, just an fyi","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        # TODO: do we need to store key_id\u0027s at all? if the object has"},{"line_number":244,"context_line":"        # sysmeta with a key_id stored then is that not sufficient to go ahead"},{"line_number":245,"context_line":"        # and recalculate the key?"},{"line_number":246,"context_line":"        # to validate that a key should"},{"line_number":247,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":248,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":249,"context_line":"                          % self.internal_keys)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_f0c9b37a","line":246,"updated":"2015-09-08 18:43:11.000000000","message":"We aren\u0027t storing key_id (path) with sysmeta though ?  Did this comment mean to say if an object has crypto meta ?","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"ab024a0599a514124a85dcb2ed15d88d302e8513","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":248,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":249,"context_line":"                          % self.internal_keys)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def get_key(self, key_id):"},{"line_number":252,"context_line":"        self.logger.debug(\"There are keys for the following set of ids: %s\""},{"line_number":253,"context_line":"                          % self.internal_keys)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_1e3f8888","line":250,"updated":"2015-09-09 02:42:31.000000000","message":"remove this log.  its too long for the logfile.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self.internal_keys.add(key_id)"},{"line_number":248,"context_line":"        self.logger.debug(\"Added key.  There are keys for this set of ids: %s\""},{"line_number":249,"context_line":"                          % self.internal_keys)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def get_key(self, key_id):"},{"line_number":252,"context_line":"        self.logger.debug(\"There are keys for the following set of ids: %s\""},{"line_number":253,"context_line":"                          % self.internal_keys)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_0cdaf517","line":250,"in_reply_to":"da20952f_1e3f8888","updated":"2015-09-09 14:41:05.000000000","message":"Done","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"ab024a0599a514124a85dcb2ed15d88d302e8513","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def get_key(self, key_id):"},{"line_number":252,"context_line":"        self.logger.debug(\"There are keys for the following set of ids: %s\""},{"line_number":253,"context_line":"                          % self.internal_keys)"},{"line_number":254,"context_line":"        if key_id not in self.internal_keys:"},{"line_number":255,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_febf34fa","line":253,"updated":"2015-09-09 02:42:31.000000000","message":"remove this log.  its too long for the logfile.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def get_key(self, key_id):"},{"line_number":252,"context_line":"        self.logger.debug(\"There are keys for the following set of ids: %s\""},{"line_number":253,"context_line":"                          % self.internal_keys)"},{"line_number":254,"context_line":"        if key_id not in self.internal_keys:"},{"line_number":255,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_cc02bd72","line":253,"in_reply_to":"da20952f_febf34fa","updated":"2015-09-09 14:41:05.000000000","message":"Done","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"07bdd98e4e2de1b4629376d6f4512d0d893ebb7e","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        # The key was available in the collection, so it is ok"},{"line_number":258,"context_line":"        # to simply return the derived key"},{"line_number":259,"context_line":"        return self.create_key(key_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_70b923cb","line":258,"updated":"2015-09-08 18:43:11.000000000","message":"# to simply return the derived key\n-\u003e\n# to simply create the derived key\n\nMore accurately portrays what we\u0027re doing.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"1d8875f1be8fdd52a909f973cc0ee547e412089f","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        # The key was available in the collection, so it is ok"},{"line_number":258,"context_line":"        # to simply return the derived key"},{"line_number":259,"context_line":"        return self.create_key(key_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_8d636841","line":258,"in_reply_to":"da20952f_70b923cb","updated":"2015-09-09 06:42:11.000000000","message":"+1","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"131eef18d916b55929da340263bccb2e586bb349","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            raise ValueError(\"key id %s is not recognized.\" % id)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        # The key was available in the collection, so it is ok"},{"line_number":258,"context_line":"        # to simply return the derived key"},{"line_number":259,"context_line":"        return self.create_key(key_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_2ceed9b4","line":258,"in_reply_to":"da20952f_70b923cb","updated":"2015-09-09 14:41:05.000000000","message":"gone away.","commit_id":"47c6ddb7b2231883416a226cd6bad1f5036d631f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"class TrivialKeyMasterContext(WSGIContext):"},{"line_number":39,"context_line":"    def __init__(self, keymaster, account, container, object):"},{"line_number":40,"context_line":"        super(TrivialKeyMasterContext, self).__init__(keymaster.app)"},{"line_number":41,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":42,"context_line":"        self.logger \u003d keymaster.logger"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_c349fe8f","line":39,"updated":"2015-09-10 09:29:45.000000000","message":"-1 I should not be using object as a var name!","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(TrivialKeyMasterContext, self).__init__(keymaster.app)"},{"line_number":41,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":42,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_8048f3cd","line":43,"updated":"2015-09-09 18:27:57.000000000","message":"Noooooo where is that reduce / lamba computation on the path that took me 10min to understand, I want that back !!! : )","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(TrivialKeyMasterContext, self).__init__(keymaster.app)"},{"line_number":41,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":42,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_a3116a06","line":43,"in_reply_to":"da20952f_8048f3cd","updated":"2015-09-10 09:29:45.000000000","message":"Given that I also spent several minutes understanding it within a few weeks of writing it, I felt it was unnecessarily obtuse :D","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":42,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_c06cab38","line":44,"updated":"2015-09-09 18:27:57.000000000","message":"I like keeping the __init__ logic fairly clean, potentially consider creating an internal helper function for the path manipulation, move all this logic there, and just call that here.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.keymaster \u003d keymaster"},{"line_number":42,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_032ff6a1","line":44,"in_reply_to":"da20952f_c06cab38","updated":"2015-09-10 09:29:45.000000000","message":"Done","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.logger \u003d keymaster.logger"},{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.container_path \u003d self.object_path \u003d None"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_10ad1a9b","line":45,"updated":"2015-09-10 09:29:45.000000000","message":"NOTE: I dropped the version part from the path used to calculate the keys. One day we or or descendants might use a new API version and still want to calculate the keys.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.container_path \u003d self.object_path \u003d None"},{"line_number":49,"context_line":"        if container:"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_433665b5","line":46,"updated":"2015-09-09 18:27:57.000000000","message":"Should add a comment explaining the logic here (or a docstring if we move it to a function).  Essentially something like:\n# Derive the key based on the request path, this process is the same for any method (i.e. GET / PUT / HEAD).\n# Note that account encryption is not currently supported.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.keys \u003d {}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.container_path \u003d self.object_path \u003d None"},{"line_number":49,"context_line":"        if container:"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_463adcce","line":46,"in_reply_to":"da20952f_433665b5","updated":"2015-09-10 09:29:45.000000000","message":"Done but I\u0027d rather not start documenting what is not supported","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.container_path \u003d self.object_path \u003d None"},{"line_number":49,"context_line":"        if container:"},{"line_number":50,"context_line":"            self.server_type \u003d \u0027container\u0027"},{"line_number":51,"context_line":"            self.container_path \u003d os.path.join(self.account_path, container)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_e0aa0f1a","line":48,"updated":"2015-09-09 18:27:57.000000000","message":"Add a blank line and / or move the container_path initialization in the same block as the account_path.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.account_path \u003d os.path.join(os.sep, account)"},{"line_number":46,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.container_path \u003d self.object_path \u003d None"},{"line_number":49,"context_line":"        if container:"},{"line_number":50,"context_line":"            self.server_type \u003d \u0027container\u0027"},{"line_number":51,"context_line":"            self.container_path \u003d os.path.join(self.account_path, container)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_46417c38","line":48,"in_reply_to":"da20952f_e0aa0f1a","updated":"2015-09-10 09:29:45.000000000","message":"Done","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self.object_path:"},{"line_number":62,"context_line":"            # special case for object PUT - save key_id as obj sysmeta"},{"line_number":63,"context_line":"            # TODO - is saving this id the right approach to handle"},{"line_number":64,"context_line":"            # versioned objs?  It was needed because the path changes"},{"line_number":65,"context_line":"            id_name \u003d \"%scrypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":66,"context_line":"            req.headers[id_name] \u003d \\"},{"line_number":67,"context_line":"                base64.b64encode(self.object_path)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_03438d6d","line":64,"updated":"2015-09-09 18:27:57.000000000","message":"Can we append to this comment \"this may no longer be needed with latest and great copy / versioning logic, we need to test\"","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self.object_path:"},{"line_number":62,"context_line":"            # special case for object PUT - save key_id as obj sysmeta"},{"line_number":63,"context_line":"            # TODO - is saving this id the right approach to handle"},{"line_number":64,"context_line":"            # versioned objs?  It was needed because the path changes"},{"line_number":65,"context_line":"            id_name \u003d \"%scrypto-id\" % get_obj_persisted_sysmeta_prefix()"},{"line_number":66,"context_line":"            req.headers[id_name] \u003d \\"},{"line_number":67,"context_line":"                base64.b64encode(self.object_path)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_8640f408","line":64,"in_reply_to":"da20952f_03438d6d","updated":"2015-09-10 09:29:45.000000000","message":"improved (I hope!) the comment","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                          req.path)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def provide_keys_get_or_head(self, req):"},{"line_number":113,"context_line":"        if self.object_path:"},{"line_number":114,"context_line":"            # special case for objects"},{"line_number":115,"context_line":"            try:"},{"line_number":116,"context_line":"                id_name \u003d \\"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_5efe3c06","line":113,"updated":"2015-09-09 18:27:57.000000000","message":"hmm, so was we leaving this going forward even if the cypto-id isn\u0027t required (for versioning) but rather as a test of whether this object should be encrypted ?  In that case I think we need to explain that better through comments (i.e. its not really a \u0027special case\u0027), we can re-evaluate this one later though.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                          req.path)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def provide_keys_get_or_head(self, req):"},{"line_number":113,"context_line":"        if self.object_path:"},{"line_number":114,"context_line":"            # special case for objects"},{"line_number":115,"context_line":"            try:"},{"line_number":116,"context_line":"                id_name \u003d \\"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_351fe2b8","line":113,"in_reply_to":"da20952f_5efe3c06","updated":"2015-09-10 09:29:45.000000000","message":"I may be wrong but I suspect we will need the crypto-id workaround for COPY too until we have the COPY middleware in place.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"52378d5a25947cc320ea683a63edfd3ce532e9a0","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.create_key("},{"line_number":136,"context_line":"                    obj_key_path)"},{"line_number":137,"context_line":"            except ValueError:"},{"line_number":138,"context_line":"                req.environ[\u0027swift.crypto.override\u0027] \u003d True"},{"line_number":139,"context_line":"                # TODO: FakeFooters will *always* insert crypto sysmeta"},{"line_number":140,"context_line":"                # headers in responses which will cause this check to"},{"line_number":141,"context_line":"                # always fail so disable for now."}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_f8d2bad0","line":138,"updated":"2015-09-10 02:22:50.000000000","message":"Well, fake_footers would not insert crypto sysmeta if it was handling a GET for an existing non-encrypted object (with a path never used for encryption).  But maybe what you are pointing out is that if a path is re-used, the previous crypto-meta hangs around forever in memcache?","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                self.keys[\u0027object\u0027] \u003d self.keymaster.create_key("},{"line_number":136,"context_line":"                    obj_key_path)"},{"line_number":137,"context_line":"            except ValueError:"},{"line_number":138,"context_line":"                req.environ[\u0027swift.crypto.override\u0027] \u003d True"},{"line_number":139,"context_line":"                # TODO: FakeFooters will *always* insert crypto sysmeta"},{"line_number":140,"context_line":"                # headers in responses which will cause this check to"},{"line_number":141,"context_line":"                # always fail so disable for now."}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_c3033e75","line":138,"in_reply_to":"da20952f_f8d2bad0","updated":"2015-09-10 09:29:45.000000000","message":"My comment isn\u0027t very clear, sorry. The problem I observed was: object gets PUT, fake footers are stashed in memcache, GET request generates a 401 response, fake footers inserts stashed crypto meta BUT there is no crypto-id, so error_if_need_keys raises a 422, and a bunch of functional tests failed.\n\nPreviously, IIRC, get_key would always give us a key in those circumstances so we\u0027d never end up in this except clause.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    def __init__(self, app, conf):"},{"line_number":159,"context_line":"        self.app \u003d app"},{"line_number":160,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":161,"context_line":"        # TODO: optionally load root key from conf"},{"line_number":162,"context_line":"        self.root_key \u003d \u0027secret\u0027.encode(\u0027utf-8\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def __call__(self, env, start_response):"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_a01417e9","line":161,"updated":"2015-09-09 18:27:57.000000000","message":"Not sure it\u0027s really too important for the trivial keymaster, I\u0027m trying to think how it can help (i.e. to load this externally), doesn\u0027t really work for byok anymore so than the current implementation, maybe its fine just to keep it hardcoded as it is today.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"f6e0b55299d4e903a24ce5e1228130a24ee5f7fd","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    def __init__(self, app, conf):"},{"line_number":159,"context_line":"        self.app \u003d app"},{"line_number":160,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":161,"context_line":"        # TODO: optionally load root key from conf"},{"line_number":162,"context_line":"        self.root_key \u003d \u0027secret\u0027.encode(\u0027utf-8\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def __call__(self, env, start_response):"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_bddbcc4e","line":161,"in_reply_to":"da20952f_a01417e9","updated":"2015-09-10 07:27:16.000000000","message":"I think this should still work with byok - if we\u0027re going to extract a client key from headers, we would filter the key in a PUT/GET etc and would not even come to \"create_key\". I have an implementation which is towards the end of this patch chain - 220897","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    def __init__(self, app, conf):"},{"line_number":159,"context_line":"        self.app \u003d app"},{"line_number":160,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"trivial_keymaster\")"},{"line_number":161,"context_line":"        # TODO: optionally load root key from conf"},{"line_number":162,"context_line":"        self.root_key \u003d \u0027secret\u0027.encode(\u0027utf-8\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def __call__(self, env, start_response):"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_4372ce7d","line":161,"in_reply_to":"da20952f_a01417e9","updated":"2015-09-10 09:29:45.000000000","message":"I\u0027m dotting these TODO\u0027s around the place to act as reminder for things to revisit before proposing to master. They are not intended to imply that things *should* be done.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"6ae543f80c6882043479d65d9a7a5fa4a5f4f8ff","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except ValueError:"},{"line_number":170,"context_line":"            return self.app(env, start_response)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        if hasattr(TrivialKeyMasterContext, req.method):"},{"line_number":173,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, *parts[1:])"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                return getattr(km_context, req.method)(req, start_response)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_e09d2f58","line":172,"updated":"2015-09-09 18:27:57.000000000","message":"It may be self explanatory but consider a comment like:\n# Not all methods require and / or support encryption and hence no need for keys.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"d1a8b83784ded94ab3fde14d8d3dd55c07e84cc9","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except ValueError:"},{"line_number":170,"context_line":"            return self.app(env, start_response)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        if hasattr(TrivialKeyMasterContext, req.method):"},{"line_number":173,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, *parts[1:])"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                return getattr(km_context, req.method)(req, start_response)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_350ca741","line":172,"in_reply_to":"da20952f_43264e17","updated":"2015-09-10 13:49:35.000000000","message":"Yep exactly, that was it !  But its really minor should have had several \u0027NITs\u0027 littered throughout my comment : )","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"52378d5a25947cc320ea683a63edfd3ce532e9a0","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except ValueError:"},{"line_number":170,"context_line":"            return self.app(env, start_response)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        if hasattr(TrivialKeyMasterContext, req.method):"},{"line_number":173,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, *parts[1:])"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                return getattr(km_context, req.method)(req, start_response)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_f4c89177","line":172,"in_reply_to":"da20952f_e09d2f58","updated":"2015-09-10 02:22:50.000000000","message":"I am not sure what you mean by this.  the hasattr check is to see if the request method exists in the context object.  This change was made when we changed the method names to match the request method.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except ValueError:"},{"line_number":170,"context_line":"            return self.app(env, start_response)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        if hasattr(TrivialKeyMasterContext, req.method):"},{"line_number":173,"context_line":"            km_context \u003d TrivialKeyMasterContext(self, *parts[1:])"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                return getattr(km_context, req.method)(req, start_response)"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_43264e17","line":172,"in_reply_to":"da20952f_f4c89177","updated":"2015-09-10 09:29:45.000000000","message":"I guess hrou is referring to HTTP methods - so DELETE, OPTIONS don\u0027t require key.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a2c089637c2807ee1acb49ccdbd578937cb22a25","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        \"\"\""},{"line_number":52,"context_line":"        self.keys \u003d {}"},{"line_number":53,"context_line":"        self.account_path \u003d os.path.join(os.sep, self.account)"},{"line_number":54,"context_line":"        self.server_type \u003d \u0027account\u0027"},{"line_number":55,"context_line":"        self.container_path \u003d self.obj_path \u003d None"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        if self.container:"}],"source_content_type":"text/x-python","patch_set":16,"id":"da20952f_4b409707","line":54,"updated":"2015-09-10 14:36:31.000000000","message":"Thanks for dropping the version.  \"our descendants\" - hee hee :-)","commit_id":"220d98f2e7a1d748bd9842ed1d51a047002766a8"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a2c089637c2807ee1acb49ccdbd578937cb22a25","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                # TODO: uncomment when FakeFooters has been replaced with"},{"line_number":157,"context_line":"                # real footer support. Fake Footers will insert crypto sysmeta"},{"line_number":158,"context_line":"                # headers into all responses including 4xx that may have been"},{"line_number":159,"context_line":"                # generated in the proxy (e.g. auth failures). This will cause"},{"line_number":160,"context_line":"                # error_if_need_keys to replace the expected 4xx with a 422."},{"line_number":161,"context_line":"                # So disable the check for now."},{"line_number":162,"context_line":"                # self.error_if_need_keys(req)"}],"source_content_type":"text/x-python","patch_set":16,"id":"da20952f_eb572c24","line":159,"updated":"2015-09-10 14:36:31.000000000","message":"Should we catch the error status just after we get the response?  I think that is what I had done before.","commit_id":"220d98f2e7a1d748bd9842ed1d51a047002766a8"}],"test/unit/common/middleware/test_trivial_keymaster.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            return start_response(s, h, ei)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.app(self.req.environ, my_start_response)"},{"line_number":59,"context_line":"        return status[0], headers[0], env"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"class FakeAppThatExcepts(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_f4c0792c","line":59,"updated":"2015-07-01 00:14:46.000000000","message":"So we have a pretty good Fake already that might be better than rolling your own\n\nhttps://gist.github.com/clayg/de02ecced04376315e85\n\nThe FakeSwift would be really good when you want to setup some unittests that do a little more integration/interaction assertions - as is is the keymaster doesn\u0027t effect the request very much.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            return start_response(s, h, ei)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.app(self.req.environ, my_start_response)"},{"line_number":59,"context_line":"        return status[0], headers[0], env"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"class FakeAppThatExcepts(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_a5de3d0f","line":59,"in_reply_to":"ba3cc151_f4c0792c","updated":"2015-07-01 02:17:06.000000000","message":"thanks, I will take a look.","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a19f0c13a7dbecc609abebaa68e0aa0573a7ea17","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        keys \u003d (req.environ.get(\u0027swift.crypto.fetch_crypto_keys\u0027))()"},{"line_number":119,"context_line":"        if not keys:"},{"line_number":120,"context_line":"            self.fail(\u0027fetch_crypto_keys not set in env\u0027)"},{"line_number":121,"context_line":"        if [\u0027object\u0027, \u0027container\u0027, \u0027account\u0027] in keys.keys():"},{"line_number":122,"context_line":"            print \"keys were %s\" % keys"},{"line_number":123,"context_line":"            self.fail(\u0027The set of keys was not complete\u0027)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_9ebd8e6a","line":121,"updated":"2015-07-01 00:14:46.000000000","message":"this list of three elements will almost never in the list returned keys.keys()\n\nDid you mean something like this:\n\nhttps://gist.github.com/clayg/1293f51f46728cbfe66a","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"1b3872c810670f795695057253c92f9ab5a5867e","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        keys \u003d (req.environ.get(\u0027swift.crypto.fetch_crypto_keys\u0027))()"},{"line_number":119,"context_line":"        if not keys:"},{"line_number":120,"context_line":"            self.fail(\u0027fetch_crypto_keys not set in env\u0027)"},{"line_number":121,"context_line":"        if [\u0027object\u0027, \u0027container\u0027, \u0027account\u0027] in keys.keys():"},{"line_number":122,"context_line":"            print \"keys were %s\" % keys"},{"line_number":123,"context_line":"            self.fail(\u0027The set of keys was not complete\u0027)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_650d958f","line":121,"in_reply_to":"ba3cc151_9ebd8e6a","updated":"2015-07-01 02:17:06.000000000","message":"oops - got a little careless on that one.  thanks for catching that!","commit_id":"52772385cefa3f6e47bc072035e72d7a5f343587"},{"author":{"_account_id":17156,"name":"Hamdi Roumani","email":"roumani@ca.ibm.com","username":"hroumani"},"change_message_id":"e039f9c7e4564e38fa5da2c8b04608f0a597bf94","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def test_acct_get(self):"},{"line_number":100,"context_line":"        self.verify_get_head(\u0027/v1/a\u0027, \u0027GET\u0027, expected_keys\u003d(\u0027account\u0027,))"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def verify_put_post(self, path, method, expected_keys\u003d("},{"line_number":103,"context_line":"            \u0027object\u0027, \u0027container\u0027, \u0027account\u0027)):"},{"line_number":104,"context_line":"        self.swift.register(method, path, swob.HTTPCreated, {}, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_c58d77d4","line":101,"updated":"2015-08-01 20:15:34.000000000","message":"Should we add some tests for obj versioning given there is some logic to handle this in the trivialkeymaster.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"e6ac0d079e5756dc18ded16cb7ef6460d561163c","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def test_acct_get(self):"},{"line_number":100,"context_line":"        self.verify_get_head(\u0027/v1/a\u0027, \u0027GET\u0027, expected_keys\u003d(\u0027account\u0027,))"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def verify_put_post(self, path, method, expected_keys\u003d("},{"line_number":103,"context_line":"            \u0027object\u0027, \u0027container\u0027, \u0027account\u0027)):"},{"line_number":104,"context_line":"        self.swift.register(method, path, swob.HTTPCreated, {}, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_9e8f1075","line":101,"in_reply_to":"3a50d1a3_c58d77d4","updated":"2015-08-10 03:18:26.000000000","message":"added to the etherpad as a todo.","commit_id":"ecac1ddd0622df10a4c26ff45238198f8338e041"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"52378d5a25947cc320ea683a63edfd3ce532e9a0","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            start_response, calls \u003d capture_start_response()"},{"line_number":142,"context_line":"            app(req.environ, start_response)"},{"line_number":143,"context_line":"            self.assertEqual(1, len(calls))"},{"line_number":144,"context_line":"            # TODO change to expect 422 once Fake Footers is removed"},{"line_number":145,"context_line":"            self.assertEqual(\u0027200 OK\u0027, calls[0][0])"},{"line_number":146,"context_line":"            # self.assertEqual(\u0027422 Unprocessable Entity\u0027, calls[0][0])"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_1bd20835","line":144,"updated":"2015-09-10 02:22:50.000000000","message":"This is related to my other comment in trivial_keymaster.  Once I understand why we cannot have the check for this error case in the trivial_keymaster, then I might suggest a change to the comment here.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3413104871179579e43bdcb8c9e4cf3556e2d096","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            start_response, calls \u003d capture_start_response()"},{"line_number":142,"context_line":"            app(req.environ, start_response)"},{"line_number":143,"context_line":"            self.assertEqual(1, len(calls))"},{"line_number":144,"context_line":"            # TODO change to expect 422 once Fake Footers is removed"},{"line_number":145,"context_line":"            self.assertEqual(\u0027200 OK\u0027, calls[0][0])"},{"line_number":146,"context_line":"            # self.assertEqual(\u0027422 Unprocessable Entity\u0027, calls[0][0])"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_b159b437","line":144,"in_reply_to":"da20952f_1bd20835","updated":"2015-09-10 09:29:45.000000000","message":"I expanded the comment.","commit_id":"0a74b0562442dcc961815e50a72e7e2f0481b81a"}]}
