)]}'
{"swift/common/middleware/versioned_writes.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"97ea4ca4854de3ee3ad76f9a8c83ea587985b8df","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        self._check_response_error(req, get_resp)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"        # validate the write access to the versioned container before"},{"line_number":328,"context_line":"        # making any backend requests"},{"line_number":329,"context_line":"        if \u0027swift.authorize\u0027 in req.environ:"},{"line_number":330,"context_line":"            container_info \u003d get_container_info("},{"line_number":331,"context_line":"                req.environ, self.app)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_6a5c9ced","line":328,"range":{"start_line":328,"start_character":17,"end_line":328,"end_character":37},"updated":"2016-08-22 17:12:38.000000000","message":"Should this go ahead of the call to _get_source_object?\n\nI suppose it shouldn\u0027t really matter from a client\u0027s perspective, but it could save the object servers from spinning up disks unnecessarily.","commit_id":"f07a5101eb495d5e6caab7514744f4e1a388e9a3"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"95b516f372b22f15f55cef78429de253f4a87c96","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        self._check_response_error(req, get_resp)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"        # validate the write access to the versioned container before"},{"line_number":328,"context_line":"        # making any backend requests"},{"line_number":329,"context_line":"        if \u0027swift.authorize\u0027 in req.environ:"},{"line_number":330,"context_line":"            container_info \u003d get_container_info("},{"line_number":331,"context_line":"                req.environ, self.app)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_5ae4efdf","line":328,"range":{"start_line":328,"start_character":17,"end_line":328,"end_character":37},"in_reply_to":"1ac06dbe_6a5c9ced","updated":"2016-08-23 03:48:14.000000000","message":"Yup, good call :)\n\ndone","commit_id":"f07a5101eb495d5e6caab7514744f4e1a388e9a3"}],"test/functional/tests.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"97ea4ca4854de3ee3ad76f9a8c83ea587985b8df","unresolved":false,"context_lines":[{"line_number":4123,"context_line":"                          cfg\u003d{\u0027use_token\u0027: self.env.storage_token3})"},{"line_number":4124,"context_line":""},{"line_number":4125,"context_line":"        # user3 cannot write or delete from source container either"},{"line_number":4126,"context_line":"        number_of_versions \u003d versions_container.info()[\u0027object_count\u0027]"},{"line_number":4127,"context_line":"        self.assertRaises(ResponseError, versioned_obj.write,"},{"line_number":4128,"context_line":"                          \"some random user trying to write data\","},{"line_number":4129,"context_line":"                          cfg\u003d{\u0027use_token\u0027: self.env.storage_token3})"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_aa50545f","line":4126,"range":{"start_line":4126,"start_character":56,"end_line":4126,"end_character":68},"updated":"2016-08-22 17:12:38.000000000","message":"How quickly can we expect container updates to happen?\n\nWould it be better to get the X-Timestamp of the current version, then assert that the corresponding backup destination 404s after the PUT?\n\nThen again, I suppose we already make assertions using object_count in this very same test.","commit_id":"f07a5101eb495d5e6caab7514744f4e1a388e9a3"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"95b516f372b22f15f55cef78429de253f4a87c96","unresolved":false,"context_lines":[{"line_number":4123,"context_line":"                          cfg\u003d{\u0027use_token\u0027: self.env.storage_token3})"},{"line_number":4124,"context_line":""},{"line_number":4125,"context_line":"        # user3 cannot write or delete from source container either"},{"line_number":4126,"context_line":"        number_of_versions \u003d versions_container.info()[\u0027object_count\u0027]"},{"line_number":4127,"context_line":"        self.assertRaises(ResponseError, versioned_obj.write,"},{"line_number":4128,"context_line":"                          \"some random user trying to write data\","},{"line_number":4129,"context_line":"                          cfg\u003d{\u0027use_token\u0027: self.env.storage_token3})"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_1a02770b","line":4126,"range":{"start_line":4126,"start_character":56,"end_line":4126,"end_character":68},"in_reply_to":"1ac06dbe_aa50545f","updated":"2016-08-23 03:48:14.000000000","message":"Yeah I was just following what was already happening.","commit_id":"f07a5101eb495d5e6caab7514744f4e1a388e9a3"}],"test/unit/common/middleware/test_versioned_writes.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"97ea4ca4854de3ee3ad76f9a8c83ea587985b8df","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        self.assertEqual(status, \u0027201 Created\u0027)"},{"line_number":388,"context_line":"        # authorized twice now because versioned_writes now makes a check on"},{"line_number":389,"context_line":"        # PUT"},{"line_number":390,"context_line":"        self.assertEqual(len(self.authorized), 2)"},{"line_number":391,"context_line":"        self.assertRequestEqual(req, self.authorized[0])"},{"line_number":392,"context_line":"        self.assertEqual([\u0027VW\u0027, \u0027VW\u0027, None], self.app.swift_sources)"},{"line_number":393,"context_line":"        self.assertEqual({\u0027fake_trans_id\u0027}, set(self.app.txn_ids))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_f9ab441b","line":390,"updated":"2016-08-22 17:12:38.000000000","message":"And they\u0027re both checking that the user is authorized to PUT to /v1/a/c/o, right? I wonder if we should make that original client req pre-authed as well...\n\nSomething to think about for a follow-up. I\u0027d much prefer we authorize too many times than not enough :-)","commit_id":"f07a5101eb495d5e6caab7514744f4e1a388e9a3"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"95b516f372b22f15f55cef78429de253f4a87c96","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        self.assertEqual(status, \u0027201 Created\u0027)"},{"line_number":388,"context_line":"        # authorized twice now because versioned_writes now makes a check on"},{"line_number":389,"context_line":"        # PUT"},{"line_number":390,"context_line":"        self.assertEqual(len(self.authorized), 2)"},{"line_number":391,"context_line":"        self.assertRequestEqual(req, self.authorized[0])"},{"line_number":392,"context_line":"        self.assertEqual([\u0027VW\u0027, \u0027VW\u0027, None], self.app.swift_sources)"},{"line_number":393,"context_line":"        self.assertEqual({\u0027fake_trans_id\u0027}, set(self.app.txn_ids))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_6ee65045","line":390,"in_reply_to":"1ac06dbe_f9ab441b","updated":"2016-08-23 03:48:14.000000000","message":"hmm, yeah. My only worry is, if we authorise it in the versions middleware and then pre-auth (or auth override). Then a middleware post versions redirects somewhere else or something the request wont be rechecked (reauthed). \n\nI guess the middleware could do that anyway and so we tend to just trust middleware.. but still forcing it to authorise at the proxy was just safer.. but I\u0027m probably just being too paranoid, and any less work we do can speed things up, so happy to change that if everyone else agrees, or as a follow up :)\n\nTLDR: My arm can be twisted.","commit_id":"f07a5101eb495d5e6caab7514744f4e1a388e9a3"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"fa1a196793d0021ebb84942eb763ec518e72dc65","unresolved":false,"context_lines":[{"line_number":859,"context_line":"        status, headers, body \u003d self.call_vw(req)"},{"line_number":860,"context_line":"        self.assertEqual(status, \u0027400 Bad Request\u0027)"},{"line_number":861,"context_line":"        self.assertEqual(\u0027X-Versions-Mode must be one of stack, history\u0027, body)"},{"line_number":862,"context_line":"        self.assertFalse(self.app.calls_with_headers)"},{"line_number":863,"context_line":""},{"line_number":864,"context_line":"    @mock.patch(\u0027swift.common.middleware.versioned_writes.time.time\u0027,"},{"line_number":865,"context_line":"                return_value\u003d1234)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_644757bc","line":862,"updated":"2016-08-29 21:14:13.000000000","message":"Should this have an authorized check?","commit_id":"d2fc2614575b04fd9cab5ae589880b92eee9b186"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"d43a96de4a74f2477c42be6f3e8c3f49071d49ec","unresolved":false,"context_lines":[{"line_number":859,"context_line":"        status, headers, body \u003d self.call_vw(req)"},{"line_number":860,"context_line":"        self.assertEqual(status, \u0027400 Bad Request\u0027)"},{"line_number":861,"context_line":"        self.assertEqual(\u0027X-Versions-Mode must be one of stack, history\u0027, body)"},{"line_number":862,"context_line":"        self.assertFalse(self.app.calls_with_headers)"},{"line_number":863,"context_line":""},{"line_number":864,"context_line":"    @mock.patch(\u0027swift.common.middleware.versioned_writes.time.time\u0027,"},{"line_number":865,"context_line":"                return_value\u003d1234)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_2ae7bc40","line":862,"in_reply_to":"fa7ab95a_644757bc","updated":"2016-08-30 09:47:23.000000000","message":"That would require a small refactoring - namely to check authorization right at the beginning, before doing anything else. I\u0027m wondering if we need this? Right now there is no check done with an invalid mode","commit_id":"d2fc2614575b04fd9cab5ae589880b92eee9b186"}]}
