)]}'
{"placement/policies/allocation.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"561389ae9780c084a51466ca44a71c90b797619c","unresolved":true,"context_lines":[{"line_number":48,"context_line":"deprecated_delete_allocation \u003d policy.DeprecatedRule("},{"line_number":49,"context_line":"    name\u003dALLOC_DELETE,"},{"line_number":50,"context_line":"    check_str\u003dbase.RULE_ADMIN_API"},{"line_number":51,"context_line":")"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"rules \u003d ["}],"source_content_type":"text/x-python","patch_set":4,"id":"26635a58_8a0eaa38","line":51,"updated":"2021-01-21 17:19:53.000000000","message":"nit: It bothers me that these are in a different order to the rules below and I can\u0027t do a quick 1:1 mapping 😞 It is correct compared to the above though","commit_id":"630771e5e2b0a45c1a29a0deddd0291513c6fa6b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"edc8b04f21353345b1f36fea572bd3440cfc37dc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"deprecated_delete_allocation \u003d policy.DeprecatedRule("},{"line_number":49,"context_line":"    name\u003dALLOC_DELETE,"},{"line_number":50,"context_line":"    check_str\u003dbase.RULE_ADMIN_API"},{"line_number":51,"context_line":")"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"rules \u003d ["}],"source_content_type":"text/x-python","patch_set":4,"id":"362a14da_f7435205","line":51,"in_reply_to":"26635a58_8a0eaa38","updated":"2021-01-22 01:18:14.000000000","message":"Done","commit_id":"630771e5e2b0a45c1a29a0deddd0291513c6fa6b"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"04395e728bef56bf57cde4bd65e9817c0daee4d3","unresolved":true,"context_lines":[{"line_number":54,"context_line":"rules \u003d ["},{"line_number":55,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":56,"context_line":"        name\u003dALLOC_MANAGE,"},{"line_number":57,"context_line":"        check_str\u003dbase.SYSTEM_ADMIN,"},{"line_number":58,"context_line":"        description\u003d\"Manage allocations.\","},{"line_number":59,"context_line":"        operations\u003d["},{"line_number":60,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":9,"id":"51afe60f_bbdd23ea","line":57,"range":{"start_line":57,"start_character":8,"end_line":57,"end_character":36},"updated":"2021-01-26 23:55:35.000000000","message":"ok so here you aure using the name of a postional parmater\nwhile this is allowed it generally not considered best pratics that said if this is work we can do my suggestion fomr the previous patch https://review.opendev.org/c/openstack/placement/+/760235/10/placement/policies/aggregate.py#52\n\n\ndefine system admin as \nSYSTEM_ADMIN \u003d {\n    \u0027check_str\u0027:\u0027role:admin and system_scope:all\u0027,\n    \u0027scope_types\u0027: [\u0027system\u0027]\n }\n\nthen make this\n\npolicy.DocumentedRuleDefault(\n        name\u003dALLOC_MANAGE,\n        description\u003d\"Manage allocations.\",\n        operations\u003d[\n            {\n                \u0027method\u0027: \u0027POST\u0027,\n                \u0027path\u0027: \u0027/allocations\u0027\n            }\n        ],\n        deprecated_rule\u003ddeprecated_manage_allocations,\n        deprecated_reason\u003dDEPRECATED_REASON,\n        deprecated_since\u003dversionutils.deprecated.WALLABY,\n        **SYSTEM_ADMIN\n    ),\n\nthat way we dont need to remember to update the check_str and scope_types consitently.","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"174a41ea6cc0e88a66bc666b32848634dba64497","unresolved":true,"context_lines":[{"line_number":54,"context_line":"rules \u003d ["},{"line_number":55,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":56,"context_line":"        name\u003dALLOC_MANAGE,"},{"line_number":57,"context_line":"        check_str\u003dbase.SYSTEM_ADMIN,"},{"line_number":58,"context_line":"        description\u003d\"Manage allocations.\","},{"line_number":59,"context_line":"        operations\u003d["},{"line_number":60,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":9,"id":"8c07741d_77857df0","line":57,"range":{"start_line":57,"start_character":8,"end_line":57,"end_character":36},"in_reply_to":"51ad5129_382f820c","updated":"2021-01-27 16:33:58.000000000","message":"yeah, doing with current way is more readable for me instead of searching how and where check_str of this rule is set or you can say without checking the oslo policy code","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4dbc7d57ee924de67b338d6f0eca764fc5d50710","unresolved":true,"context_lines":[{"line_number":54,"context_line":"rules \u003d ["},{"line_number":55,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":56,"context_line":"        name\u003dALLOC_MANAGE,"},{"line_number":57,"context_line":"        check_str\u003dbase.SYSTEM_ADMIN,"},{"line_number":58,"context_line":"        description\u003d\"Manage allocations.\","},{"line_number":59,"context_line":"        operations\u003d["},{"line_number":60,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":9,"id":"51ad5129_382f820c","line":57,"range":{"start_line":57,"start_character":8,"end_line":57,"end_character":36},"in_reply_to":"51afe60f_bbdd23ea","updated":"2021-01-27 14:04:38.000000000","message":"\u003e ok so here you aure using the name of a postional parmater\n\u003e while this is allowed it generally not considered best pratics\n\no.O Perhaps unnecessary, but there\u0027s nothing non-best practice about this. Also, nova is done entirely like this. To pick one example, [1]\n\n[1] https://github.com/openstack/nova/blob/3fc4824e66a41/nova/policies/aggregates.py#L26-L36\n\n\u003e that said if this is work we can do my suggestion fomr the previous patch https://review.opendev.org/c/openstack/placement/+/760235/10/placement/policies/aggregate.py#52\n\u003e \n\u003e \n\u003e define system admin as \n\u003e SYSTEM_ADMIN \u003d {\n\u003e     \u0027check_str\u0027:\u0027role:admin and system_scope:all\u0027,\n\u003e     \u0027scope_types\u0027: [\u0027system\u0027]\n\u003e  }\n\u003e \n\u003e then make this\n\u003e \n\u003e policy.DocumentedRuleDefault(\n\u003e         name\u003dALLOC_MANAGE,\n\u003e         description\u003d\"Manage allocations.\",\n\u003e         operations\u003d[\n\u003e             {\n\u003e                 \u0027method\u0027: \u0027POST\u0027,\n\u003e                 \u0027path\u0027: \u0027/allocations\u0027\n\u003e             }\n\u003e         ],\n\u003e         deprecated_rule\u003ddeprecated_manage_allocations,\n\u003e         deprecated_reason\u003dDEPRECATED_REASON,\n\u003e         deprecated_since\u003dversionutils.deprecated.WALLABY,\n\u003e         **SYSTEM_ADMIN\n\u003e     ),\n\u003e \n\u003e that way we dont need to remember to update the check_str and scope_types consitently.\n\nThat makes sense, though it\u0027s really only covering over an admittedly poor API choice in oslo.policy. FWIW, if you went this route then you could do the same with the \u0027deprecated_reason\u0027 and \u0027deprecated_since\u0027 parameters since they\u0027re common. I think that\u0027s merely a nice-to-have though and what\u0027s here is more than okay as-is.","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"}],"placement/tests/functional/gabbits/allocations-legacy-rbac.yaml":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"174a41ea6cc0e88a66bc666b32848634dba64497","unresolved":true,"context_lines":[{"line_number":68,"context_line":"        total: 96"},{"line_number":69,"context_line":"  status: 200"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"- name: project admin can create allocation"},{"line_number":72,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"},{"line_number":73,"context_line":"  request_headers: *project_admin_headers"},{"line_number":74,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"1ae27d97_9f8ff9d8","line":71,"range":{"start_line":71,"start_character":26,"end_line":71,"end_character":33},"updated":"2021-01-27 16:33:58.000000000","message":"update as this is PUT API test.","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f843b4fcd52763f7d17f274307f7c47a2889b68b","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        total: 96"},{"line_number":69,"context_line":"  status: 200"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"- name: project admin can create allocation"},{"line_number":72,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"},{"line_number":73,"context_line":"  request_headers: *project_admin_headers"},{"line_number":74,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"22f34341_f34a26ef","line":71,"range":{"start_line":71,"start_character":26,"end_line":71,"end_character":33},"in_reply_to":"1ae27d97_9f8ff9d8","updated":"2021-01-27 17:17:18.000000000","message":"Done","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"174a41ea6cc0e88a66bc666b32848634dba64497","unresolved":true,"context_lines":[{"line_number":87,"context_line":"  request_headers: *project_admin_headers"},{"line_number":88,"context_line":"  status: 204"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"- name: project member cannot create allocation"},{"line_number":91,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"},{"line_number":92,"context_line":"  request_headers: *project_member_headers"},{"line_number":93,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"1588254b_a187c859","line":90,"range":{"start_line":90,"start_character":30,"end_line":90,"end_character":36},"updated":"2021-01-27 16:33:58.000000000","message":"ditto and same for next 4 tests.","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f843b4fcd52763f7d17f274307f7c47a2889b68b","unresolved":false,"context_lines":[{"line_number":87,"context_line":"  request_headers: *project_admin_headers"},{"line_number":88,"context_line":"  status: 204"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"- name: project member cannot create allocation"},{"line_number":91,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"},{"line_number":92,"context_line":"  request_headers: *project_member_headers"},{"line_number":93,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"89bb105b_6d05fc94","line":90,"range":{"start_line":90,"start_character":30,"end_line":90,"end_character":36},"in_reply_to":"1588254b_a187c859","updated":"2021-01-27 17:17:18.000000000","message":"Done","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"}],"placement/tests/functional/gabbits/allocations-secure-rbac.yaml":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"561389ae9780c084a51466ca44a71c90b797619c","unresolved":true,"context_lines":[{"line_number":65,"context_line":"        max_unit: 1024"},{"line_number":66,"context_line":"      VCPU:"},{"line_number":67,"context_line":"        total: 96"},{"line_number":68,"context_line":"  status: 200"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"- name: project admin cannot create allocation"},{"line_number":71,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"85e406b1_7daafe7e","line":68,"updated":"2021-01-21 17:19:53.000000000","message":"No tests for other kinds of user here. Is that intentional? It was also a potential gap in the previous change","commit_id":"630771e5e2b0a45c1a29a0deddd0291513c6fa6b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"edc8b04f21353345b1f36fea572bd3440cfc37dc","unresolved":true,"context_lines":[{"line_number":65,"context_line":"        max_unit: 1024"},{"line_number":66,"context_line":"      VCPU:"},{"line_number":67,"context_line":"        total: 96"},{"line_number":68,"context_line":"  status: 200"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"- name: project admin cannot create allocation"},{"line_number":71,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3d398698_52c88563","line":68,"in_reply_to":"85e406b1_7daafe7e","updated":"2021-01-22 01:18:14.000000000","message":"Specifically for inventories? That\u0027s covered in a subsequent patch where the inventory policies are updated.","commit_id":"630771e5e2b0a45c1a29a0deddd0291513c6fa6b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"174a41ea6cc0e88a66bc666b32848634dba64497","unresolved":true,"context_lines":[{"line_number":68,"context_line":"        total: 96"},{"line_number":69,"context_line":"  status: 200"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"- name: project admin cannot create allocation"},{"line_number":72,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"},{"line_number":73,"context_line":"  request_headers: *project_admin_headers"},{"line_number":74,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"ce587037_e504253b","line":71,"range":{"start_line":71,"start_character":29,"end_line":71,"end_character":36},"updated":"2021-01-27 16:33:58.000000000","message":"ditto, for next 4 tests too","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f843b4fcd52763f7d17f274307f7c47a2889b68b","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        total: 96"},{"line_number":69,"context_line":"  status: 200"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"- name: project admin cannot create allocation"},{"line_number":72,"context_line":"  PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9"},{"line_number":73,"context_line":"  request_headers: *project_admin_headers"},{"line_number":74,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"abd7d23e_4ba96978","line":71,"range":{"start_line":71,"start_character":29,"end_line":71,"end_character":36},"in_reply_to":"ce587037_e504253b","updated":"2021-01-27 17:17:18.000000000","message":"Done","commit_id":"f2de0989bb2a6c437519295184fae79367b2e407"}]}
