)]}'
{"swift/common/middleware/crypto/crypto_utils.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"825484d9951cf18368b812659fa8f8f6e5b264f6","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    crypto_meta \u003d None"},{"line_number":274,"context_line":"    # we only attempt to extract crypto meta from values that we know were"},{"line_number":275,"context_line":"    # encrypted and base64-encoded, or from etag values, so it\u0027s safe to split"},{"line_number":276,"context_line":"    # on \u0027;\u0027 even if it turns out that the value was an unencrypted etag"},{"line_number":277,"context_line":"    parts \u003d value.split(\u0027;\u0027)"},{"line_number":278,"context_line":"    if len(parts) \u003d\u003d 2:"},{"line_number":279,"context_line":"        value, param \u003d parts"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_9a92529e","side":"PARENT","line":276,"updated":"2017-03-02 14:58:31.000000000","message":"I noticed we no longer have a comment about how it is safe to split on on \u0027;\u0027 because of encoding.  It may be still worth emphasizing in the request_healpers extract_metadata_from_value that the safety of the split should be considered, since values may originate from user input.","commit_id":"1f36b5dd1617eb971327893635402529becd584d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b8608e0a5f917ca2a4aaa09623d3166bd264043b","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    crypto_meta \u003d None"},{"line_number":274,"context_line":"    # we only attempt to extract crypto meta from values that we know were"},{"line_number":275,"context_line":"    # encrypted and base64-encoded, or from etag values, so it\u0027s safe to split"},{"line_number":276,"context_line":"    # on \u0027;\u0027 even if it turns out that the value was an unencrypted etag"},{"line_number":277,"context_line":"    parts \u003d value.split(\u0027;\u0027)"},{"line_number":278,"context_line":"    if len(parts) \u003d\u003d 2:"},{"line_number":279,"context_line":"        value, param \u003d parts"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_618bc3c3","side":"PARENT","line":276,"updated":"2017-03-03 18:18:20.000000000","message":"I think this behavior would be better described by a test than a comment:\n\n    extract_metadata_from_value(\u0027monkies; foo\u003dbar\u0027, \u0027foo\u003d\u0027)\n    (\u0027monkies\u0027, \u0027bar\u0027)\n\n    # more than one ; is considered invalid and will not be parsed\n    extract_metadata_from_value(\u0027monkies; foo\u003dbar;\u0027, \u0027foo\u003d\u0027)\n    (\u0027monkies; foo\u003dbar;\u0027, None)\n\nbut... maybe cgi.parse_header *would* be a better pattern?\n\n    parse_header(\u0027monkies; foo\u003dbar ; biz\u003dbaz\u0027)\n    (\u0027monkies\u0027, {\u0027biz\u0027: \u0027baz\u0027, \u0027foo\u0027: \u0027bar\u0027})\n\n    parse_header(\u0027monkies; foo\u003dbar ; biz\u0027)\n    (\u0027monkies\u0027, {\u0027foo\u0027: \u0027bar\u0027})","commit_id":"1f36b5dd1617eb971327893635402529becd584d"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"ca5f7b61f039454cfd4799848b999a1c71337348","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    value, meta \u003d parse_header(value)"},{"line_number":276,"context_line":"    if \u0027swift_meta\u0027 in meta:"},{"line_number":277,"context_line":"        swift_meta \u003d load_crypto_meta(meta[\u0027swift_meta\u0027])"},{"line_number":278,"context_line":"    return value, swift_meta"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_e80d88e9","line":278,"updated":"2017-03-06 19:50:31.000000000","message":"Much cleaner.  There is a slight difference in behavior here, in that *if* there ever were another key/value pair after the swift_meta, it would now successfully return the swift_meta despite having the other value.  I think this is probably the more correct behavior.  If you were going to make another version, it may be good to add one more simple assertion in test_crypto_utils test_extract_crypto_meta to have a test just like the first case where swift_meta exists, but that another exists after that as well, like:\n\n        val, meta \u003d crypto_utils.extract_crypto_meta(\n            \u0027abc; swift_meta\u003d%s ; foo\u003dbar\u0027 \n            % self.serialized_meta)\n        self.assertEqual(\u0027abc\u0027, val)\n        self.assertDictEqual(self.meta, meta)\n\nThis test breaks against master now, because the value part would have the swift_meta in it, and returned crypto_meta would be None.","commit_id":"8ad5486a5cda7b0dc53e64de4139caa12ac8c006"}],"swift/common/request_helpers.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"825484d9951cf18368b812659fa8f8f6e5b264f6","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    Extract any metadata from the end of a value"},{"line_number":304,"context_line":"    There are certain use cases where some metadata is appended to the"},{"line_number":305,"context_line":"    end of a header value in the format:"},{"line_number":306,"context_line":"    \"\u003cobject_etag_value\u003e; \u003cparam_key\u003dparam_value\u003e\""},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    :param value: string that may have extra meta appended to the end of it"},{"line_number":309,"context_line":"    :param param_key: the key of the parameter to be extracted"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_97086b2f","line":306,"updated":"2017-03-02 14:58:31.000000000","message":"nit: do we want this example to have etag_vlaue?  I might say object_meta_value or something like that.","commit_id":"a43da77af49bd7a4a9dd905c8a6182b6413bfba1"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"7c809dde776e267a128207b16a6bf93b58e9f5d3","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    Extract any metadata from the end of a value"},{"line_number":304,"context_line":"    There are certain use cases where some metadata is appended to the"},{"line_number":305,"context_line":"    end of a header value in the format:"},{"line_number":306,"context_line":"    \"\u003cobject_meta_value\u003e; \u003cparam_key\u003dparam_value\u003e\""},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    :param value: string that may have extra meta appended to the end of it"},{"line_number":309,"context_line":"    :param param_key: the key of the parameter to be extracted"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_d35aac29","line":306,"updated":"2017-03-02 23:18:04.000000000","message":"nit: if you upload another patch, you could mention here that param_key and param_value must not have a \u0027;\u0027 -- so be sure it\u0027s encoded or something like what had been said before.  (since the check is for \u003d\u003d 2 on the parts)","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"acb89c33b3526bdb02d4f5da9539bec7e1686971","unresolved":false,"context_lines":[{"line_number":308,"context_line":"    :param value: string that may have extra meta appended to the end of it"},{"line_number":309,"context_line":"    :param param_key: the key of the parameter to be extracted"},{"line_number":310,"context_line":"    :return: a tuple of the form:"},{"line_number":311,"context_line":"                (\u003cheader value\u003e, \u003cextracted meta value\u003e or None)"},{"line_number":312,"context_line":"    \"\"\""},{"line_number":313,"context_line":"    parts \u003d value.split(\u0027;\u0027)"},{"line_number":314,"context_line":"    meta_value \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_73be6066","line":311,"updated":"2017-03-02 23:35:42.000000000","message":"So we always strip the param, and maybe we\u0027ll return it...\n\nCan we handle multiple params well?\n\nHow much are we reinventing cgi.parse_header?","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"049528a02c8283fe65497e9524db7c7d95ccbfc8","unresolved":false,"context_lines":[{"line_number":308,"context_line":"    :param value: string that may have extra meta appended to the end of it"},{"line_number":309,"context_line":"    :param param_key: the key of the parameter to be extracted"},{"line_number":310,"context_line":"    :return: a tuple of the form:"},{"line_number":311,"context_line":"                (\u003cheader value\u003e, \u003cextracted meta value\u003e or None)"},{"line_number":312,"context_line":"    \"\"\""},{"line_number":313,"context_line":"    parts \u003d value.split(\u0027;\u0027)"},{"line_number":314,"context_line":"    meta_value \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_dbc38155","line":311,"in_reply_to":"ba2be162_73be6066","updated":"2017-03-03 16:32:37.000000000","message":"wasn\u0027t aware of cgi.parse_headers, but it sure looks like we are trying to duplicate it. The benefit of cgi.parse_headers is that it does handle multiple params well, which could come in handy in the future:\n\nhttp://paste.openstack.org/show/601356/","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"acb89c33b3526bdb02d4f5da9539bec7e1686971","unresolved":false,"context_lines":[{"line_number":310,"context_line":"    :return: a tuple of the form:"},{"line_number":311,"context_line":"                (\u003cheader value\u003e, \u003cextracted meta value\u003e or None)"},{"line_number":312,"context_line":"    \"\"\""},{"line_number":313,"context_line":"    parts \u003d value.split(\u0027;\u0027)"},{"line_number":314,"context_line":"    meta_value \u003d None"},{"line_number":315,"context_line":"    if len(parts) \u003d\u003d 2:"},{"line_number":316,"context_line":"        value, param \u003d parts"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_930bd48d","line":313,"updated":"2017-03-02 23:35:42.000000000","message":"Janie brings up a good point -- is there any reason not to have this be\n\n parts \u003d value.split(\u0027;\u0027, 1)\n\n?","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b8608e0a5f917ca2a4aaa09623d3166bd264043b","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        value \u003d value.strip()"},{"line_number":318,"context_line":"        if param.strip().startswith(param_key):"},{"line_number":319,"context_line":"            meta_value \u003d param.strip()[len(param_key):]"},{"line_number":320,"context_line":"    return value, meta_value"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"class SegmentedIterable(object):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_94df370c","line":320,"updated":"2017-03-03 18:18:20.000000000","message":"I don\u0027t like how this is only incidentally covered in the middleware tests.  I would prefer there was some tests that documented how this new generic version of this method is called in test.unit.common.test_request_helpers that will blow up when you break it.","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"}],"swift/common/wsgi.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"acb89c33b3526bdb02d4f5da9539bec7e1686971","unresolved":false,"context_lines":[{"line_number":1081,"context_line":"        self._response_headers \u003d ["},{"line_number":1082,"context_line":"            (h, v) for h, v in self._response_headers"},{"line_number":1083,"context_line":"            if h.lower() !\u003d \u0027content-length\u0027]"},{"line_number":1084,"context_line":"        self._response_headers.append((\u0027Content-Length\u0027, str(new_total_len)))"},{"line_number":1085,"context_line":""},{"line_number":1086,"context_line":""},{"line_number":1087,"context_line":"def make_env(env, method\u003dNone, path\u003dNone, agent\u003d\u0027Swift\u0027, query_string\u003dNone,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_130c4440","line":1084,"updated":"2017-03-02 23:35:42.000000000","message":"This kinda makes me wonder if we should be using swob.Responses instead of wsgi.WSGIContexts... doesn\u0027t _resp_body_property already do a pretty good job with this sort of thing?","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b8608e0a5f917ca2a4aaa09623d3166bd264043b","unresolved":false,"context_lines":[{"line_number":1081,"context_line":"        self._response_headers \u003d ["},{"line_number":1082,"context_line":"            (h, v) for h, v in self._response_headers"},{"line_number":1083,"context_line":"            if h.lower() !\u003d \u0027content-length\u0027]"},{"line_number":1084,"context_line":"        self._response_headers.append((\u0027Content-Length\u0027, str(new_total_len)))"},{"line_number":1085,"context_line":""},{"line_number":1086,"context_line":""},{"line_number":1087,"context_line":"def make_env(env, method\u003dNone, path\u003dNone, agent\u003d\u0027Swift\u0027, query_string\u003dNone,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_346dab31","line":1084,"in_reply_to":"ba2be162_130c4440","updated":"2017-03-03 18:18:20.000000000","message":"Same problem this is only incidentally tested in crypto middleware tests.\n\nIdeally something in test.unit.common.test_wsgi would blow up.","commit_id":"de2bf4efaf44a8a5c0bc4a6462f4d3a1ce0bb733"}]}
