)]}'
{"doc/source/authentication.rst":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5ac1a76f63606e5f2dc7bbfd610c73a133b61e16","unresolved":false,"context_lines":[{"line_number":174,"context_line":"stanza::"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    [service_policies]"},{"line_number":177,"context_line":"    service_policy_files\u003dcompute:nova-policy.json"},{"line_number":178,"context_line":"    service_policy_path\u003d/etc/searchlight/"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"And with the following contents in nova-policy.json::"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9ad45d7e_ca71c3e2","line":177,"range":{"start_line":177,"start_character":38,"end_line":177,"end_character":44},"updated":"2016-08-08 09:23:19.000000000","message":"so, are we using different policy.json for each plugins?","commit_id":"8cc572634e45319f23f9a16bab9ac9e0924ffa7b"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"2b986bb873c9e60cea999ae4c3667e0f20e0031e","unresolved":false,"context_lines":[{"line_number":174,"context_line":"stanza::"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    [service_policies]"},{"line_number":177,"context_line":"    service_policy_files\u003dcompute:nova-policy.json"},{"line_number":178,"context_line":"    service_policy_path\u003d/etc/searchlight/"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"And with the following contents in nova-policy.json::"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9ad45d7e_33f3a60c","line":177,"range":{"start_line":177,"start_character":38,"end_line":177,"end_character":44},"in_reply_to":"9ad45d7e_ca71c3e2","updated":"2016-08-08 15:08:24.000000000","message":"Not per plugin but per service. Multiple plugins may use \u0027compute\u0027 as their service_type. I\u0027ll expand this to make that clearer.","commit_id":"8cc572634e45319f23f9a16bab9ac9e0924ffa7b"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":148,"context_line":""},{"line_number":149,"context_line":"It is possible to disable access to individual plugins. For instance, the"},{"line_number":150,"context_line":"following restricts access to Nova servers to admins, and Glance images to"},{"line_number":151,"context_line":"nobody::"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    \"resource:OS::Nova::Server\": \"role:admin\","},{"line_number":154,"context_line":"    \"resource:OS::Glance::Image\": \"!\","}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_8772820f","line":151,"updated":"2016-08-11 00:07:21.000000000","message":"It would be clearer if we say:\n\n... and disable access to Glance images for everyone.\n\nOtherwise it reads that the role \"nobody\" is the only one able to access Glance images!","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":148,"context_line":""},{"line_number":149,"context_line":"It is possible to disable access to individual plugins. For instance, the"},{"line_number":150,"context_line":"following restricts access to Nova servers to admins, and Glance images to"},{"line_number":151,"context_line":"nobody::"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    \"resource:OS::Nova::Server\": \"role:admin\","},{"line_number":154,"context_line":"    \"resource:OS::Glance::Image\": \"!\","}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_3e9ba167","line":151,"in_reply_to":"9ad45d7e_8772820f","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":163,"context_line":"from the search (which may result in empty search results). No Forbidden"},{"line_number":164,"context_line":"response will be returned."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":".. _service-policy-files:"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"Service policy controls"},{"line_number":169,"context_line":"-----------------------"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_82b9d017","line":166,"updated":"2016-08-11 00:07:21.000000000","message":"Nit: Should this match the actual section header?\n\n  .. _service-policy-controls:\n\nIf we make this change, we will need to change the reference to it in authoring-plugins.rst.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":163,"context_line":"from the search (which may result in empty search results). No Forbidden"},{"line_number":164,"context_line":"response will be returned."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":".. _service-policy-files:"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"Service policy controls"},{"line_number":169,"context_line":"-----------------------"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_9ea60dac","line":166,"in_reply_to":"9ad45d7e_82b9d017","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":169,"context_line":"-----------------------"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy action"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"},{"line_number":175,"context_line":"directory or left blank). For instance, with the following configuration"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_87ed62b9","line":172,"updated":"2016-08-11 00:07:21.000000000","message":"Do we want to not discuss the deployment issue of having duplicate copies of policy files (as opposed to referencing the same version)? It seems that is an implementation detail of the deployment, but it may get confusing below. On line 180, we are referencing a copy of the Nova policy file deployed within Searchlight.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"09a50b3cb29a53af08e69c4b087f049b5806462e","unresolved":false,"context_lines":[{"line_number":169,"context_line":"-----------------------"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy action"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"},{"line_number":175,"context_line":"directory or left blank). For instance, with the following configuration"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_9f66424f","line":172,"range":{"start_line":172,"start_character":70,"end_line":172,"end_character":76},"updated":"2016-08-10 23:08:24.000000000","message":"target","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":169,"context_line":"-----------------------"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy action"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"},{"line_number":175,"context_line":"directory or left blank). For instance, with the following configuration"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_3e5c417c","line":172,"in_reply_to":"9ad45d7e_87ed62b9","updated":"2016-08-11 22:31:44.000000000","message":"It\u0027s up to deployers how they make it happen. I\u0027ll make it more ambiguous below","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":169,"context_line":"-----------------------"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy action"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"},{"line_number":175,"context_line":"directory or left blank). For instance, with the following configuration"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_de76c504","line":172,"range":{"start_line":172,"start_character":70,"end_line":172,"end_character":76},"in_reply_to":"9ad45d7e_9f66424f","updated":"2016-08-11 22:31:44.000000000","message":"\u0027Target\u0027 does seem to be what the policy docs use, although it\u0027s overloaded in the actual code. Will use \u0027target\u0027","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy action"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"},{"line_number":175,"context_line":"directory or left blank). For instance, with the following configuration"},{"line_number":176,"context_line":"stanza::"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    [service_policies]"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_87c3a256","line":175,"range":{"start_line":174,"start_character":62,"end_line":175,"end_character":9},"updated":"2016-08-11 00:07:21.000000000","message":"What is the current working directory? Is it the directory where searchlight is started? Where Searchlight is deployed?","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy action"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"},{"line_number":175,"context_line":"directory or left blank). For instance, with the following configuration"},{"line_number":176,"context_line":"stanza::"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    [service_policies]"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_243a7499","line":175,"range":{"start_line":174,"start_character":62,"end_line":175,"end_character":9},"in_reply_to":"9ad45d7e_87c3a256","updated":"2016-08-11 22:31:44.000000000","message":"I\u0027ll reword this. It uses oslo.config to try to find files, so it looks in /etc/\u003cservice\u003e/, ./etc, .  I think","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    [service_policies]"},{"line_number":179,"context_line":"    service_policy_files\u003dcompute:nova-policy.json"},{"line_number":180,"context_line":"    service_policy_path\u003d/etc/searchlight/"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"And with the following contents in nova-policy.json::"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_552f8b87","line":180,"updated":"2016-08-11 00:07:21.000000000","message":"We need to make this clear that this is not per-resource type. We should also have some more explicit examples.\n\nFor example, if all of the policy files are in the same directory this example works. If the policy files are in different directories, then we need to specify the absolute path in service_policy_files:\n\nservice_policy_files\u003dcompute:/opt/stack/nova/etc/policy.json,volume:/opt/stack/cinder/etc/policy.json,network:/opt/stack/neutron/etc/policy.json","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    [service_policies]"},{"line_number":179,"context_line":"    service_policy_files\u003dcompute:nova-policy.json"},{"line_number":180,"context_line":"    service_policy_path\u003d/etc/searchlight/"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"And with the following contents in nova-policy.json::"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_046490b6","line":180,"in_reply_to":"9ad45d7e_552f8b87","updated":"2016-08-11 22:31:44.000000000","message":"This is more of a deployment issue. I\u0027ll add a short note.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"09a50b3cb29a53af08e69c4b087f049b5806462e","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":".. note:: "},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"   The rules in searchlight\u0027s policy.json can deny access to a resource even"},{"line_number":195,"context_line":"   if the service policy allows it, and vice versa."}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_3f047648","line":195,"range":{"start_line":194,"start_character":0,"end_line":195,"end_character":51},"updated":"2016-08-10 23:08:24.000000000","message":"I thought we were leaning towards not dual defining.  E.g. just give one place to define policy and that be the policy file specific to that resource.\n\nHowever, maybe I\u0027m missing a use case. Was this done because some services don\u0027t have targets for all of their resource types?","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":".. note:: "},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"   The rules in searchlight\u0027s policy.json can deny access to a resource even"},{"line_number":195,"context_line":"   if the service policy allows it, and vice versa."}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_64e62ce9","line":195,"range":{"start_line":194,"start_character":0,"end_line":195,"end_character":51},"in_reply_to":"9ad45d7e_3f047648","updated":"2016-08-11 22:31:44.000000000","message":"It\u0027s so that even if nova allows you to access servers you can disable them in SL for whatever reason even with a shared policy file. Or if you just don\u0027t bother to set the policy file link up. Can do it either way, but this is what i thought we agreed on.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"91cac0cd6d7ef2416a14bde8e243399910e0fae9","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":".. note:: "},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"   The rules in searchlight\u0027s policy.json can deny access to a resource even"},{"line_number":195,"context_line":"   if the service policy allows it, and vice versa."}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_0f3bc49d","line":195,"range":{"start_line":194,"start_character":0,"end_line":195,"end_character":51},"in_reply_to":"9ad45d7e_64e62ce9","updated":"2016-08-12 19:57:03.000000000","message":"Okay, that makes sense.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9ad45d7e_87fe02ac","line":196,"updated":"2016-08-11 00:07:21.000000000","message":"This note seems confusing. Maybe a better way to put it:\n\nPolicy rules to deny access always take precedence over policy rules to allow access.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9ad45d7e_64346c49","line":196,"in_reply_to":"9ad45d7e_87fe02ac","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"a17a4b5cc9b5cedda047f1dad5c93a04eeca094f","unresolved":false,"context_lines":[{"line_number":147,"context_line":"-------------------"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"It is possible to disable access to individual plugins. For instance, the"},{"line_number":150,"context_line":"following restricts access to Nova servers to admins, and disable access"},{"line_number":151,"context_line":"entirely to Glance images::"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    \"resource:OS::Nova::Server\": \"role:admin\","}],"source_content_type":"text/x-rst","patch_set":7,"id":"9ad45d7e_fd470b49","line":150,"range":{"start_line":150,"start_character":58,"end_line":150,"end_character":65},"updated":"2016-08-12 19:45:00.000000000","message":"Nit: \"disables\"","commit_id":"9b84715094687a49f78486ea994e6fd6d7e084dc"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d9f191a5ac1d8578ae79eab32209138f83dac20c","unresolved":false,"context_lines":[{"line_number":147,"context_line":"-------------------"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"It is possible to disable access to individual plugins. For instance, the"},{"line_number":150,"context_line":"following restricts access to Nova servers to admins, and disable access"},{"line_number":151,"context_line":"entirely to Glance images::"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    \"resource:OS::Nova::Server\": \"role:admin\","}],"source_content_type":"text/x-rst","patch_set":7,"id":"3ac371cc_fa51c363","line":150,"range":{"start_line":150,"start_character":58,"end_line":150,"end_character":65},"in_reply_to":"9ad45d7e_fd470b49","updated":"2016-08-15 16:20:33.000000000","message":"Done","commit_id":"9b84715094687a49f78486ea994e6fd6d7e084dc"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"a17a4b5cc9b5cedda047f1dad5c93a04eeca094f","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"Policy files are configured per *service*, not per resource type. If files"},{"line_number":196,"context_line":"are in different directories absolute paths should be used, and"},{"line_number":197,"context_line":"``service_policy_path`` left unset."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":".. note:: "},{"line_number":200,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"9ad45d7e_3dbec3d4","line":197,"updated":"2016-08-12 19:45:00.000000000","message":"Nit: This is a good practice (using absolute path for all files in different directories), but technically not true. The following will work:\n\nConfig files absolute path:\n/opt/stack/cinder/etc/policy.json\n/opt/stack/nova/etc/nova/policy.json\n\nservice_policy_files\u003dcompute:/opt/stack/nova/etc/nova/policy.json,volume:policy.json\nservice_policy_path\u003d/opt/stack/cinder/etc","commit_id":"9b84715094687a49f78486ea994e6fd6d7e084dc"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d9f191a5ac1d8578ae79eab32209138f83dac20c","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"Policy files are configured per *service*, not per resource type. If files"},{"line_number":196,"context_line":"are in different directories absolute paths should be used, and"},{"line_number":197,"context_line":"``service_policy_path`` left unset."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":".. note:: "},{"line_number":200,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3ac371cc_ba5f4b71","line":197,"in_reply_to":"9ad45d7e_3dbec3d4","updated":"2016-08-15 16:20:33.000000000","message":"It would be a bit bizarre to actually do this. I don\u0027t really want to highlight it as a possibility.","commit_id":"9b84715094687a49f78486ea994e6fd6d7e084dc"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"8ebd71e34c083343499811eb08c6a805a59675af","unresolved":false,"context_lines":[{"line_number":168,"context_line":"Service policy controls"},{"line_number":169,"context_line":"-----------------------"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy target"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3ac371cc_7c5bcb2e","line":171,"updated":"2016-08-16 19:16:28.000000000","message":"that are used","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"bfc12870bd0c6904be07ef5c85bed671a59278d5","unresolved":false,"context_lines":[{"line_number":168,"context_line":"Service policy controls"},{"line_number":169,"context_line":"-----------------------"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"If configured, Searchlight can consult service policy files (e.g. that used"},{"line_number":172,"context_line":"to configure the nova API). Each resource is configured with a policy target"},{"line_number":173,"context_line":"it will check if possible. Policy file paths can either be absolute or relative"},{"line_number":174,"context_line":"to `service_policy_path` (which itself can be relative to the current working"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3ac371cc_69714ce0","line":171,"in_reply_to":"3ac371cc_7c5bcb2e","updated":"2016-08-16 20:08:25.000000000","message":"will fix","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"}],"doc/source/authoring-plugins.rst":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":455,"context_line":"Related to access control is policy. Most services control API access with"},{"line_number":456,"context_line":"policy files that define rules enforced with `oslo.policy`_. Searchlight has"},{"line_number":457,"context_line":"its own policy file that configures access to its own API and resources, but"},{"line_number":458,"context_line":"it also supports reading other services\u0027 policy files. In future this will"},{"line_number":459,"context_line":"be expanded to define RBAC rules, but at present external policy files are"},{"line_number":460,"context_line":"only used to determine whether a resource should be available to a user."},{"line_number":461,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_22074419","line":458,"range":{"start_line":458,"start_character":55,"end_line":458,"end_character":64},"updated":"2016-08-11 00:07:21.000000000","message":"\"In the future\"","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":455,"context_line":"Related to access control is policy. Most services control API access with"},{"line_number":456,"context_line":"policy files that define rules enforced with `oslo.policy`_. Searchlight has"},{"line_number":457,"context_line":"its own policy file that configures access to its own API and resources, but"},{"line_number":458,"context_line":"it also supports reading other services\u0027 policy files. In future this will"},{"line_number":459,"context_line":"be expanded to define RBAC rules, but at present external policy files are"},{"line_number":460,"context_line":"only used to determine whether a resource should be available to a user."},{"line_number":461,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_a42944e8","line":458,"range":{"start_line":458,"start_character":55,"end_line":458,"end_character":64},"in_reply_to":"9ad45d7e_22074419","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3707cd95abd465153d3934f482e51ef4dcaf1325","unresolved":false,"context_lines":[{"line_number":462,"context_line":"To support this in your plugin, you must define two properties. The first"},{"line_number":463,"context_line":"is ``service_type`` which must correspond to the service \u0027type\u0027 as seen"},{"line_number":464,"context_line":"in the keystone catalog (e.g. nova\u0027s service \u0027type\u0027 is \u0027compute\u0027). The"},{"line_number":465,"context_line":"second property is ``resource_allowed_policy_action`` which identifies the"},{"line_number":466,"context_line":"rule name in the service\u0027s policy files. If either of these properties are"},{"line_number":467,"context_line":"\u0027None\u0027 no rule will be enforced. "},{"line_number":468,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_3fd3d605","line":465,"range":{"start_line":465,"start_character":45,"end_line":465,"end_character":51},"updated":"2016-08-10 23:03:00.000000000","message":"I think the oslo term is target, not action.\n\nhttp://docs.openstack.org/developer/oslo.policy/api.html","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":462,"context_line":"To support this in your plugin, you must define two properties. The first"},{"line_number":463,"context_line":"is ``service_type`` which must correspond to the service \u0027type\u0027 as seen"},{"line_number":464,"context_line":"in the keystone catalog (e.g. nova\u0027s service \u0027type\u0027 is \u0027compute\u0027). The"},{"line_number":465,"context_line":"second property is ``resource_allowed_policy_action`` which identifies the"},{"line_number":466,"context_line":"rule name in the service\u0027s policy files. If either of these properties are"},{"line_number":467,"context_line":"\u0027None\u0027 no rule will be enforced. "},{"line_number":468,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_04665050","line":465,"range":{"start_line":465,"start_character":45,"end_line":465,"end_character":51},"in_reply_to":"9ad45d7e_3fd3d605","updated":"2016-08-11 22:31:44.000000000","message":"Yeah, I think i got confused. They seemed to be used interchangeably and \u0027target\u0027 is used to carry context information for rule enforcement, but that documentation does use \u0027target\u0027.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"4c6bb727062fd9c9df7e8368710fca72395a4e31","unresolved":false,"context_lines":[{"line_number":464,"context_line":"in the keystone catalog (e.g. nova\u0027s service \u0027type\u0027 is \u0027compute\u0027). The"},{"line_number":465,"context_line":"second property is ``resource_allowed_policy_action`` which identifies the"},{"line_number":466,"context_line":"rule name in the service\u0027s policy files. If either of these properties are"},{"line_number":467,"context_line":"\u0027None\u0027 no rule will be enforced. "},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"For example::"},{"line_number":470,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_df11da05","line":467,"updated":"2016-08-10 22:55:51.000000000","message":"red","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":476,"context_line":"    def service_type(self):"},{"line_number":477,"context_line":"        return \u0027compute\u0027"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"See :ref:`service-policy-files` or configuration information."},{"line_number":480,"context_line":""},{"line_number":481,"context_line":".. _oslo.policy: http://docs.openstack.org/developer/oslo.policy/"},{"line_number":482,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_e29c0cc2","line":479,"range":{"start_line":479,"start_character":32,"end_line":479,"end_character":34},"updated":"2016-08-11 00:07:21.000000000","message":"\"for\"","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":476,"context_line":"    def service_type(self):"},{"line_number":477,"context_line":"        return \u0027compute\u0027"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"See :ref:`service-policy-files` or configuration information."},{"line_number":480,"context_line":""},{"line_number":481,"context_line":".. _oslo.policy: http://docs.openstack.org/developer/oslo.policy/"},{"line_number":482,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_44a16845","line":479,"range":{"start_line":479,"start_character":32,"end_line":479,"end_character":34},"in_reply_to":"9ad45d7e_e29c0cc2","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":477,"context_line":"        return \u0027compute\u0027"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"See :ref:`service-policy-files` or configuration information."},{"line_number":480,"context_line":""},{"line_number":481,"context_line":".. _oslo.policy: http://docs.openstack.org/developer/oslo.policy/"},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"Faceting"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_c26468ba","line":480,"updated":"2016-08-11 00:07:21.000000000","message":"Change to `service-policy-controls` if we made the change in authentication.rst.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":477,"context_line":"        return \u0027compute\u0027"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"See :ref:`service-policy-files` or configuration information."},{"line_number":480,"context_line":""},{"line_number":481,"context_line":".. _oslo.policy: http://docs.openstack.org/developer/oslo.policy/"},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"Faceting"}],"source_content_type":"text/x-rst","patch_set":6,"id":"9ad45d7e_a48ca4da","line":480,"in_reply_to":"9ad45d7e_c26468ba","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"etc/policy.json":[{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"8ebd71e34c083343499811eb08c6a805a59675af","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"default\": \"\","},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"    \"search:query\": \"\","},{"line_number":6,"context_line":"    \"search:plugins_info\": \"\","}],"source_content_type":"application/json","patch_set":8,"id":"3ac371cc_fcffbba7","line":3,"updated":"2016-08-16 19:16:28.000000000","message":"should allow be the default rather than \"role:admin\" ? or better yet  would be admin_or_owner\nwhich is \n\"admin_or_owner\":  \"is_admin:True or project_id:%(project_id)s\",","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"ed92dc329d9c09fd43f5c9803a6ef2666be2b51c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"default\": \"\","},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"    \"search:query\": \"\","},{"line_number":6,"context_line":"    \"search:plugins_info\": \"\","}],"source_content_type":"application/json","patch_set":8,"id":"3ac371cc_6cb4bad0","line":3,"in_reply_to":"3ac371cc_29675426","updated":"2016-08-16 20:21:50.000000000","message":"yeah, not a problem here.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"bfc12870bd0c6904be07ef5c85bed671a59278d5","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"default\": \"\","},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"    \"search:query\": \"\","},{"line_number":6,"context_line":"    \"search:plugins_info\": \"\","}],"source_content_type":"application/json","patch_set":8,"id":"3ac371cc_29675426","line":3,"in_reply_to":"3ac371cc_fcffbba7","updated":"2016-08-16 20:08:25.000000000","message":"Yeah, doens\u0027t hurt to do this, although see comment below.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"8ebd71e34c083343499811eb08c6a805a59675af","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    \"search:plugins_info\": \"\","},{"line_number":7,"context_line":"    \"search:facets\": \"\","},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"    \"resource:OS::Glance::Image\": \"\","},{"line_number":10,"context_line":"    \"resource:OS::Glance::Metadef\": \"\","},{"line_number":11,"context_line":"    \"resource:OS::Nova::Server\": \"\","},{"line_number":12,"context_line":"    \"resource:OS::Nova::Hypervisor\": \"role:admin\","}],"source_content_type":"application/json","patch_set":8,"id":"3ac371cc_9cde873d","line":9,"updated":"2016-08-16 19:16:28.000000000","message":"\"admin_or_owner\" for all of these?","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"ed92dc329d9c09fd43f5c9803a6ef2666be2b51c","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    \"search:plugins_info\": \"\","},{"line_number":7,"context_line":"    \"search:facets\": \"\","},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"    \"resource:OS::Glance::Image\": \"\","},{"line_number":10,"context_line":"    \"resource:OS::Glance::Metadef\": \"\","},{"line_number":11,"context_line":"    \"resource:OS::Nova::Server\": \"\","},{"line_number":12,"context_line":"    \"resource:OS::Nova::Hypervisor\": \"role:admin\","}],"source_content_type":"application/json","patch_set":8,"id":"3ac371cc_8cb136e4","line":9,"in_reply_to":"3ac371cc_49645021","updated":"2016-08-16 20:21:50.000000000","message":"it\u0027s fine to leave, again overlooking the buried policy layer.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"bfc12870bd0c6904be07ef5c85bed671a59278d5","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    \"search:plugins_info\": \"\","},{"line_number":7,"context_line":"    \"search:facets\": \"\","},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"    \"resource:OS::Glance::Image\": \"\","},{"line_number":10,"context_line":"    \"resource:OS::Glance::Metadef\": \"\","},{"line_number":11,"context_line":"    \"resource:OS::Nova::Server\": \"\","},{"line_number":12,"context_line":"    \"resource:OS::Nova::Hypervisor\": \"role:admin\","}],"source_content_type":"application/json","patch_set":8,"id":"3ac371cc_49645021","line":9,"in_reply_to":"3ac371cc_9cde873d","updated":"2016-08-16 20:08:25.000000000","message":"Yeah - that actually evaluates to the same as \"\" because where there\u0027s no actual target to check all the services create a fake one with the current token context (so the check becomes \"does the tenant id in the token context match itself\"). It DOES stop domain tokens from working, though.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"}],"releasenotes/notes/bp-support-service-policy-files-c7e5eeb83c6f4126.yaml":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":5,"context_line":"features:"},{"line_number":6,"context_line":"  - API configuration can include service policy files such"},{"line_number":7,"context_line":"    that access to various resources can match whether their"},{"line_number":8,"context_line":"    service API allows access to a user."},{"line_number":9,"context_line":"upgrade:"},{"line_number":10,"context_line":"  - The existing searchlight policy.json has been simplified."},{"line_number":11,"context_line":"    The only supported options for resource policy are to enable"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"9ad45d7e_c232a8a6","line":8,"range":{"start_line":8,"start_character":30,"end_line":8,"end_character":32},"updated":"2016-08-11 00:07:21.000000000","message":"\"for\"","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":5,"context_line":"features:"},{"line_number":6,"context_line":"  - API configuration can include service policy files such"},{"line_number":7,"context_line":"    that access to various resources can match whether their"},{"line_number":8,"context_line":"    service API allows access to a user."},{"line_number":9,"context_line":"upgrade:"},{"line_number":10,"context_line":"  - The existing searchlight policy.json has been simplified."},{"line_number":11,"context_line":"    The only supported options for resource policy are to enable"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"9ad45d7e_64b58c7c","line":8,"range":{"start_line":8,"start_character":30,"end_line":8,"end_character":32},"in_reply_to":"9ad45d7e_c232a8a6","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":9,"context_line":"upgrade:"},{"line_number":10,"context_line":"  - The existing searchlight policy.json has been simplified."},{"line_number":11,"context_line":"    The only supported options for resource policy are to enable"},{"line_number":12,"context_line":"    or disable it for all request types (i.e. the \u0027allowed\u0027, \u0027query\u0027"},{"line_number":13,"context_line":"    \u0027facet\u0027 suffixes are no longer in effect)."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"9ad45d7e_02e040f9","line":12,"range":{"start_line":12,"start_character":51,"end_line":12,"end_character":58},"updated":"2016-08-11 00:07:21.000000000","message":"I think this was \"allow\", present tense!","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"upgrade:"},{"line_number":10,"context_line":"  - The existing searchlight policy.json has been simplified."},{"line_number":11,"context_line":"    The only supported options for resource policy are to enable"},{"line_number":12,"context_line":"    or disable it for all request types (i.e. the \u0027allowed\u0027, \u0027query\u0027"},{"line_number":13,"context_line":"    \u0027facet\u0027 suffixes are no longer in effect)."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"9ad45d7e_04c2d0e8","line":12,"range":{"start_line":12,"start_character":51,"end_line":12,"end_character":58},"in_reply_to":"9ad45d7e_02e040f9","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/api/policy.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"bad9fa06ffc01f3b31cb6918d4b4c46e8be00fcf","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    # TODO(sjmc7) What to do here? Horizon falls back on the underlying service"},{"line_number":139,"context_line":"    # being the point of truth. We don\u0027t have that. Do we enforce the presence"},{"line_number":140,"context_line":"    # of policy files?"},{"line_number":141,"context_line":"    return True"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9ad45d7e_e5e7713e","line":140,"updated":"2016-08-08 23:16:08.000000000","message":"I think a LOG.warning would be okay.  Curious to hear David\u0027s thoughts.","commit_id":"8f9d54586a40f460991c33454a7b40ac0c8bb114"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return False"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    # Now try any related policy action"},{"line_number":127,"context_line":"    service_policy_action \u003d plugin.resource_allowed_policy_action"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    service_enforcer \u003d service_policies.get_enforcer_for_service(service_type)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_e82ceb03","line":127,"updated":"2016-08-11 00:07:21.000000000","message":"To further understand this code I used OS::Nova::Server as an example and dove into the code. In this case, plugin.resource_allowed_policy_action is \"os_compute_api:servers:index\".\n\nIn the Nova code (nova/api/openstack/compute/servers.py) we have:\n\n    ServerController::index()\n        authorize(..., action\u003d\"index\")\n        ServerController::get_servers()\n            authorize(..., action\u003d\"index:get_all_tenants)\n\nInside of nova/policy.json we have:\n\n    \"os_compute_api:servers:index:get_all_tenants\" : \"is_admin:True\"\n    \"os_compute_api:servers:index\" : \"rule:adnin_or_owner\"\n\nThis implies that the Nova code uses both of these rules for the Nova Server API list request. Does that mean we need to check for both of these policy rules in Searchlight to match Nova?\n\nAs opposed to checking for only \"os_compute_api:servers:index\"?","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3707cd95abd465153d3934f482e51ef4dcaf1325","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return False"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    # Now try any related policy action"},{"line_number":127,"context_line":"    service_policy_action \u003d plugin.resource_allowed_policy_action"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    service_enforcer \u003d service_policies.get_enforcer_for_service(service_type)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_1ff7f28b","line":127,"range":{"start_line":127,"start_character":19,"end_line":127,"end_character":25},"updated":"2016-08-10 23:03:00.000000000","message":"target","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"91cac0cd6d7ef2416a14bde8e243399910e0fae9","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return False"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    # Now try any related policy action"},{"line_number":127,"context_line":"    service_policy_action \u003d plugin.resource_allowed_policy_action"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    service_enforcer \u003d service_policies.get_enforcer_for_service(service_type)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_6fdc0047","line":127,"in_reply_to":"9ad45d7e_de8fe572","updated":"2016-08-12 19:57:03.000000000","message":"Good investigation Rick.  I agree with Steve.  We might need to make another property (all_projects_target) in follow-on patches.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return False"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    # Now try any related policy action"},{"line_number":127,"context_line":"    service_policy_action \u003d plugin.resource_allowed_policy_action"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    service_enforcer \u003d service_policies.get_enforcer_for_service(service_type)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_de8fe572","line":127,"in_reply_to":"9ad45d7e_e82ceb03","updated":"2016-08-11 22:31:44.000000000","message":"I don\u0027t think so; get_all_tenants is used to control access at an RBAC level (our equivalent would be \"if you\u0027re an admin, don\u0027t apply the {term: {project: request.context.project}} filter\"). We will need to pay attention to it in the follow up, since it may restrict even an admin from doing things. \n\nThe get_all_tenants policy can\u0027t be used at a gross level to determine whether or not hte plugin is available at all.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"8ebd71e34c083343499811eb08c6a805a59675af","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    resource_type \u003d plugin.get_document_type()"},{"line_number":119,"context_line":"    policy_action \u003d \u0027resource:%s\u0027 % resource_type"},{"line_number":120,"context_line":"    service_type \u003d plugin.service_type"},{"line_number":121,"context_line":"    if not policy_enforcer.check(context, policy_action, {}):"},{"line_number":122,"context_line":"        LOG.debug(\"Policy for \u0027%s\u0027 forbids \u0027%s\u0027\","},{"line_number":123,"context_line":"                  policy_action, resource_type)"},{"line_number":124,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_7cebcbb0","line":121,"updated":"2016-08-16 19:16:28.000000000","message":"I wonder if the logic could/should be different here.\nDo two checks here, make sure that the resource type is not barred per etc/policy.json viz, \"!\". Then check if the service policy file is defined. If it is defined use that value as long as ! was not the rule. If service policy file is not defined and rule was not \"!\" use that evaluated value.\nI\u0027m not entirely sure extracting whether \"!\" is the rule value is possible. And documenting may be difficult. \nAnother possibility is adding rules to the etc/policy.json to introduce a new state.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"ed92dc329d9c09fd43f5c9803a6ef2666be2b51c","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    resource_type \u003d plugin.get_document_type()"},{"line_number":119,"context_line":"    policy_action \u003d \u0027resource:%s\u0027 % resource_type"},{"line_number":120,"context_line":"    service_type \u003d plugin.service_type"},{"line_number":121,"context_line":"    if not policy_enforcer.check(context, policy_action, {}):"},{"line_number":122,"context_line":"        LOG.debug(\"Policy for \u0027%s\u0027 forbids \u0027%s\u0027\","},{"line_number":123,"context_line":"                  policy_action, resource_type)"},{"line_number":124,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_ac919254","line":121,"in_reply_to":"3ac371cc_49c8d022","updated":"2016-08-16 20:21:50.000000000","message":"That sounds good. I always forget the nested policy layer in the plugins. I only now worry about 3 possible sources of truth for policy.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"bfc12870bd0c6904be07ef5c85bed671a59278d5","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    resource_type \u003d plugin.get_document_type()"},{"line_number":119,"context_line":"    policy_action \u003d \u0027resource:%s\u0027 % resource_type"},{"line_number":120,"context_line":"    service_type \u003d plugin.service_type"},{"line_number":121,"context_line":"    if not policy_enforcer.check(context, policy_action, {}):"},{"line_number":122,"context_line":"        LOG.debug(\"Policy for \u0027%s\u0027 forbids \u0027%s\u0027\","},{"line_number":123,"context_line":"                  policy_action, resource_type)"},{"line_number":124,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_49c8d022","line":121,"in_reply_to":"3ac371cc_7cebcbb0","updated":"2016-08-16 20:08:25.000000000","message":"I will add a comment in the code to express this, but in the case where a policy file is configured but not present, the server won\u0027t start. Where it IS configured, the service policy will only be acted on IF searchlight\u0027s own policy allows it. Where the service policy is NOT configured, searchlight\u0027s policy becomes the only rule.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"8ebd71e34c083343499811eb08c6a805a59675af","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    # TODO(sjmc7) What to do here? Horizon falls back on the underlying service"},{"line_number":139,"context_line":"    # being the point of truth. We don\u0027t have that. Do we enforce the presence"},{"line_number":140,"context_line":"    # of policy files?"},{"line_number":141,"context_line":"    return True"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"def resource_allowed(enforcer, context, resource_allowed_action, target\u003d{}):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_3ccb1320","line":141,"updated":"2016-08-16 19:16:28.000000000","message":"with meaningful defaults in etc/policy.json and a change to the logic or policy.json, I think this could become False","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"ed92dc329d9c09fd43f5c9803a6ef2666be2b51c","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    # TODO(sjmc7) What to do here? Horizon falls back on the underlying service"},{"line_number":139,"context_line":"    # being the point of truth. We don\u0027t have that. Do we enforce the presence"},{"line_number":140,"context_line":"    # of policy files?"},{"line_number":141,"context_line":"    return True"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"def resource_allowed(enforcer, context, resource_allowed_action, target\u003d{}):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_8c9ad661","line":141,"in_reply_to":"3ac371cc_29991420","updated":"2016-08-16 20:21:50.000000000","message":"ignore my comment here. Without a logic change (which isn\u0027t required) this makes sense.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"bfc12870bd0c6904be07ef5c85bed671a59278d5","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    # TODO(sjmc7) What to do here? Horizon falls back on the underlying service"},{"line_number":139,"context_line":"    # being the point of truth. We don\u0027t have that. Do we enforce the presence"},{"line_number":140,"context_line":"    # of policy files?"},{"line_number":141,"context_line":"    return True"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"def resource_allowed(enforcer, context, resource_allowed_action, target\u003d{}):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_29991420","line":141,"in_reply_to":"3ac371cc_3ccb1320","updated":"2016-08-16 20:08:25.000000000","message":"See above, but arguably we could add a setting of \"allow resources without policy files\" in the case where there\u0027s no service_enforcer. You would very consciously have to configure policy files or disable that setting","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"8ebd71e34c083343499811eb08c6a805a59675af","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    if not target:"},{"line_number":155,"context_line":"        # This allows \u0027admin_or_owner\u0027 type rules to work"},{"line_number":156,"context_line":"        target \u003d {"},{"line_number":157,"context_line":"            \u0027project_id\u0027: context.tenant,"},{"line_number":158,"context_line":"            \u0027user_id\u0027: context.user,"},{"line_number":159,"context_line":"            \u0027tenant_id\u0027: context.tenant"},{"line_number":160,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_9ce96783","line":157,"updated":"2016-08-16 19:16:28.000000000","message":"I think \"roles\" is still critical. Not sure why that got omitted.","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"bfc12870bd0c6904be07ef5c85bed671a59278d5","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    if not target:"},{"line_number":155,"context_line":"        # This allows \u0027admin_or_owner\u0027 type rules to work"},{"line_number":156,"context_line":"        target \u003d {"},{"line_number":157,"context_line":"            \u0027project_id\u0027: context.tenant,"},{"line_number":158,"context_line":"            \u0027user_id\u0027: context.user,"},{"line_number":159,"context_line":"            \u0027tenant_id\u0027: context.tenant"},{"line_number":160,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_a92184b6","line":157,"in_reply_to":"3ac371cc_9ce96783","updated":"2016-08-16 20:08:25.000000000","message":"This is the fake \u0027target\u0027 that\u0027s used when there isn\u0027t a real one. If you look at how the services (or django openstack auth) does this, they pull out the user, project, tenant ids and in some cases domain ids","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"ed92dc329d9c09fd43f5c9803a6ef2666be2b51c","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    if not target:"},{"line_number":155,"context_line":"        # This allows \u0027admin_or_owner\u0027 type rules to work"},{"line_number":156,"context_line":"        target \u003d {"},{"line_number":157,"context_line":"            \u0027project_id\u0027: context.tenant,"},{"line_number":158,"context_line":"            \u0027user_id\u0027: context.user,"},{"line_number":159,"context_line":"            \u0027tenant_id\u0027: context.tenant"},{"line_number":160,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_2cbe42d4","line":157,"in_reply_to":"3ac371cc_a92184b6","updated":"2016-08-16 20:21:50.000000000","message":"oops,was thinking credentials\n\nyou\u0027re right","commit_id":"6eaa0866eda0555c5dd27a56a6bb7f29d2ae0c47"}],"searchlight/api/v1/search.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        allowed_types \u003d list(filter(_allowed, types))"},{"line_number":175,"context_line":"        if not allowed_types:"},{"line_number":176,"context_line":"            disallowed \u003d set(types) - set(allowed_types)"},{"line_number":177,"context_line":"            disallowed_str \u003d \", \".join(sorted(disallowed))"},{"line_number":178,"context_line":"            msg \u003d _(\"There are no resource types accessible to you to serve \""},{"line_number":179,"context_line":"                    \"your request. You do not have access to the \""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_5c185875","line":176,"updated":"2016-08-11 00:07:21.000000000","message":"Not sure what this is doing. In order to get here, allowed_types is empty. Removing this empty set from set(types) is a no-op. Can be replaced with:\n\n    disallowed \u003d set(types)","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        allowed_types \u003d list(filter(_allowed, types))"},{"line_number":175,"context_line":"        if not allowed_types:"},{"line_number":176,"context_line":"            disallowed \u003d set(types) - set(allowed_types)"},{"line_number":177,"context_line":"            disallowed_str \u003d \", \".join(sorted(disallowed))"},{"line_number":178,"context_line":"            msg \u003d _(\"There are no resource types accessible to you to serve \""},{"line_number":179,"context_line":"                    \"your request. You do not have access to the \""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_de6b6583","line":176,"in_reply_to":"9ad45d7e_5c185875","updated":"2016-08-11 22:31:44.000000000","message":"Yes, that is a bit odd. Since it\u0027s a carryover from the original policy patch I\u0027ll fix it here.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            document_type \u003d action.get(\u0027type\u0027)"},{"line_number":239,"context_line":"            index_name \u003d action.get(\u0027index\u0027)"},{"line_number":240,"context_line":"            data \u003d action.get(\u0027data\u0027, {})"},{"line_number":241,"context_line":"            script \u003d action.geqt(\u0027script\u0027)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            if index_name is not None:"},{"line_number":244,"context_line":"                index_name \u003d self._validate_index(index_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_9c7ad086","line":241,"range":{"start_line":241,"start_character":28,"end_line":241,"end_character":32},"updated":"2016-08-11 00:07:21.000000000","message":"Is this the quiet version of get? :)\nNeed to change this accidental typo back to \"get\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            document_type \u003d action.get(\u0027type\u0027)"},{"line_number":239,"context_line":"            index_name \u003d action.get(\u0027index\u0027)"},{"line_number":240,"context_line":"            data \u003d action.get(\u0027data\u0027, {})"},{"line_number":241,"context_line":"            script \u003d action.geqt(\u0027script\u0027)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            if index_name is not None:"},{"line_number":244,"context_line":"                index_name \u003d self._validate_index(index_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_1e2fbd3f","line":241,"range":{"start_line":241,"start_character":28,"end_line":241,"end_character":32},"in_reply_to":"9ad45d7e_9c7ad086","updated":"2016-08-11 22:31:44.000000000","message":"Good spot, not sure where that came from. Blame it on carelessness, vim, and our lack of testing. In that order","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/base.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3707cd95abd465153d3934f482e51ef4dcaf1325","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        return \"%s-search\" % self.resource_group_name"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    @abc.abstractproperty"},{"line_number":118,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":119,"context_line":"        \"\"\"Should return the policy action that this plugin\u0027s related service"},{"line_number":120,"context_line":"        uses to determine who has API access to list resources. Can return None"},{"line_number":121,"context_line":"        if this service doesn\u0027t support policy."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_ff32de5c","line":118,"range":{"start_line":118,"start_character":32,"end_line":118,"end_character":38},"updated":"2016-08-10 23:03:00.000000000","message":"target","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        return \"%s-search\" % self.resource_group_name"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    @abc.abstractproperty"},{"line_number":118,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":119,"context_line":"        \"\"\"Should return the policy action that this plugin\u0027s related service"},{"line_number":120,"context_line":"        uses to determine who has API access to list resources. Can return None"},{"line_number":121,"context_line":"        if this service doesn\u0027t support policy."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_44b84875","line":118,"range":{"start_line":118,"start_character":32,"end_line":118,"end_character":38},"in_reply_to":"9ad45d7e_ff32de5c","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"885fa5f59950485d8905a6ac56875f831aeb143f","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    @abc.abstractproperty"},{"line_number":118,"context_line":"    def resource_allowed_policy_target(self):"},{"line_number":119,"context_line":"        \"\"\"Should return the policy action that this plugin\u0027s related service"},{"line_number":120,"context_line":"        uses to determine who has API access to list resources. Can return None"},{"line_number":121,"context_line":"        if this service doesn\u0027t support policy."},{"line_number":122,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_cfc40c61","line":119,"range":{"start_line":119,"start_character":36,"end_line":119,"end_character":42},"updated":"2016-08-12 19:57:16.000000000","message":"nit: target","commit_id":"9b84715094687a49f78486ea994e6fd6d7e084dc"}],"searchlight/elasticsearch/plugins/cinder/volumes.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @property"},{"line_number":170,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":171,"context_line":"        return \u0027volume:get_all_snapshots\u0027"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    @property"},{"line_number":174,"context_line":"    def service_type(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_1c254008","line":171,"updated":"2016-08-11 00:07:21.000000000","message":"Should this be \"volume:get_all\". It appears this is what the  Cinder API uses internally.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @property"},{"line_number":170,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":171,"context_line":"        return \u0027volume:get_all_snapshots\u0027"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    @property"},{"line_number":174,"context_line":"    def service_type(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_2466f429","line":171,"in_reply_to":"9ad45d7e_1c254008","updated":"2016-08-11 22:31:44.000000000","message":"Thanks, copy n pasta","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/neutron/ports.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @property"},{"line_number":113,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":114,"context_line":"        # Neutron only supports policy for individual resources"},{"line_number":115,"context_line":"        return None"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_bfd18659","line":114,"range":{"start_line":114,"start_character":54,"end_line":114,"end_character":63},"updated":"2016-08-11 00:07:21.000000000","message":"Nit: Should be \"ports\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/neutron/routers.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @property"},{"line_number":121,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":122,"context_line":"        # Neutron only supports policy for individual networks"},{"line_number":123,"context_line":"        return None"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_3fc6369a","line":122,"range":{"start_line":122,"start_character":54,"end_line":122,"end_character":62},"updated":"2016-08-11 00:07:21.000000000","message":"Nit: Should be \"routers\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @property"},{"line_number":121,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":122,"context_line":"        # Neutron only supports policy for individual networks"},{"line_number":123,"context_line":"        return None"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_244d549a","line":122,"range":{"start_line":122,"start_character":54,"end_line":122,"end_character":62},"in_reply_to":"9ad45d7e_3fc6369a","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/neutron/security_groups.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @property"},{"line_number":80,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":81,"context_line":"        # Neutron only supports policy for individual networks"},{"line_number":82,"context_line":"        return None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_7f538ee2","line":81,"range":{"start_line":81,"start_character":54,"end_line":81,"end_character":62},"updated":"2016-08-11 00:07:21.000000000","message":"Nit: Should be \"security groups\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @property"},{"line_number":80,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":81,"context_line":"        # Neutron only supports policy for individual networks"},{"line_number":82,"context_line":"        return None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_4446887b","line":81,"range":{"start_line":81,"start_character":54,"end_line":81,"end_character":62},"in_reply_to":"9ad45d7e_7f538ee2","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/neutron/subnets.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @property"},{"line_number":111,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":112,"context_line":"        # Neutron only supports policy for individual networks"},{"line_number":113,"context_line":"        return None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_1ff892c2","line":112,"range":{"start_line":112,"start_character":54,"end_line":112,"end_character":62},"updated":"2016-08-11 00:07:21.000000000","message":"Nit: Should be \"subnets\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @property"},{"line_number":111,"context_line":"    def resource_allowed_policy_action(self):"},{"line_number":112,"context_line":"        # Neutron only supports policy for individual networks"},{"line_number":113,"context_line":"        return None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_e457bc23","line":112,"range":{"start_line":112,"start_character":54,"end_line":112,"end_character":62},"in_reply_to":"9ad45d7e_1ff892c2","updated":"2016-08-11 22:31:44.000000000","message":"Done","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/swift/accounts.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @property"},{"line_number":99,"context_line":"    def service_type(self):"},{"line_number":100,"context_line":"        return None"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_rbac_field_filters(self, request_context):"},{"line_number":103,"context_line":"        id \u003d self.options.reseller_prefix + request_context.owner"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_df6f1afa","line":100,"updated":"2016-08-11 00:07:21.000000000","message":"Is this turned off completely? Is this why we are not returning \"object-store\"?","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @property"},{"line_number":99,"context_line":"    def service_type(self):"},{"line_number":100,"context_line":"        return None"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_rbac_field_filters(self, request_context):"},{"line_number":103,"context_line":"        id \u003d self.options.reseller_prefix + request_context.owner"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_643aace8","line":100,"in_reply_to":"9ad45d7e_df6f1afa","updated":"2016-08-11 22:31:44.000000000","message":"yes","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/swift/containers.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @property"},{"line_number":108,"context_line":"    def service_type(self):"},{"line_number":109,"context_line":"        return None"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _get_rbac_field_filters(self, request_context):"},{"line_number":112,"context_line":"        tenant_member \u003d request_context.tenant + \":*\""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_bf4b4686","line":109,"updated":"2016-08-11 00:07:21.000000000","message":"Same comment about returning \"object-store\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/elasticsearch/plugins/swift/objects.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    @property"},{"line_number":98,"context_line":"    def service_type(self):"},{"line_number":99,"context_line":"        return None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _get_rbac_field_filters(self, request_context):"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_9f500234","line":99,"updated":"2016-08-11 00:07:21.000000000","message":"Same comment about \"comment-store\".","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/service_policies.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5ac1a76f63606e5f2dc7bbfd610c73a133b61e16","unresolved":false,"context_lines":[{"line_number":31,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":32,"context_line":"               help\u003d\"Base path for policy files. If not specified, \""},{"line_number":33,"context_line":"                    \"oslo.config search paths will be used\"),"},{"line_number":34,"context_line":"    cfg.DictOpt(\"service_policy_files\","},{"line_number":35,"context_line":"                default\u003d{},"},{"line_number":36,"context_line":"                help\u003d\"Service policy files of the form \u003cservice type\u003e:\u003cpath\u003e,\""},{"line_number":37,"context_line":"                     \"\u003cservice_type\u003e:\u003cpath\u003e. Service type should be e.g.\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_6a589757","line":34,"range":{"start_line":34,"start_character":17,"end_line":34,"end_character":37},"updated":"2016-08-08 09:23:19.000000000","message":"would it be better if we have only one policy file?","commit_id":"8cc572634e45319f23f9a16bab9ac9e0924ffa7b"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"2b986bb873c9e60cea999ae4c3667e0f20e0031e","unresolved":false,"context_lines":[{"line_number":31,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":32,"context_line":"               help\u003d\"Base path for policy files. If not specified, \""},{"line_number":33,"context_line":"                    \"oslo.config search paths will be used\"),"},{"line_number":34,"context_line":"    cfg.DictOpt(\"service_policy_files\","},{"line_number":35,"context_line":"                default\u003d{},"},{"line_number":36,"context_line":"                help\u003d\"Service policy files of the form \u003cservice type\u003e:\u003cpath\u003e,\""},{"line_number":37,"context_line":"                     \"\u003cservice_type\u003e:\u003cpath\u003e. Service type should be e.g.\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_93b6d23b","line":34,"range":{"start_line":34,"start_character":17,"end_line":34,"end_character":37},"in_reply_to":"9ad45d7e_6a589757","updated":"2016-08-08 15:08:24.000000000","message":"It\u0027s (probably) more difficult to do that as a deployer. Under the way most people will deploy, I would imagine it\u0027s easiest either to directly point at e.g. /etc/nova/policy.json or copy those files into /etc/searchlight/nova-policy.json. I\u0027m trying to stick to the way Horizon does this to make it more consistent for deployers.","commit_id":"8cc572634e45319f23f9a16bab9ac9e0924ffa7b"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 Hewlett-Packard Enterprise Development L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_82d6f0ee","line":1,"updated":"2016-08-11 00:07:21.000000000","message":"The copyright line needs a Company:\n\nCopyright (c) 2016 Hewlett-Packard Enterprise Development Company L.P.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 Hewlett-Packard Enterprise Development L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_241b9482","line":1,"in_reply_to":"9ad45d7e_82d6f0ee","updated":"2016-08-11 22:31:44.000000000","message":"No, it doesn\u0027t. Got changed a few weeks ago","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class MissingPolicyFile(Exception):"},{"line_number":47,"context_line":"    pass"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def _get_enforcers():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_927ab986","line":47,"updated":"2016-08-11 00:07:21.000000000","message":"Is this old code? It doesn\u0027t seem to be used anywhere.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class MissingPolicyFile(Exception):"},{"line_number":47,"context_line":"    pass"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def _get_enforcers():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_2f29ad8a","line":47,"in_reply_to":"9ad45d7e_927ab986","updated":"2016-08-11 22:31:44.000000000","message":"Yeah, will remove","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"26909d3ba0b721c85cc71a0bc2d88b75fff655d4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                               pol_file)"},{"line_number":59,"context_line":"            enforcer \u003d policy.Enforcer(cfg.CONF, service_policy_path)"},{"line_number":60,"context_line":"            try:"},{"line_number":61,"context_line":"                enforcer.load_rules()"},{"line_number":62,"context_line":"            except cfg.ConfigFilesNotFoundError:"},{"line_number":63,"context_line":"                LOG.error(_LE(\"Policy file for service %(service)s not found\""},{"line_number":64,"context_line":"                              \" in %(policy_file)s (base path %(base)s)\") %"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_75756ff8","line":61,"updated":"2016-08-11 00:07:21.000000000","message":"It\u0027s bizarre. load_rules() does not throw ConfigFilesNotFoundError. Instead it catches this exception from _get_policy_path and logs a DEBUG message. And it only does this once for the life of the class! It does not raise the exception.\n\nhttps://github.com/openstack/oslo.policy/blob/master/oslo_policy/policy.py#L508-L512\n\nThis means we will never fail when a file is not found. If we want this functionality we will need probably need to test it ourselves. Maybe check \"os.path.isfile(service_policy_path)\" before the instantiating policy.Enforcer().","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7129566706be127b10ec37ca3350ea899309612d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                               pol_file)"},{"line_number":59,"context_line":"            enforcer \u003d policy.Enforcer(cfg.CONF, service_policy_path)"},{"line_number":60,"context_line":"            try:"},{"line_number":61,"context_line":"                enforcer.load_rules()"},{"line_number":62,"context_line":"            except cfg.ConfigFilesNotFoundError:"},{"line_number":63,"context_line":"                LOG.error(_LE(\"Policy file for service %(service)s not found\""},{"line_number":64,"context_line":"                              \" in %(policy_file)s (base path %(base)s)\") %"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_0f530918","line":61,"in_reply_to":"9ad45d7e_75756ff8","updated":"2016-08-11 22:31:44.000000000","message":"This seems to have changed fairly recently; my installed oslo.config doesn\u0027t do this. I\u0027ll figure out an agnostic way to check","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/tests/functional/test_api.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"5cf5c3cb045e9f35f59adb11d73ebde15ef176c0","unresolved":false,"context_lines":[{"line_number":661,"context_line":"            {\u0027is_admin\u0027: \u0027role:admin\u0027, \u0027get_images\u0027: \u0027rule:is_admin\u0027})"},{"line_number":662,"context_line":"        self._write_policy_file("},{"line_number":663,"context_line":"            \u0027nova-policy.json\u0027,"},{"line_number":664,"context_line":"            {\u0027admin_rule\u0027: \u0027role:admin\u0027, \u0027os_compute_api:servers:index\u0027: \u0027\u0027})"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def test_server_starts(self):"},{"line_number":667,"context_line":"        \"\"\"Test that with policy changes, the server still starts\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_38a72c0c","line":664,"updated":"2016-08-11 23:15:23.000000000","message":"The admin_rule is not used, but it doesn\u0027t hurt to keep it here.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"5cf5c3cb045e9f35f59adb11d73ebde15ef176c0","unresolved":false,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def test_server_starts(self):"},{"line_number":667,"context_line":"        \"\"\"Test that with policy changes, the server still starts\"\"\""},{"line_number":668,"context_line":"        self.assertTrue(self.ping_server(self.api_port))"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def test_service_policy_facet(self):"},{"line_number":671,"context_line":"        response, json_content \u003d self._facet_request(TENANT1,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_7d7a36be","line":668,"updated":"2016-08-11 23:15:23.000000000","message":"This will catch there two invalid cases:\n- The file exists and is empty.\n- The file exists and has a line that is not a valid rule.\n\nIt will not catch these cases:\n- The file exists and contains a set of empty rules. I don\u0027t think this is a problem.\n- The file does not exists (False positive).","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"6ec4cf7e86c8b0a0d8c77068335d23486bd572ad","unresolved":false,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def test_server_starts(self):"},{"line_number":667,"context_line":"        \"\"\"Test that with policy changes, the server still starts\"\"\""},{"line_number":668,"context_line":"        self.assertTrue(self.ping_server(self.api_port))"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def test_service_policy_facet(self):"},{"line_number":671,"context_line":"        response, json_content \u003d self._facet_request(TENANT1,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3ac371cc_fa3ee3b6","line":668,"in_reply_to":"9ad45d7e_7d7a36be","updated":"2016-08-15 16:14:45.000000000","message":"Empty rules is ok; the default is to pass unless it\u0027s specified otherwise. This test won\u0027t catch the case of invalid or missing files since they\u0027re already guaranteed to exist (they\u0027re created during test initialization). Testing the negative startup case is a bit tricky since the test harness gets a bit grumpy if the api server doesn\u0027t start","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"5cf5c3cb045e9f35f59adb11d73ebde15ef176c0","unresolved":false,"context_lines":[{"line_number":734,"context_line":"        # TODO(sjmc7) There\u0027s a bug in the functional tests such that"},{"line_number":735,"context_line":"        # we can\u0027t test exceptions raised during deserialization."},{"line_number":736,"context_line":"        # See https://bugs.launchpad.net/searchlight/+bug/1610398"},{"line_number":737,"context_line":"        self.assertNotEqual(200, response.status)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_38e9ecb7","line":737,"updated":"2016-08-11 23:15:23.000000000","message":"Should we be testing that the response.status is 403, instead of not 200. A multitude of sins can be hiding behind a non-200 response :)","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"6ec4cf7e86c8b0a0d8c77068335d23486bd572ad","unresolved":false,"context_lines":[{"line_number":734,"context_line":"        # TODO(sjmc7) There\u0027s a bug in the functional tests such that"},{"line_number":735,"context_line":"        # we can\u0027t test exceptions raised during deserialization."},{"line_number":736,"context_line":"        # See https://bugs.launchpad.net/searchlight/+bug/1610398"},{"line_number":737,"context_line":"        self.assertNotEqual(200, response.status)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3ac371cc_b4c48192","line":737,"in_reply_to":"9ad45d7e_38e9ecb7","updated":"2016-08-15 16:14:45.000000000","message":"Yes - but as I note, we can\u0027t. The response code is always 500.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/tests/unit/test_service_policies.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"5cf5c3cb045e9f35f59adb11d73ebde15ef176c0","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        with mock.patch.object(CONF, \u0027service_policies\u0027) as mock_serv_pols:"},{"line_number":58,"context_line":"            mock_serv_pols.service_policy_files \u003d {\u0027compute\u0027: nova_path}"},{"line_number":59,"context_line":"            mock_serv_pols.service_policy_path \u003d self.conf_dir"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"            enforcers \u003d service_policies._get_enforcers()"},{"line_number":62,"context_line":"            self.assertEqual([\u0027compute\u0027], list(enforcers.keys()))"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_b8003c03","line":59,"updated":"2016-08-11 23:15:23.000000000","message":"I don\u0027t think this is testing the relative path. Since the file in service_policy_files is already an absolute path, the service_policy_path is ignored.\n\nWhat we want is:\n  service_policy_files \u003d {\u0027compute\u0027: \u0027nova.json\u0027}\n  service_policy_path \u003d self.conf_dir\n\nSee line 57 of service_policies.py where we use os.path.join to combine files and path.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"6ec4cf7e86c8b0a0d8c77068335d23486bd572ad","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        with mock.patch.object(CONF, \u0027service_policies\u0027) as mock_serv_pols:"},{"line_number":58,"context_line":"            mock_serv_pols.service_policy_files \u003d {\u0027compute\u0027: nova_path}"},{"line_number":59,"context_line":"            mock_serv_pols.service_policy_path \u003d self.conf_dir"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"            enforcers \u003d service_policies._get_enforcers()"},{"line_number":62,"context_line":"            self.assertEqual([\u0027compute\u0027], list(enforcers.keys()))"}],"source_content_type":"text/x-python","patch_set":6,"id":"3ac371cc_9a2b6feb","line":59,"in_reply_to":"9ad45d7e_b8003c03","updated":"2016-08-15 16:14:45.000000000","message":"Yeah, you\u0027re right. This isn\u0027t correct in PS 7 either.","commit_id":"1dfb109c1cdef603737809ccc365cb9755517722"}],"searchlight/tests/unit/v1/test_api_policy.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"021e8f693e8eb9487c15b440c48c3426e04da8f8","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def test_admin_or_owner(self):"},{"line_number":37,"context_line":"        \"\"\"Since this a commonly used rule, check that it works\"\"\""},{"line_number":38,"context_line":"        self.enforcer.add_rules(policy.policy.Rules.from_dict({"},{"line_number":39,"context_line":"            \u0027admin_or_owner\u0027: \u0027role:admin or project_id:%(project_id)s\u0027,"},{"line_number":40,"context_line":"            \u0027test_rule\u0027: \u0027rule:admin_or_owner\u0027"},{"line_number":41,"context_line":"        }))"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3ac371cc_38aef1e7","line":39,"updated":"2016-08-18 18:08:23.000000000","message":"Nit: The actual rule uses \"is_admin:True\" instead of \"role:admin\". I believe they are the same.","commit_id":"328f82549901ab661192d3009ee19db9cea53fd4"}]}
