)]}'
{"quantum/api/v2/base.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"261f7a4b42fc44000ebb4872c728e9a56d7f37d4","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                try:"},{"line_number":147,"context_line":"                    body \u003d kwargs.pop(\u0027body\u0027)"},{"line_number":148,"context_line":"                    Controller._populate_tenant_id(request.context,"},{"line_number":149,"context_line":"                                                   body, True)"},{"line_number":150,"context_line":"                    arg_list.append(body)"},{"line_number":151,"context_line":"                except KeyError:"},{"line_number":152,"context_line":"                    # Body was not found in kwargs"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOH%2F%2F7as%3D","line":149,"updated":"2013-03-20 16:41:28.000000000","message":"This always can pass the owner checking. Because this  populate context\u0027s tenant_id into the body, then context\u0027s tenant_id always same as the resource\u0027s tenant_id\u0027.\n\nAnd the original behavior of \u0027add_router_interface\u0027 was checking the router. But this code didn\u0027t check the router, it check the request params.\n\nAm i wrong? Or it\u0027s too late for me. I need go to bed.","commit_id":"02c37805e98212ec44f34c73004ced1f1ff3402f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":146,"context_line":"                try:"},{"line_number":147,"context_line":"                    body \u003d kwargs.pop(\u0027body\u0027)"},{"line_number":148,"context_line":"                    Controller._populate_tenant_id(request.context,"},{"line_number":149,"context_line":"                                                   body, True)"},{"line_number":150,"context_line":"                    arg_list.append(body)"},{"line_number":151,"context_line":"                except KeyError:"},{"line_number":152,"context_line":"                    # Body was not found in kwargs"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOH%2F%2F7Zc%3D","line":149,"in_reply_to":"AAAAOH%2F%2F7as%3D","updated":"2013-03-20 17:05:41.000000000","message":"You are right about the bypass of ownership. This has not been properly thought. \n\nYou are correct about the original behaviour. The reason for which the router body was passed was to be able to check for the tenant_id which owned the router. \n\nI am afraid we\u0027ll need to load the parent resource anyway, which I hate to do, as I would be doing an extra db op.\nLoading the parent resource will avoid the populate_tenant_id","commit_id":"02c37805e98212ec44f34c73004ced1f1ff3402f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"537917c806a7a08d65aa70b924370498cef18412","unresolved":false,"context_lines":[{"line_number":486,"context_line":"            # Do not raise in case of admin context"},{"line_number":487,"context_line":"            elif not context.is_admin:"},{"line_number":488,"context_line":"                msg \u003d _(\"Running without keystyone AuthN requires \""},{"line_number":489,"context_line":"                        \" that tenant_id is specified\")"},{"line_number":490,"context_line":"                raise webob.exc.HTTPBadRequest(msg)"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOH%2F%2F7m4%3D","line":489,"updated":"2013-03-20 15:03:56.000000000","message":"double spacing (not even related to this patch)","commit_id":"02c37805e98212ec44f34c73004ced1f1ff3402f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":486,"context_line":"            # Do not raise in case of admin context"},{"line_number":487,"context_line":"            elif not context.is_admin:"},{"line_number":488,"context_line":"                msg \u003d _(\"Running without keystyone AuthN requires \""},{"line_number":489,"context_line":"                        \" that tenant_id is specified\")"},{"line_number":490,"context_line":"                raise webob.exc.HTTPBadRequest(msg)"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOH%2F%2F7Zo%3D","line":489,"in_reply_to":"AAAAOH%2F%2F7m4%3D","updated":"2013-03-20 17:05:41.000000000","message":"happy to fix it.","commit_id":"02c37805e98212ec44f34c73004ced1f1ff3402f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"261f7a4b42fc44000ebb4872c728e9a56d7f37d4","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                    # NOTE(salvatore-orlando): For the policy engine it is"},{"line_number":154,"context_line":"                    # fine to flatten attributes from resource and action"},{"line_number":155,"context_line":"                    # body in the same dictionary"},{"line_number":156,"context_line":"                    resource.update(body)"},{"line_number":157,"context_line":"                except KeyError:"},{"line_number":158,"context_line":"                    # Body was not found in kwargs"},{"line_number":159,"context_line":"                    LOG.debug(_(\"No request body found for action \u0027%s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F6ig%3D","line":156,"updated":"2013-03-21 03:36:40.000000000","message":"If user put an \u0027tenant_id\u0027, it override the resource\u0027s \u0027tenant_id\u0027. Then the policy check at line 165 won\u0027t works.","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":153,"context_line":"                    # NOTE(salvatore-orlando): For the policy engine it is"},{"line_number":154,"context_line":"                    # fine to flatten attributes from resource and action"},{"line_number":155,"context_line":"                    # body in the same dictionary"},{"line_number":156,"context_line":"                    resource.update(body)"},{"line_number":157,"context_line":"                except KeyError:"},{"line_number":158,"context_line":"                    # Body was not found in kwargs"},{"line_number":159,"context_line":"                    LOG.debug(_(\"No request body found for action \u0027%s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F52A%3D","line":156,"in_reply_to":"AAAAOH%2F%2F6ig%3D","updated":"2013-03-21 15:32:06.000000000","message":"You\u0027re right. I think we might just skip this test then. \nWe will love the ability of using the items in the request body in the policy evaluation, but that not a big deal.","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"261f7a4b42fc44000ebb4872c728e9a56d7f37d4","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                # It is ok to raise a 403 because accessibility to the"},{"line_number":164,"context_line":"                # object was checked at line 147"},{"line_number":165,"context_line":"                policy.enforce(request.context, name, resource,"},{"line_number":166,"context_line":"                               plugin\u003dself._plugin)"},{"line_number":167,"context_line":"                return getattr(self._plugin, name)(*arg_list, **kwargs)"},{"line_number":168,"context_line":"            return _handle_action"},{"line_number":169,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F6ic%3D","line":166,"updated":"2013-03-21 03:36:40.000000000","message":"Why we still need this checking? It already done by line 147","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":163,"context_line":"                # It is ok to raise a 403 because accessibility to the"},{"line_number":164,"context_line":"                # object was checked at line 147"},{"line_number":165,"context_line":"                policy.enforce(request.context, name, resource,"},{"line_number":166,"context_line":"                               plugin\u003dself._plugin)"},{"line_number":167,"context_line":"                return getattr(self._plugin, name)(*arg_list, **kwargs)"},{"line_number":168,"context_line":"            return _handle_action"},{"line_number":169,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F510%3D","line":166,"in_reply_to":"AAAAOH%2F%2F6ic%3D","updated":"2013-03-21 15:32:06.000000000","message":"There are two different checks.\nLine 147 checks if the resource can be accessed, this policy check verifies you can operate on it.","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"261f7a4b42fc44000ebb4872c728e9a56d7f37d4","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    resource \u003d self._item(request, id, True)"},{"line_number":148,"context_line":"                except exceptions.PolicyNotAuthorized:"},{"line_number":149,"context_line":"                    raise webob.exc.HTTPNotFound()"},{"line_number":150,"context_line":"                try:"},{"line_number":151,"context_line":"                    body \u003d kwargs.pop(\u0027body\u0027)"},{"line_number":152,"context_line":"                    arg_list.append(body)"},{"line_number":153,"context_line":"                    # TODO(salvatore-orlando): bp/make-authz-ortogonal"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2F3Bw%3D","line":150,"updated":"2013-03-23 15:46:51.000000000","message":"we can merge those two try block into one.","commit_id":"ccabd24b1e0eb27465e163bd3d7463f736f3a1af"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    resource \u003d self._item(request, id, True)"},{"line_number":148,"context_line":"                except exceptions.PolicyNotAuthorized:"},{"line_number":149,"context_line":"                    raise webob.exc.HTTPNotFound()"},{"line_number":150,"context_line":"                try:"},{"line_number":151,"context_line":"                    body \u003d kwargs.pop(\u0027body\u0027)"},{"line_number":152,"context_line":"                    arg_list.append(body)"},{"line_number":153,"context_line":"                    # TODO(salvatore-orlando): bp/make-authz-ortogonal"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2F1gY%3D","line":150,"in_reply_to":"AAAAOH%2F%2F3Bw%3D","updated":"2013-03-25 17:22:53.000000000","message":"that\u0027s a sensible comment.","commit_id":"ccabd24b1e0eb27465e163bd3d7463f736f3a1af"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"unresolved":false,"context_lines":[{"line_number":157,"context_line":"                    # Body was not found in kwargs"},{"line_number":158,"context_line":"                    LOG.debug(_(\"No request body found for action \u0027%s\u0027\"),"},{"line_number":159,"context_line":"                              name)"},{"line_number":160,"context_line":"                    pass"},{"line_number":161,"context_line":"                # Enforce policy, if any, for this action"},{"line_number":162,"context_line":"                # It is ok to raise a 403 because accessibility to the"},{"line_number":163,"context_line":"                # object was checked at line 147"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2FvsY%3D","line":160,"updated":"2013-03-29 16:29:18.000000000","message":"Might want to consider doing a get for the body, first. You can safely consider exceptions to be computationally expensive. I\u0027d argue there\u0027s no point in incurring a penalty from raising one when we can simply check with a kwargs.get(\"body\") instead.\n\nYou can yank the pass out, too","commit_id":"ccabd24b1e0eb27465e163bd3d7463f736f3a1af"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":157,"context_line":"                    # Body was not found in kwargs"},{"line_number":158,"context_line":"                    LOG.debug(_(\"No request body found for action \u0027%s\u0027\"),"},{"line_number":159,"context_line":"                              name)"},{"line_number":160,"context_line":"                    pass"},{"line_number":161,"context_line":"                # Enforce policy, if any, for this action"},{"line_number":162,"context_line":"                # It is ok to raise a 403 because accessibility to the"},{"line_number":163,"context_line":"                # object was checked at line 147"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2Fvco%3D","line":160,"in_reply_to":"AAAAOH%2F%2FvsY%3D","updated":"2013-03-29 19:42:22.000000000","message":"Thanks Matt.\nI never had a strong opinion on if vs try..except\n\nI just thought this way of coding respects the EAFP principle, although it might be rightly argued that it\u0027s not really the case because the except clause is not really an error condition.","commit_id":"ccabd24b1e0eb27465e163bd3d7463f736f3a1af"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":"                    pass"},{"line_number":161,"context_line":"                # Enforce policy, if any, for this action"},{"line_number":162,"context_line":"                # It is ok to raise a 403 because accessibility to the"},{"line_number":163,"context_line":"                # object was checked at line 147"},{"line_number":164,"context_line":"                policy.enforce(request.context, name, resource,"},{"line_number":165,"context_line":"                               plugin\u003dself._plugin)"},{"line_number":166,"context_line":"                return getattr(self._plugin, name)(*arg_list, **kwargs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2F0q0%3D","line":163,"updated":"2013-03-26 06:02:25.000000000","message":"nit: I\u0027d probably not reference a line number and just say above as the line number could chance.","commit_id":"ccabd24b1e0eb27465e163bd3d7463f736f3a1af"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":"                    pass"},{"line_number":161,"context_line":"                # Enforce policy, if any, for this action"},{"line_number":162,"context_line":"                # It is ok to raise a 403 because accessibility to the"},{"line_number":163,"context_line":"                # object was checked at line 147"},{"line_number":164,"context_line":"                policy.enforce(request.context, name, resource,"},{"line_number":165,"context_line":"                               plugin\u003dself._plugin)"},{"line_number":166,"context_line":"                return getattr(self._plugin, name)(*arg_list, **kwargs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2Fv5U%3D","line":163,"in_reply_to":"AAAAOH%2F%2F0q0%3D","updated":"2013-03-29 12:29:52.000000000","message":"Sure, that was optimistic","commit_id":"ccabd24b1e0eb27465e163bd3d7463f736f3a1af"}],"quantum/db/l3_db.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"261f7a4b42fc44000ebb4872c728e9a56d7f37d4","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def add_router_interface(self, context, router_id, interface_info):"},{"line_number":313,"context_line":"        # make sure router exists"},{"line_number":314,"context_line":"        self._get_router(context, router_id)"},{"line_number":315,"context_line":"        if not interface_info:"},{"line_number":316,"context_line":"            msg \u003d _(\"Either subnet_id or port_id must be specified\")"},{"line_number":317,"context_line":"            raise q_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F6iM%3D","line":314,"updated":"2013-03-21 03:36:40.000000000","message":"We already get item at controller, so this looks like unuseful now.","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def add_router_interface(self, context, router_id, interface_info):"},{"line_number":313,"context_line":"        # make sure router exists"},{"line_number":314,"context_line":"        self._get_router(context, router_id)"},{"line_number":315,"context_line":"        if not interface_info:"},{"line_number":316,"context_line":"            msg \u003d _(\"Either subnet_id or port_id must be specified\")"},{"line_number":317,"context_line":"            raise q_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F51w%3D","line":314,"in_reply_to":"AAAAOH%2F%2F6iM%3D","updated":"2013-03-21 15:32:06.000000000","message":"Correct.","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"261f7a4b42fc44000ebb4872c728e9a56d7f37d4","unresolved":false,"context_lines":[{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":390,"context_line":"        # make sure router exists"},{"line_number":391,"context_line":"        self._get_router(context, router_id)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        if not interface_info:"},{"line_number":394,"context_line":"            msg \u003d _(\"Either subnet_id or port_id must be specified\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F6iI%3D","line":391,"updated":"2013-03-21 03:36:40.000000000","message":"ditto","commit_id":"828ccd75e69520e4a6be483313ab46d804da4278"}]}
