)]}'
{"patrole_tempest_plugin/policy_authority.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"be51ec567bcae1bd438cf0cc2e662c0ea1e5a1aa","unresolved":false,"context_lines":[{"line_number":186,"context_line":"                                        \"service %s. This can lead to policy \""},{"line_number":187,"context_line":"                                        \"rule ambiguity. Using rule: %s\","},{"line_number":188,"context_line":"                                        k, self.service, rules[k])"},{"line_number":189,"context_line":"            except (ValueError, IOError):"},{"line_number":190,"context_line":"                LOG.warning(\"Failed to read policy file \u0027%s\u0027 for service %s.\","},{"line_number":191,"context_line":"                            path, self.service)"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d23748fe","line":189,"range":{"start_line":189,"start_character":20,"end_line":189,"end_character":30},"updated":"2018-09-11 20:06:34.000000000","message":"Just doing any early review: this looks consistent with: https://github.com/openstack/oslo.policy/blob/cef105744d80023eed5ec7392f31e073f38ea765/oslo_policy/policy.py#L377\n\nGood thing that module abstracts out the yaml error for us","commit_id":"017eb94f8456909798f0708e26f549330e0610fb"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ff09c29ac6d9aed2e086b919d1a0a9a1c847e459","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                    ]),"},{"line_number":88,"context_line":"            ]"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        .. code-block:: yaml"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            # Below is the custom override of the default policy in a YAML"},{"line_number":93,"context_line":"            # policy file. Note that the default rule is \"rule:admin_or_owner\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_ea660556","line":90,"range":{"start_line":90,"start_character":8,"end_line":90,"end_character":28},"updated":"2018-09-12 04:14:18.000000000","message":"I forget why we added this code block in YAML when it was never supported till now :/","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":8911,"name":"Sergey Vilgelm","email":"sergey@vilgelm.info","username":"sergey.vilgelm"},"change_message_id":"1913fb2f4ad8fec0715bdff5e11f48b427da0a43","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                    ]),"},{"line_number":88,"context_line":"            ]"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        .. code-block:: yaml"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            # Below is the custom override of the default policy in a YAML"},{"line_number":93,"context_line":"            # policy file. Note that the default rule is \"rule:admin_or_owner\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_24242caf","line":90,"range":{"start_line":90,"start_character":8,"end_line":90,"end_character":28},"in_reply_to":"3f79a3b5_ea660556","updated":"2018-09-12 11:10:36.000000000","message":"I don\u0027t know :)","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ff09c29ac6d9aed2e086b919d1a0a9a1c847e459","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        return is_allowed"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def get_rules(self):"},{"line_number":173,"context_line":"        rules \u003d policy.Rules(default_rule\u003d\u0027default\u0027)"},{"line_number":174,"context_line":"        # Check whether policy file exists and attempt to read it."},{"line_number":175,"context_line":"        for path in self.policy_files[self.service]:"},{"line_number":176,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_ea2125fe","line":173,"range":{"start_line":173,"start_character":29,"end_line":173,"end_character":51},"updated":"2018-09-12 04:14:18.000000000","message":"I think it\u0027s better to not specify this because: https://github.com/openstack/oslo.policy/blob/cef105744d80023eed5ec7392f31e073f38ea765/oslo_policy/policy.py#L477\n\nhttps://github.com/openstack/oslo.policy/blob/cef105744d80023eed5ec7392f31e073f38ea765/oslo_policy/opts.py#L44\n\nIt\u0027d be better to allow operators to specify via config option rather than hardcode.","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":8911,"name":"Sergey Vilgelm","email":"sergey@vilgelm.info","username":"sergey.vilgelm"},"change_message_id":"1913fb2f4ad8fec0715bdff5e11f48b427da0a43","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        return is_allowed"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def get_rules(self):"},{"line_number":173,"context_line":"        rules \u003d policy.Rules(default_rule\u003d\u0027default\u0027)"},{"line_number":174,"context_line":"        # Check whether policy file exists and attempt to read it."},{"line_number":175,"context_line":"        for path in self.policy_files[self.service]:"},{"line_number":176,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_4425a8ad","line":173,"range":{"start_line":173,"start_character":29,"end_line":173,"end_character":51},"in_reply_to":"3f79a3b5_ea2125fe","updated":"2018-09-12 11:10:36.000000000","message":"Done","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ff09c29ac6d9aed2e086b919d1a0a9a1c847e459","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                                   \"multiple policies files for service %s. \""},{"line_number":186,"context_line":"                                   \"This can lead to policy rule ambiguity. \""},{"line_number":187,"context_line":"                                   \"Using rule: %s; Rule from file: %s\")"},{"line_number":188,"context_line":"                            LOG.warning(msg, k, self.service, rules[k], v)"},{"line_number":189,"context_line":"            except (ValueError, IOError):"},{"line_number":190,"context_line":"                LOG.warning(\"Failed to read policy file \u0027%s\u0027 for service %s.\","},{"line_number":191,"context_line":"                            path, self.service)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0a8021bf","line":188,"range":{"start_line":188,"start_character":72,"end_line":188,"end_character":73},"updated":"2018-09-12 04:14:18.000000000","message":"Why not str(v) if this is a Rule object?","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":8911,"name":"Sergey Vilgelm","email":"sergey@vilgelm.info","username":"sergey.vilgelm"},"change_message_id":"1913fb2f4ad8fec0715bdff5e11f48b427da0a43","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                                   \"multiple policies files for service %s. \""},{"line_number":186,"context_line":"                                   \"This can lead to policy rule ambiguity. \""},{"line_number":187,"context_line":"                                   \"Using rule: %s; Rule from file: %s\")"},{"line_number":188,"context_line":"                            LOG.warning(msg, k, self.service, rules[k], v)"},{"line_number":189,"context_line":"            except (ValueError, IOError):"},{"line_number":190,"context_line":"                LOG.warning(\"Failed to read policy file \u0027%s\u0027 for service %s.\","},{"line_number":191,"context_line":"                            path, self.service)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2472ecae","line":188,"range":{"start_line":188,"start_character":72,"end_line":188,"end_character":73},"in_reply_to":"3f79a3b5_0a8021bf","updated":"2018-09-12 11:10:36.000000000","message":"v is an object of `_Check` class, and it has `__str__` function, so it will be automatically converted to sting forma, because %s means string..","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"b13100a469f85f9aa6d6b673fd6f4a25bcfda758","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                    ]),"},{"line_number":88,"context_line":"            ]"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        .. code-block:: yaml/json"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            # Below is the custom override of the default policy in a YAML or"},{"line_number":93,"context_line":"            # JSON policy file. Note that the default rule is"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b0cf08b2","line":90,"range":{"start_line":90,"start_character":28,"end_line":90,"end_character":33},"updated":"2018-09-12 20:47:16.000000000","message":"This should just be yaml. It\u0027s OK to just use a yaml code block example.\n\nReason why is also because this is sphinx syntax which can only render this one way. (It should be here: http://logs.openstack.org/80/601680/3/check/openstack-tox-docs/015f121/html/framework/policy_authority.html#module-patrole_tempest_plugin.policy_authority but I forgot to add :special-members: for this module thing in the doc/ folder so this whole docstring isn\u0027t showing up... will quickly go fix that issue.)","commit_id":"f827d0c6ebd12f1400ce81a4f299c509c2512d66"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"b13100a469f85f9aa6d6b673fd6f4a25bcfda758","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        .. code-block:: yaml/json"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            # Below is the custom override of the default policy in a YAML or"},{"line_number":93,"context_line":"            # JSON policy file. Note that the default rule is"},{"line_number":94,"context_line":"            # \"rule:admin_or_owner\" and the custom rule is \"rule:admin_api\"."},{"line_number":95,"context_line":"            # The `PolicyAuthority` class will use the \"rule:admin_api\""},{"line_number":96,"context_line":"            # definition for this policy action."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_90cc4cbc","line":93,"range":{"start_line":93,"start_character":14,"end_line":93,"end_character":18},"updated":"2018-09-12 20:47:16.000000000","message":"Also just YAML. The syntax below is YAML. It\u0027s OK if we just use YAML here in the example; YAML vs. JSON is pretty self-explanatory.","commit_id":"f827d0c6ebd12f1400ce81a4f299c509c2512d66"}],"patrole_tempest_plugin/tests/unit/test_policy_authority.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ff09c29ac6d9aed2e086b919d1a0a9a1c847e459","unresolved":false,"context_lines":[{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":6,"context_line":"#    a copy of the License at"},{"line_number":7,"context_line":"#"},{"line_number":8,"context_line":"#         http://www.apache.org/licenses/LICENSE-2.0"},{"line_number":9,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0ae7c1ae","line":6,"updated":"2018-09-12 04:14:18.000000000","message":"We still need a few tests for checking YAML, e.g.:\n\nhttps://review.openstack.org/#/c/494368/12/patrole_tempest_plugin/tests/unit/test_rbac_policy_parser.py@87\n\nhttps://review.openstack.org/#/c/494368/12/patrole_tempest_plugin/tests/unit/test_rbac_policy_parser.py@517","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":8911,"name":"Sergey Vilgelm","email":"sergey@vilgelm.info","username":"sergey.vilgelm"},"change_message_id":"1913fb2f4ad8fec0715bdff5e11f48b427da0a43","unresolved":false,"context_lines":[{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":6,"context_line":"#    a copy of the License at"},{"line_number":7,"context_line":"#"},{"line_number":8,"context_line":"#         http://www.apache.org/licenses/LICENSE-2.0"},{"line_number":9,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_649d44ba","line":6,"in_reply_to":"3f79a3b5_0ae7c1ae","updated":"2018-09-12 11:10:36.000000000","message":"Sure","commit_id":"92d1a365642417605c83b9ad8ad45bbaec9389dc"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"b13100a469f85f9aa6d6b673fd6f4a25bcfda758","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        return fake_rules"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @mock.patch.object(policy_authority, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":90,"context_line":"    def test_custom_policy_json(self, *args):"},{"line_number":91,"context_line":"        default_roles \u003d [\u0027zero\u0027, \u0027one\u0027, \u0027two\u0027, \u0027three\u0027, \u0027four\u0027,"},{"line_number":92,"context_line":"                         \u0027five\u0027, \u0027six\u0027, \u0027seven\u0027, \u0027eight\u0027, \u0027nine\u0027]"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b09e2867","line":90,"range":{"start_line":90,"start_character":8,"end_line":90,"end_character":31},"updated":"2018-09-12 20:47:16.000000000","message":"May we make this a private helper:\n\n     def _test_custom_policy(format\u003d\u0027json\u0027):\n         if format \u003d\u003d \u0027yaml\u0027:\n            self.useFixture(fixtures.ConfPatcher(\n                custom_policy_files\u003d[self.conf_policy_path_yaml], group\u003d\u0027patrole\u0027))\n         [code from L94-113 here]\n\n     def test_custom_policy_json():\n         self._test_custom_policy(format\u003d\u0027json\u0027)\n\n    def test_custom_policy_yaml():\n        self._test_custom_policy(format\u003d\u0027yaml\u0027)","commit_id":"f827d0c6ebd12f1400ce81a4f299c509c2512d66"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"3e26b8eaab97572605d9a25bca072e1d2f0d216a","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            fake_rules.append(fake_rule)"},{"line_number":87,"context_line":"        return fake_rules"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @mock.patch.object(policy_authority, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":90,"context_line":"    def _test_custom_policy(self, *args):"},{"line_number":91,"context_line":"        default_roles \u003d [\u0027zero\u0027, \u0027one\u0027, \u0027two\u0027, \u0027three\u0027, \u0027four\u0027,"},{"line_number":92,"context_line":"                         \u0027five\u0027, \u0027six\u0027, \u0027seven\u0027, \u0027eight\u0027, \u0027nine\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_3c6aee1a","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":62},"updated":"2018-09-13 06:09:15.000000000","message":"nit: This isn\u0027t a necessary mock.","commit_id":"ef7047df40b674c72635b9dac9d7e6e1f22e9a86"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"3e26b8eaab97572605d9a25bca072e1d2f0d216a","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        return fake_rules"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @mock.patch.object(policy_authority, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":90,"context_line":"    def _test_custom_policy(self, *args):"},{"line_number":91,"context_line":"        default_roles \u003d [\u0027zero\u0027, \u0027one\u0027, \u0027two\u0027, \u0027three\u0027, \u0027four\u0027,"},{"line_number":92,"context_line":"                         \u0027five\u0027, \u0027six\u0027, \u0027seven\u0027, \u0027eight\u0027, \u0027nine\u0027]"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_1c6ff228","line":90,"range":{"start_line":90,"start_character":34,"end_line":90,"end_character":39},"updated":"2018-09-13 06:09:15.000000000","message":"nit: This isn\u0027t necessary since mock above isn\u0027t required but this is existing behavior that has nothing to do with this patch set.","commit_id":"ef7047df40b674c72635b9dac9d7e6e1f22e9a86"}],"releasenotes/notes/yaml-policy-file-support-278d3edf64f98d69.yaml":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"3e26b8eaab97572605d9a25bca072e1d2f0d216a","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"- |"},{"line_number":4,"context_line":"  Patrole now supports parsing custom YAML policy files, the new policy file"},{"line_number":5,"context_line":"  extension since Ocata. The function ``_get_policy_data`` has been renamed to"},{"line_number":6,"context_line":"  ``get_rules`` and been changed to re-use ``oslo_policy.policy.Rules.load``"},{"line_number":7,"context_line":"  function."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f79a3b5_7cce262e","line":7,"range":{"start_line":5,"start_character":25,"end_line":7,"end_character":11},"updated":"2018-09-13 06:09:15.000000000","message":"nit: This is internal implementation so end user doesn\u0027t need to know this but I\u0027m OK to keep this anyway as it doesn\u0027t hurt.","commit_id":"ef7047df40b674c72635b9dac9d7e6e1f22e9a86"}]}
