)]}'
{"keystonemiddleware/auth_token.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"dc869c41354a8618c14bdace06d575de40a741e2","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        self._app \u003d app"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # NOTE(wanghong): If options are set in paste file e.g. api-paste.ini"},{"line_number":466,"context_line":"        # for nova, all the option values passed into conf are string type."},{"line_number":467,"context_line":"        # So, we should convert the conf value into correct type."},{"line_number":468,"context_line":"        self._convert_conf_value()"},{"line_number":469,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_bba7fa07","line":466,"updated":"2014-08-12 15:33:07.000000000","message":"for any service, not just nova","commit_id":"ac52ecbdcd6c6c3fd641f56ff6c93cfd21ca2864"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"dc869c41354a8618c14bdace06d575de40a741e2","unresolved":false,"context_lines":[{"line_number":542,"context_line":"        self._check_revocations_for_cached \u003d self._conf_get("},{"line_number":543,"context_line":"            \u0027check_revocations_for_cached\u0027)"},{"line_number":544,"context_line":""},{"line_number":545,"context_line":"    def _convert_conf_value(self):"},{"line_number":546,"context_line":"        def convert_value(key, value):"},{"line_number":547,"context_line":"            for opt in _OPTS:"},{"line_number":548,"context_line":"                if opt.dest \u003d\u003d key:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_7b3e428b","line":545,"updated":"2014-08-12 15:33:07.000000000","message":"this needs a docstr as well. can you also slip \"type\" in the name, so it\u0027s clear what\u0027s being converted?\n\n  _type_convert_conf_values","commit_id":"ac52ecbdcd6c6c3fd641f56ff6c93cfd21ca2864"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"dc869c41354a8618c14bdace06d575de40a741e2","unresolved":false,"context_lines":[{"line_number":546,"context_line":"        def convert_value(key, value):"},{"line_number":547,"context_line":"            for opt in _OPTS:"},{"line_number":548,"context_line":"                if opt.dest \u003d\u003d key:"},{"line_number":549,"context_line":"                    return opt.type(value)"},{"line_number":550,"context_line":"            return value"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"        for (k, v) in six.iteritems(self._conf):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_db890e71","line":549,"updated":"2014-08-12 15:33:07.000000000","message":"does oslo.config provide any error handling here that we\u0027d be missing out on?","commit_id":"ac52ecbdcd6c6c3fd641f56ff6c93cfd21ca2864"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0bf2bb905398227ea059f19186f6eb10030b4ac9","unresolved":false,"context_lines":[{"line_number":459,"context_line":"    def __init__(self, app, conf):"},{"line_number":460,"context_line":"        self._LOG \u003d logging.getLogger(conf.get(\u0027log_name\u0027, __name__))"},{"line_number":461,"context_line":"        self._LOG.info(\u0027Starting keystone auth_token middleware\u0027)"},{"line_number":462,"context_line":"        self._conf \u003d conf"},{"line_number":463,"context_line":"        self._app \u003d app"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # NOTE(wanghong): If options are set in paste file, all the option"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_8dab6cd5","line":462,"updated":"2014-08-20 02:02:22.000000000","message":"I\u0027d rather the function was called here...\n\n self._conf \u003d _conf_values_type_convert(conf)\n\nand then make _conf_values_type_convert a free function.","commit_id":"995dddf638d3ae4f450131259007931afa596eee"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"bfe29d104d264601da931d09945ade69cc0a9163","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    def _conf_get(self, name):"},{"line_number":563,"context_line":"        # try config from paste-deploy first"},{"line_number":564,"context_line":"        if name in self._conf:"},{"line_number":565,"context_line":"            return self._conf[name]"},{"line_number":566,"context_line":"        else:"},{"line_number":567,"context_line":"            return CONF.keystone_authtoken[name]"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_285545c6","line":565,"updated":"2014-08-18 08:12:11.000000000","message":"why not just do it here at get() time?","commit_id":"995dddf638d3ae4f450131259007931afa596eee"},{"author":{"_account_id":9101,"name":"wanghong","email":"reviewwanghong@126.com","username":"wanghong"},"change_message_id":"11e6b2f10984b2e33a27dae199f08a92d0f5295e","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    def _conf_get(self, name):"},{"line_number":563,"context_line":"        # try config from paste-deploy first"},{"line_number":564,"context_line":"        if name in self._conf:"},{"line_number":565,"context_line":"            return self._conf[name]"},{"line_number":566,"context_line":"        else:"},{"line_number":567,"context_line":"            return CONF.keystone_authtoken[name]"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_2bdb7f1c","line":565,"in_reply_to":"1abeadc6_285545c6","updated":"2014-08-18 08:55:09.000000000","message":"If add convert in init method the convert operation will be done only once. But, if add convert here every time the _conf_get method called we do a convert operation.","commit_id":"995dddf638d3ae4f450131259007931afa596eee"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"cd6468b94cdc1e9f0fc0625ff16333632c73b5fd","unresolved":false,"context_lines":[{"line_number":426,"context_line":""},{"line_number":427,"context_line":"def _conf_values_type_convert(conf):"},{"line_number":428,"context_line":"    \"\"\"Convert conf values into correct type.\"\"\""},{"line_number":429,"context_line":"    def convert_value(key, value):"},{"line_number":430,"context_line":"        for opt in _OPTS:"},{"line_number":431,"context_line":"            if opt.dest \u003d\u003d key:"},{"line_number":432,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_0d4e7c96","line":429,"updated":"2014-08-27 10:45:41.000000000","message":"how about caching some values, or at least making the search a little bit faster (instead of iterating over options every time).\na module-wide dictionary or something like this?","commit_id":"135aa69014281a088ed955cbf5ff91208af32a4f"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"e9d0531eff484df177eb98a61de7394023cc3b5a","unresolved":false,"context_lines":[{"line_number":426,"context_line":""},{"line_number":427,"context_line":"def _conf_values_type_convert(conf):"},{"line_number":428,"context_line":"    \"\"\"Convert conf values into correct type.\"\"\""},{"line_number":429,"context_line":"    def convert_value(key, value):"},{"line_number":430,"context_line":"        for opt in _OPTS:"},{"line_number":431,"context_line":"            if opt.dest \u003d\u003d key:"},{"line_number":432,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_08444272","line":429,"in_reply_to":"1abeadc6_0d4e7c96","updated":"2014-09-05 04:08:51.000000000","message":"even if not module wide just do build the dict once at the start of the function like: \n\ndef _convert_conf_types(conf): \n    if not conf:\n        return {} \n\n    opts \u003d {}\n    opt_types \u003d dict((o.key, o.type) for o in _OPTS)\n\n    for k, v in six.iteritems(conf): \n        try:\n            opts[k] \u003d opt_types[k](v)\n        except KeyError:\n            pass\n        except ValueError: \n            raise ... \n\n    return opts","commit_id":"135aa69014281a088ed955cbf5ff91208af32a4f"},{"author":{"_account_id":12215,"name":"Alexey Miroshkin","email":"alexey.miroshkin@ru.ibm.com","username":"amirosh"},"change_message_id":"38e61267c825a093df476f49cd6b21d5ae118b49","unresolved":false,"context_lines":[{"line_number":428,"context_line":"    \"\"\"Convert conf values into correct type.\"\"\""},{"line_number":429,"context_line":"    def convert_value(key, value):"},{"line_number":430,"context_line":"        for opt in _OPTS:"},{"line_number":431,"context_line":"            if opt.dest \u003d\u003d key:"},{"line_number":432,"context_line":"                try:"},{"line_number":433,"context_line":"                    return opt.type(value)"},{"line_number":434,"context_line":"                except ValueError as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_6bac3336","line":431,"updated":"2014-08-20 08:29:01.000000000","message":"Have you considered to move this filter to \u0027for\u0027 statement by iterating _OPTS comprehension/generator?","commit_id":"135aa69014281a088ed955cbf5ff91208af32a4f"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"f57ddcdfc5162f908e24c163b31bce4875f67f17","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        try:"},{"line_number":435,"context_line":"            opts[k] \u003d opt_types[k](v)"},{"line_number":436,"context_line":"        except KeyError:"},{"line_number":437,"context_line":"            opts[k] \u003d conf[k]"},{"line_number":438,"context_line":"        except ValueError as e:"},{"line_number":439,"context_line":"            raise ConfigurationError("},{"line_number":440,"context_line":"                \u0027Unable to convert the value of %s option into correct \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_74c76764","line":437,"updated":"2014-09-05 07:05:38.000000000","message":"conf[k] is v \n\nIs there a reason we would to have things in conf that are not in _OPTS?","commit_id":"188be8963d442dc84e5ab0c5d04274868e6dff53"},{"author":{"_account_id":9101,"name":"wanghong","email":"reviewwanghong@126.com","username":"wanghong"},"change_message_id":"efa741cfcae218337491946e5abb85d5f59b34b5","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        try:"},{"line_number":435,"context_line":"            opts[k] \u003d opt_types[k](v)"},{"line_number":436,"context_line":"        except KeyError:"},{"line_number":437,"context_line":"            opts[k] \u003d conf[k]"},{"line_number":438,"context_line":"        except ValueError as e:"},{"line_number":439,"context_line":"            raise ConfigurationError("},{"line_number":440,"context_line":"                \u0027Unable to convert the value of %s option into correct \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_f459978e","line":437,"in_reply_to":"fa98f980_74c76764","updated":"2014-09-05 07:20:54.000000000","message":"I just keep the orignal logic.","commit_id":"188be8963d442dc84e5ab0c5d04274868e6dff53"},{"author":{"_account_id":9101,"name":"wanghong","email":"reviewwanghong@126.com","username":"wanghong"},"change_message_id":"825098cae1876d3c89afd2103cbcaee75776a1f1","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        try:"},{"line_number":435,"context_line":"            opts[k] \u003d opt_types[k](v)"},{"line_number":436,"context_line":"        except KeyError:"},{"line_number":437,"context_line":"            opts[k] \u003d conf[k]"},{"line_number":438,"context_line":"        except ValueError as e:"},{"line_number":439,"context_line":"            raise ConfigurationError("},{"line_number":440,"context_line":"                \u0027Unable to convert the value of %s option into correct \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_94f68b5b","line":437,"in_reply_to":"fa98f980_f459978e","updated":"2014-09-05 07:23:56.000000000","message":"original*","commit_id":"188be8963d442dc84e5ab0c5d04274868e6dff53"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"a9dd056cef98e7759dbec885dff263845cccfbcc","unresolved":false,"context_lines":[{"line_number":429,"context_line":"    if not conf:"},{"line_number":430,"context_line":"        return {}"},{"line_number":431,"context_line":"    opts \u003d {}"},{"line_number":432,"context_line":"    opt_types \u003d dict((o.dest, o.type) for o in _OPTS)"},{"line_number":433,"context_line":"    for k, v in six.iteritems(conf):"},{"line_number":434,"context_line":"        try:"},{"line_number":435,"context_line":"            if v is None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_893ccd30","line":432,"updated":"2014-09-12 23:18:18.000000000","message":"I don\u0027t see any point in building this dict everytime the method is called.\nMove it to a module level so it is created once.","commit_id":"5835b232519be6a0497ee77316307acb79d9c7b1"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"595ae1846ccf080a18c494e9b312bd49fa8a62d5","unresolved":false,"context_lines":[{"line_number":429,"context_line":"    if not conf:"},{"line_number":430,"context_line":"        return {}"},{"line_number":431,"context_line":"    opts \u003d {}"},{"line_number":432,"context_line":"    opt_types \u003d dict((o.dest, o.type) for o in _OPTS)"},{"line_number":433,"context_line":"    for k, v in six.iteritems(conf):"},{"line_number":434,"context_line":"        try:"},{"line_number":435,"context_line":"            if v is None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_62c25035","line":432,"in_reply_to":"fa98f980_893ccd30","updated":"2014-09-14 22:35:47.000000000","message":"the method is only called once in the middleware __init__ and the clean dictionary returned and used from then on.","commit_id":"5835b232519be6a0497ee77316307acb79d9c7b1"}],"keystonemiddleware/tests/test_auth_token_middleware.py":[{"author":{"_account_id":12215,"name":"Alexey Miroshkin","email":"alexey.miroshkin@ru.ibm.com","username":"amirosh"},"change_message_id":"38e61267c825a093df476f49cd6b21d5ae118b49","unresolved":false,"context_lines":[{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        middleware \u003d auth_token.AuthProtocol(self.fake_app, conf)"},{"line_number":543,"context_line":"        self.assertEqual(datetime.timedelta(seconds\u003d24),"},{"line_number":544,"context_line":"                         middleware._token_revocation_list_cache_timeout)"},{"line_number":545,"context_line":"        self.assertEqual(False, middleware._include_service_catalog)"},{"line_number":546,"context_line":"        self.assertEqual(\u0027https://keystone.example.com:1234\u0027,"},{"line_number":547,"context_line":"                         middleware._identity_uri)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_66362ae9","line":544,"updated":"2014-08-20 08:29:01.000000000","message":"Just for my education - I see a lot of places in this file where methods  leading underscore are tested, which is \u0027internal use\u0027 indicator, weak though. Should we test such methods?","commit_id":"135aa69014281a088ed955cbf5ff91208af32a4f"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"cd6468b94cdc1e9f0fc0625ff16333632c73b5fd","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                         middleware._identity_uri)"},{"line_number":548,"context_line":"        self.assertEqual(\u00270\u0027, middleware._conf[\u0027nonexsit_option\u0027])"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"class CommonAuthTokenMiddlewareTest(object):"},{"line_number":552,"context_line":"    \"\"\"These tests are run once using v2 tokens and again using v3 tokens.\"\"\""},{"line_number":553,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_d1ffbeff","line":550,"updated":"2014-08-27 10:45:41.000000000","message":"do we have a test checking that appropriate exeptions are raised ? \n\nsomething that utilizes assertRaises()","commit_id":"135aa69014281a088ed955cbf5ff91208af32a4f"}]}
