)]}'
{"neutron/pecan_wsgi/hooks/policy_enforcement.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0d5130c318cf48f819e5737b6eeb743c2c5500ef","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        \"\"\""},{"line_number":224,"context_line":"        attributes_to_exclude \u003d []"},{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            # TODO(dasanind): All attribute maps have tenant_id and"},{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_e4ae0197","line":226,"range":{"start_line":226,"start_character":14,"end_line":226,"end_character":28},"updated":"2017-03-21 15:57:52.000000000","message":"You can either make you an assignee of this TODO or make me an assignee as we have in the legacy API code. Either will do for me.","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"3edc17f51d538f7f3e505c0b660df6ad7c6717c4","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        \"\"\""},{"line_number":224,"context_line":"        attributes_to_exclude \u003d []"},{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            # TODO(dasanind): All attribute maps have tenant_id and"},{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_7afaa144","line":226,"range":{"start_line":226,"start_character":14,"end_line":226,"end_character":28},"in_reply_to":"1a1ced50_e4ae0197","updated":"2017-03-21 19:23:58.000000000","message":"Done","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a17ca03bcdc4833bda8a1e6d22351c73d6d8bad1","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        attributes_to_exclude \u003d []"},{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            # TODO(dasanind): All attribute maps have tenant_id and"},{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"},{"line_number":230,"context_line":"            # to check all logs carefully. "}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_de1bae19","line":227,"range":{"start_line":227,"start_character":14,"end_line":227,"end_character":24},"updated":"2017-03-21 03:58:25.000000000","message":"determine","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"3edc17f51d538f7f3e505c0b660df6ad7c6717c4","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        attributes_to_exclude \u003d []"},{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            # TODO(dasanind): All attribute maps have tenant_id and"},{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"},{"line_number":230,"context_line":"            # to check all logs carefully. "}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_7a91c1f0","line":227,"range":{"start_line":227,"start_character":14,"end_line":227,"end_character":24},"in_reply_to":"1a1ced50_de1bae19","updated":"2017-03-21 19:23:58.000000000","message":"changed it to \"it determines\"","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a17ca03bcdc4833bda8a1e6d22351c73d6d8bad1","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            # TODO(dasanind): All attribute maps have tenant_id and"},{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"},{"line_number":230,"context_line":"            # to check all logs carefully. "},{"line_number":231,"context_line":"            if attr_name \u003d\u003d \u0027project_id\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_5edede3f","line":228,"range":{"start_line":228,"start_character":57,"end_line":228,"end_character":62},"updated":"2017-03-21 03:58:25.000000000","message":"later, due to deprecation of Keystone v2 soon","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0d5130c318cf48f819e5737b6eeb743c2c5500ef","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            # TODO(dasanind): All attribute maps have tenant_id and"},{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"},{"line_number":230,"context_line":"            # to check all logs carefully. "},{"line_number":231,"context_line":"            if attr_name \u003d\u003d \u0027project_id\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_04fcfdb6","line":228,"range":{"start_line":228,"start_character":57,"end_line":228,"end_character":62},"in_reply_to":"1a1ced50_5edede3f","updated":"2017-03-21 15:57:52.000000000","message":"No, it does not refer to \u0027keystone v2\u0027 directly. What it means is that policy enforcement is based on \u0027tenant_id\u0027 in our attribute maps. Once we switch tenant_id to project_id, we need to enforce policy based on project_id. Until then, we need to use \u0027tenant_id\u0027 for this purpose","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a17ca03bcdc4833bda8a1e6d22351c73d6d8bad1","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"},{"line_number":230,"context_line":"            # to check all logs carefully. "},{"line_number":231,"context_line":"            if attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":232,"context_line":"                continue"},{"line_number":233,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_9e213650","line":230,"range":{"start_line":230,"start_character":42,"end_line":230,"end_character":43},"updated":"2017-03-21 03:58:25.000000000","message":"pep8 will shout here, probably","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"3edc17f51d538f7f3e505c0b660df6ad7c6717c4","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            # determines excluded attributes based on tenant_id."},{"line_number":228,"context_line":"            # We need to migrate tenant_id to project_id later"},{"line_number":229,"context_line":"            # as attr_info is referred to in various places and we need"},{"line_number":230,"context_line":"            # to check all logs carefully. "},{"line_number":231,"context_line":"            if attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":232,"context_line":"                continue"},{"line_number":233,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_5aafa529","line":230,"range":{"start_line":230,"start_character":42,"end_line":230,"end_character":43},"in_reply_to":"1a1ced50_9e213650","updated":"2017-03-21 19:23:58.000000000","message":"Done","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f2f8bfed827ecab254c916c1e5f89473a47a3db2","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                    data,"},{"line_number":241,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":242,"context_line":"                    pluralized\u003dcollection):"},{"line_number":243,"context_line":"                    # this attribute is visible, check next one"},{"line_number":244,"context_line":"                    continue"},{"line_number":245,"context_line":"            # if the code reaches this point then either the policy check"},{"line_number":246,"context_line":"            # failed or the attribute was not visible in the first place"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_d7bc50bd","line":243,"updated":"2017-03-21 18:08:02.000000000","message":"I believe we should instead add another policy check here just for project_id that would target get_%s:tenant_id. If first check doesn\u0027t pass for project_id but check for tenant_id does, then continue, otherwise add it to list of excludes.","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"fd1608a75c5340b521c10e4a9d650a5ed5868d51","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                    data,"},{"line_number":241,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":242,"context_line":"                    pluralized\u003dcollection):"},{"line_number":243,"context_line":"                    # this attribute is visible, check next one"},{"line_number":244,"context_line":"                    continue"},{"line_number":245,"context_line":"            # if the code reaches this point then either the policy check"},{"line_number":246,"context_line":"            # failed or the attribute was not visible in the first place"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_2070fcdb","line":243,"in_reply_to":"1a1ced50_1a152d48","updated":"2017-03-21 19:36:19.000000000","message":"I think a new check here would make the checks in 231 and in 251 unneeded.","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"223d4a79f3074754092a3d0fcc4887f007649d53","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                    data,"},{"line_number":241,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":242,"context_line":"                    pluralized\u003dcollection):"},{"line_number":243,"context_line":"                    # this attribute is visible, check next one"},{"line_number":244,"context_line":"                    continue"},{"line_number":245,"context_line":"            # if the code reaches this point then either the policy check"},{"line_number":246,"context_line":"            # failed or the attribute was not visible in the first place"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_ec509b34","line":243,"in_reply_to":"1a1ced50_2070fcdb","updated":"2017-03-21 21:27:51.000000000","message":"Done","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"3edc17f51d538f7f3e505c0b660df6ad7c6717c4","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                    data,"},{"line_number":241,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":242,"context_line":"                    pluralized\u003dcollection):"},{"line_number":243,"context_line":"                    # this attribute is visible, check next one"},{"line_number":244,"context_line":"                    continue"},{"line_number":245,"context_line":"            # if the code reaches this point then either the policy check"},{"line_number":246,"context_line":"            # failed or the attribute was not visible in the first place"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_1a152d48","line":243,"in_reply_to":"1a1ced50_d7bc50bd","updated":"2017-03-21 19:23:58.000000000","message":"Do you mean in addition to the check at line 231-232 I need to add another check here for project_id  or just do the check here instead of at line 231-232?","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f2f8bfed827ecab254c916c1e5f89473a47a3db2","unresolved":false,"context_lines":[{"line_number":248,"context_line":"            # TODO(dasanind): As mentioned in the above TODO,"},{"line_number":249,"context_line":"            # we treat project_id and tenant_id equivalently."},{"line_number":250,"context_line":"            # This should be migrated to project_id later."},{"line_number":251,"context_line":"            if attr_name \u003d\u003d \u0027tenant_id\u0027:"},{"line_number":252,"context_line":"                attributes_to_exclude.append(\u0027project_id\u0027)"},{"line_number":253,"context_line":"        return attributes_to_exclude"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_377e8419","line":252,"range":{"start_line":251,"start_character":12,"end_line":252,"end_character":58},"updated":"2017-03-21 18:08:02.000000000","message":"going forward, new policy rules may be written that would target project_id, and new resources would be written that would not have tenant_id attribute at all. In which case, you short-circuit the check logic and always expose project_id irrespective if the policy forbids it.","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"fd1608a75c5340b521c10e4a9d650a5ed5868d51","unresolved":false,"context_lines":[{"line_number":248,"context_line":"            # TODO(dasanind): As mentioned in the above TODO,"},{"line_number":249,"context_line":"            # we treat project_id and tenant_id equivalently."},{"line_number":250,"context_line":"            # This should be migrated to project_id later."},{"line_number":251,"context_line":"            if attr_name \u003d\u003d \u0027tenant_id\u0027:"},{"line_number":252,"context_line":"                attributes_to_exclude.append(\u0027project_id\u0027)"},{"line_number":253,"context_line":"        return attributes_to_exclude"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_802d30aa","line":252,"range":{"start_line":251,"start_character":12,"end_line":252,"end_character":58},"in_reply_to":"1a1ced50_1d38c73c","updated":"2017-03-21 19:36:19.000000000","message":"I mean, if there is a policy rule targeting project_id, and if there is no tenant_id attribute in a resource (because maybe we added a completely new resource and, knowing that tenant is the old name, directly use project_id), then your change will skip the policy check due to lines 231-232; and the lines 251-252 will never be triggered. At which point, the policy rule will be not effective.","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"3edc17f51d538f7f3e505c0b660df6ad7c6717c4","unresolved":false,"context_lines":[{"line_number":248,"context_line":"            # TODO(dasanind): As mentioned in the above TODO,"},{"line_number":249,"context_line":"            # we treat project_id and tenant_id equivalently."},{"line_number":250,"context_line":"            # This should be migrated to project_id later."},{"line_number":251,"context_line":"            if attr_name \u003d\u003d \u0027tenant_id\u0027:"},{"line_number":252,"context_line":"                attributes_to_exclude.append(\u0027project_id\u0027)"},{"line_number":253,"context_line":"        return attributes_to_exclude"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_1d38c73c","line":252,"range":{"start_line":251,"start_character":12,"end_line":252,"end_character":58},"in_reply_to":"1a1ced50_377e8419","updated":"2017-03-21 19:23:58.000000000","message":"IIUC, these lines of code will be executed when the attr_name \u003d \u0027tenant_id\". These will not be executed when attr_name\u003d\"project_id\". To exclude project_id from being exposed it will need a policy_check. Is that what you meant?","commit_id":"aae878f6192d6a25baa20bd8642939d02c841162"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b4057a489828c9c65c0ba34e77929ed76e88e934","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                    data,"},{"line_number":234,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":235,"context_line":"                    pluralized\u003dcollection)"},{"line_number":236,"context_line":"                if attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":237,"context_line":"                    if not result:"},{"line_number":238,"context_line":"                        if policy.check("},{"line_number":239,"context_line":"                            context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_61080829","line":236,"updated":"2017-03-22 18:17:04.000000000","message":"maybe explain in a comment why the second check","commit_id":"5d92b2bb7abb5f19969baefb1a1c62c2d5d219fa"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"91b66878876bedb4cc4f03693b6ff44634ddffbd","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                    data,"},{"line_number":234,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":235,"context_line":"                    pluralized\u003dcollection)"},{"line_number":236,"context_line":"                if attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":237,"context_line":"                    if not result:"},{"line_number":238,"context_line":"                        if policy.check("},{"line_number":239,"context_line":"                            context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"dfeb2761_7131b60b","line":236,"in_reply_to":"1a1ced50_61080829","updated":"2017-03-31 23:03:55.000000000","message":"Done","commit_id":"5d92b2bb7abb5f19969baefb1a1c62c2d5d219fa"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b4057a489828c9c65c0ba34e77929ed76e88e934","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                    if not result:"},{"line_number":238,"context_line":"                        if policy.check("},{"line_number":239,"context_line":"                            context,"},{"line_number":240,"context_line":"                            \u0027get_%s:%s\u0027 % (resource, \u0027tenant_id\u0027),"},{"line_number":241,"context_line":"                            data,"},{"line_number":242,"context_line":"                            might_not_exist\u003dTrue,"},{"line_number":243,"context_line":"                            pluralized\u003dcollection):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_16015806","line":240,"range":{"start_line":240,"start_character":36,"end_line":240,"end_character":38},"updated":"2017-03-22 18:17:04.000000000","message":"could directly put tenant_id here","commit_id":"5d92b2bb7abb5f19969baefb1a1c62c2d5d219fa"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"91b66878876bedb4cc4f03693b6ff44634ddffbd","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                    if not result:"},{"line_number":238,"context_line":"                        if policy.check("},{"line_number":239,"context_line":"                            context,"},{"line_number":240,"context_line":"                            \u0027get_%s:%s\u0027 % (resource, \u0027tenant_id\u0027),"},{"line_number":241,"context_line":"                            data,"},{"line_number":242,"context_line":"                            might_not_exist\u003dTrue,"},{"line_number":243,"context_line":"                            pluralized\u003dcollection):"}],"source_content_type":"text/x-python","patch_set":3,"id":"dfeb2761_5136b205","line":240,"range":{"start_line":240,"start_character":36,"end_line":240,"end_character":38},"in_reply_to":"1a1ced50_16015806","updated":"2017-03-31 23:03:55.000000000","message":"Done","commit_id":"5d92b2bb7abb5f19969baefb1a1c62c2d5d219fa"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"6bc6ebc1d5e7b595426493fd9b5bc7cc19d64a1c","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":237,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":238,"context_line":"                # instead of tenant_id"},{"line_number":239,"context_line":"                if attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":240,"context_line":"                    if not result:"},{"line_number":241,"context_line":"                        if policy.check("},{"line_number":242,"context_line":"                            context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_20042a7b","line":239,"updated":"2017-04-05 13:04:00.000000000","message":"if not result and attr_name \u003d\u003d \u0027project_id\u0027:\n\nno need for separate lines and more indentation","commit_id":"41b2fca7b4916aa74078d28d17709bc30c4127f3"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"2c57cc15bfcd6bc8e461da342476524bacf1cd6c","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":237,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":238,"context_line":"                # instead of tenant_id"},{"line_number":239,"context_line":"                if attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":240,"context_line":"                    if not result:"},{"line_number":241,"context_line":"                        if policy.check("},{"line_number":242,"context_line":"                            context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_5ecfcdaf","line":239,"in_reply_to":"bff0334d_20042a7b","updated":"2017-04-06 19:04:33.000000000","message":"Done","commit_id":"41b2fca7b4916aa74078d28d17709bc30c4127f3"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"be38aaf03e71b778ece387a4c145e185fcbea26a","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"},{"line_number":227,"context_line":"            if attr_data and attr_data[\u0027is_visible\u0027]:"},{"line_number":228,"context_line":"                result \u003d policy.check("},{"line_number":229,"context_line":"                    context,"},{"line_number":230,"context_line":"                    # NOTE(kevinbenton): this used to reference a"},{"line_number":231,"context_line":"                    # _plugin_handlers dict, why?"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_21d86c7d","line":228,"updated":"2017-04-06 19:29:47.000000000","message":"I believe, better result would be, if instead of writing extra code, only one thing would be done:\n\n if attr_name \u003d\u003d \u0027project_id\u0027:\n     attr_name \u003d \u0027tenant_id\u0027\n\nIn that case, nothing else would need to be changed.\nWhat do you think?","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"f16c87acd4a952df144895a0e3e5b665c12dc0a0","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"},{"line_number":227,"context_line":"            if attr_data and attr_data[\u0027is_visible\u0027]:"},{"line_number":228,"context_line":"                result \u003d policy.check("},{"line_number":229,"context_line":"                    context,"},{"line_number":230,"context_line":"                    # NOTE(kevinbenton): this used to reference a"},{"line_number":231,"context_line":"                    # _plugin_handlers dict, why?"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_ea92519f","line":228,"in_reply_to":"bff0334d_1f1c9c10","updated":"2017-04-07 03:15:58.000000000","message":"Amotoki: IIUC we will drop tenant_id in the future and will use only project_id. In that case if we do the check as dasm mentioned, the assignment of attr_name to tenant_id will fail. So instead of bypassing the policy check as in [1] I introduced a new check for project_id for future use as per the comments in the previous patch sets. \n\n[1] https://github.com/openstack/neutron/blob/master/neutron/api/v2/base.py#L178-L179","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"72b9a7aad5c8ca05f7ac7dcf0c7408740e770939","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"},{"line_number":227,"context_line":"            if attr_data and attr_data[\u0027is_visible\u0027]:"},{"line_number":228,"context_line":"                result \u003d policy.check("},{"line_number":229,"context_line":"                    context,"},{"line_number":230,"context_line":"                    # NOTE(kevinbenton): this used to reference a"},{"line_number":231,"context_line":"                    # _plugin_handlers dict, why?"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_8cf3ef0a","line":228,"in_reply_to":"bff0334d_21d86c7d","updated":"2017-04-06 20:03:53.000000000","message":"As we discussed, we need to add this additional policy check for project_id","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e4e32c60531799f38cfdaf7f4c317cec6d2cf61f","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"},{"line_number":227,"context_line":"            if attr_data and attr_data[\u0027is_visible\u0027]:"},{"line_number":228,"context_line":"                result \u003d policy.check("},{"line_number":229,"context_line":"                    context,"},{"line_number":230,"context_line":"                    # NOTE(kevinbenton): this used to reference a"},{"line_number":231,"context_line":"                    # _plugin_handlers dict, why?"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_1f1c9c10","line":228,"in_reply_to":"bff0334d_8cf3ef0a","updated":"2017-04-06 22:01:49.000000000","message":"Sorry for jumping in late.\n\nI checked the discussion in the past patch sets, but in my understanding we handles project_id and tenant_id equally.\n\nI think we will drop tenant_id support once and until then we will support both project_id and tenant_id even for new resources. The API layer ensures both project_id and tenant_id exist. I am not sure we will have resources only with project_id and without tenant_id.\n\nWe should switch the primary usage from tenant_id to project_id at some time, but I don\u0027t think we will handle project_id and tenant_id differently. Assume a case where we have a policy only for project_id. Then we will have a different policy enforcement for tenant_id unless both policies for tenant-id and project_id are defined.\n\nFrom the above consideration, I still believe dasm\u0027s comment is valid.\n\nThought?","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"a629c84d08897b2019f83706d4483d5566aeea9a","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"},{"line_number":227,"context_line":"            if attr_data and attr_data[\u0027is_visible\u0027]:"},{"line_number":228,"context_line":"                result \u003d policy.check("},{"line_number":229,"context_line":"                    context,"},{"line_number":230,"context_line":"                    # NOTE(kevinbenton): this used to reference a"},{"line_number":231,"context_line":"                    # _plugin_handlers dict, why?"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_7b5a7c4f","line":228,"in_reply_to":"bff0334d_ad29039c","updated":"2017-04-07 14:48:44.000000000","message":"I am not sure I follow this statement \"When we swaps the usage of project_id and tenant_id, a policy is not applied to \u0027tenant_id\u0027. This kind of corner case tends to be forgotten.\" \n\nIn the proposed logic tenant_id is checked by the policy.check at line 228 if the tenant_id attr is present. The additional check does not bypass tenant_id. Am I missing something?\n\nIMHO, I agree that the the corresponding logic in neutron.api.v2.base (used for \u0027legacy\u0027 API framework) should be updated. But that should be done in a separate patch as this patch is for the bug #1674517","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bca836f9c00f7b3d8d8a40ba233e56e6116145e3","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for attr_name in data.keys():"},{"line_number":226,"context_line":"            attr_data \u003d controller.resource_info.get(attr_name)"},{"line_number":227,"context_line":"            if attr_data and attr_data[\u0027is_visible\u0027]:"},{"line_number":228,"context_line":"                result \u003d policy.check("},{"line_number":229,"context_line":"                    context,"},{"line_number":230,"context_line":"                    # NOTE(kevinbenton): this used to reference a"},{"line_number":231,"context_line":"                    # _plugin_handlers dict, why?"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_ad29039c","line":228,"in_reply_to":"bff0334d_ea92519f","updated":"2017-04-07 04:59:30.000000000","message":"Yes, we will drop tenant_id and will use only project_id in the future. This is true, but what I would like to point out is that we will no longer handle project_id and tenant_id equally.\n\nFor example, perhaps we will swap the usage of project_id and tenant_id before dropping tenant_id (as we have a lot of stuff around tenant_id) and then will drop tenant_id. In the proposed logic, if only \u0027\u003caction\u003e:project_id\u0027 is defined in policy.json, \u0027project_id\u0027 will be checked but \u0027tenant_id\u0027 will not be checked. When we swaps the usage of project_id and tenant_id, a policy is not applied to \u0027tenant_id\u0027.\nThis kind of corner case tends to be forgotten.\nThis is the reason I\u0027d like to keep project_id and tenant_id symmetric.\n\nIn addition, if we adopt the proposed logic, the corresponding logic in neutron.api.v2.base (used for \u0027legacy\u0027 API framework) should be updated. We have two supported API framework and it is not a good idea the two implementation have different logic.","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"be38aaf03e71b778ece387a4c145e185fcbea26a","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                    data,"},{"line_number":234,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":235,"context_line":"                    pluralized\u003dcollection)"},{"line_number":236,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":237,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":238,"context_line":"                # instead of tenant_id"},{"line_number":239,"context_line":"                if not result and attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":240,"context_line":"                    if policy.check("},{"line_number":241,"context_line":"                        context,"},{"line_number":242,"context_line":"                        \u0027get_%s:tenant_id\u0027,"},{"line_number":243,"context_line":"                        data,"},{"line_number":244,"context_line":"                        might_not_exist\u003dTrue,"},{"line_number":245,"context_line":"                        pluralized\u003dcollection):"},{"line_number":246,"context_line":"                        continue"},{"line_number":247,"context_line":"                    else:"},{"line_number":248,"context_line":"                        attributes_to_exclude.append(attr_name)"},{"line_number":249,"context_line":"                if result:"},{"line_number":250,"context_line":"                    # this attribute is visible, check next one"},{"line_number":251,"context_line":"                    continue"},{"line_number":252,"context_line":"            # if the code reaches this point then either the policy check"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_01b9e82c","line":249,"range":{"start_line":236,"start_character":0,"end_line":249,"end_character":26},"updated":"2017-04-06 19:29:47.000000000","message":"This can be reorganized a little bit:\n\n if result:\n     continue\n elif: attr_name \u003d\u003d \u0027project_id\u0027\n     if policy.check(...)\n         continue\n     else:\n         attributes_to_exclude.append(attr_name)","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"72b9a7aad5c8ca05f7ac7dcf0c7408740e770939","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                    data,"},{"line_number":234,"context_line":"                    might_not_exist\u003dTrue,"},{"line_number":235,"context_line":"                    pluralized\u003dcollection)"},{"line_number":236,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":237,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":238,"context_line":"                # instead of tenant_id"},{"line_number":239,"context_line":"                if not result and attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":240,"context_line":"                    if policy.check("},{"line_number":241,"context_line":"                        context,"},{"line_number":242,"context_line":"                        \u0027get_%s:tenant_id\u0027,"},{"line_number":243,"context_line":"                        data,"},{"line_number":244,"context_line":"                        might_not_exist\u003dTrue,"},{"line_number":245,"context_line":"                        pluralized\u003dcollection):"},{"line_number":246,"context_line":"                        continue"},{"line_number":247,"context_line":"                    else:"},{"line_number":248,"context_line":"                        attributes_to_exclude.append(attr_name)"},{"line_number":249,"context_line":"                if result:"},{"line_number":250,"context_line":"                    # this attribute is visible, check next one"},{"line_number":251,"context_line":"                    continue"},{"line_number":252,"context_line":"            # if the code reaches this point then either the policy check"}],"source_content_type":"text/x-python","patch_set":7,"id":"bff0334d_613e74db","line":249,"range":{"start_line":236,"start_character":0,"end_line":249,"end_character":26},"in_reply_to":"bff0334d_01b9e82c","updated":"2017-04-06 20:03:53.000000000","message":"Done","commit_id":"571c6edc2826b6b9663028e5d036d83d5c000f28"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2e2e589c70379c970c3f8c764c75895f30ff378e","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                    # this attribute is visible, check next one"},{"line_number":238,"context_line":"                    continue"},{"line_number":239,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":240,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":241,"context_line":"                # instead of tenant_id"},{"line_number":242,"context_line":"                elif attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":243,"context_line":"                    if policy.check("}],"source_content_type":"text/x-python","patch_set":8,"id":"bff0334d_edf8354a","line":240,"range":{"start_line":240,"start_character":63,"end_line":240,"end_character":65},"updated":"2017-04-06 22:04:38.000000000","message":"super nit: double spaces","commit_id":"87c203e92dcaad215cb497aa75b7ac039eadd88c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"aa50fdd72cb9c954e2ce68acbad0a5b85329fa77","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":240,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":241,"context_line":"                # instead of tenant_id"},{"line_number":242,"context_line":"                elif attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":243,"context_line":"                    if policy.check("},{"line_number":244,"context_line":"                        context,"},{"line_number":245,"context_line":"                        \u0027get_%s:tenant_id\u0027 % resource,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7ffa3b31_168f102b","line":242,"updated":"2017-04-16 04:31:29.000000000","message":"@Anindita, can you just make the logic the same as the old API for now and then we\u0027ll worry about dropping tenant_id later because we realistically have no way to make a backward incompatible change like that right now.","commit_id":"87c203e92dcaad215cb497aa75b7ac039eadd88c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2e2e589c70379c970c3f8c764c75895f30ff378e","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":240,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":241,"context_line":"                # instead of tenant_id"},{"line_number":242,"context_line":"                elif attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":243,"context_line":"                    if policy.check("},{"line_number":244,"context_line":"                        context,"},{"line_number":245,"context_line":"                        \u0027get_%s:tenant_id\u0027 % resource,"}],"source_content_type":"text/x-python","patch_set":8,"id":"bff0334d_9fab0c88","line":242,"updated":"2017-04-06 22:04:38.000000000","message":"Could you check my comment in patch set 7? I don\u0027t think we need this fallback policy check and we can just consider tenant_id and project_id eqaully.","commit_id":"87c203e92dcaad215cb497aa75b7ac039eadd88c"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"bd581b9eb32a2a7b964ea57620ba66b0b353f5ba","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                # NOTE(dasanind): This new check is introduced to take care of"},{"line_number":240,"context_line":"                # new policy rules and resources that would use  project_id"},{"line_number":241,"context_line":"                # instead of tenant_id"},{"line_number":242,"context_line":"                elif attr_name \u003d\u003d \u0027project_id\u0027:"},{"line_number":243,"context_line":"                    if policy.check("},{"line_number":244,"context_line":"                        context,"},{"line_number":245,"context_line":"                        \u0027get_%s:tenant_id\u0027 % resource,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5ff73747_e3d88680","line":242,"in_reply_to":"7ffa3b31_168f102b","updated":"2017-04-21 23:14:01.000000000","message":"@Kevin: Reverted it back to the logic same as the old API.","commit_id":"87c203e92dcaad215cb497aa75b7ac039eadd88c"}]}
