)]}'
{"blazar/tests/test_policy.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e1a9b3fe38f340ff3a97d5efbee6f2cff70ec070","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                       \u0027project_id\u0027: self.context.project_id}"},{"line_number":40,"context_line":"        target_wrong \u003d {\u0027user_id\u0027: self.context.user_id,"},{"line_number":41,"context_line":"                        \u0027project_id\u0027: \u0027bad_project\u0027}"},{"line_number":42,"context_line":"        action \u003d \"blazar:leases:get\""},{"line_number":43,"context_line":"        self.assertTrue(policy.enforce(self.context, action,"},{"line_number":44,"context_line":"                                       target_good))"},{"line_number":45,"context_line":"        self.assertFalse(policy.enforce(self.context, action,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_a13be3ce","line":42,"range":{"start_line":42,"start_character":0,"end_line":42,"end_character":36},"updated":"2018-06-11 08:50:26.000000000","message":"policy.enforce still supports an action argument that doesn\u0027t include get, post, put or delete.","commit_id":"d40d891b2c11ca438aa5e797e3c1dd9b4a8d83d7"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"779240f23fe54fc77a579107b9a3ead7aee10ff9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                       \u0027project_id\u0027: self.context.project_id}"},{"line_number":40,"context_line":"        target_wrong \u003d {\u0027user_id\u0027: self.context.user_id,"},{"line_number":41,"context_line":"                        \u0027project_id\u0027: \u0027bad_project\u0027}"},{"line_number":42,"context_line":"        action \u003d \"blazar:leases:get\""},{"line_number":43,"context_line":"        self.assertTrue(policy.enforce(self.context, action,"},{"line_number":44,"context_line":"                                       target_good))"},{"line_number":45,"context_line":"        self.assertFalse(policy.enforce(self.context, action,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_0b141fe8","line":42,"range":{"start_line":42,"start_character":0,"end_line":42,"end_character":36},"in_reply_to":"5f7c97a3_a13be3ce","updated":"2018-06-12 00:44:48.000000000","message":"Right. I think policy should be explicitly set per action like get, post, put and delete. If it\u0027s not set, default policy (configured by the policy_default_rule) is applied or otherwise just denied. \n\nThat\u0027s why I didn\u0027t define policy for \"blazar:leases\" (and \"blazar:oshosts\") and changed here.","commit_id":"d40d891b2c11ca438aa5e797e3c1dd9b4a8d83d7"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"7de10f67e403128f8f33287dcd011101f12dea23","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            return True"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        self.assertTrue(user_method_with_action(self))"},{"line_number":75,"context_line":"        try:"},{"line_number":76,"context_line":"            adminonly_method_with_action(self)"},{"line_number":77,"context_line":"            self.assertTrue(False)"},{"line_number":78,"context_line":"        except exceptions.PolicyNotAuthorized:"},{"line_number":79,"context_line":"            # We are expecting this exception"},{"line_number":80,"context_line":"            self.assertTrue(True)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1529b935","line":80,"range":{"start_line":75,"start_character":0,"end_line":80,"end_character":33},"updated":"2018-06-11 06:00:58.000000000","message":"self.assertRaises() would be easier to read.","commit_id":"d40d891b2c11ca438aa5e797e3c1dd9b4a8d83d7"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"75023f1fbc9ec64eed685a8303466d847aa10c00","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            return True"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        self.assertTrue(user_method_with_action(self))"},{"line_number":75,"context_line":"        try:"},{"line_number":76,"context_line":"            adminonly_method_with_action(self)"},{"line_number":77,"context_line":"            self.assertTrue(False)"},{"line_number":78,"context_line":"        except exceptions.PolicyNotAuthorized:"},{"line_number":79,"context_line":"            # We are expecting this exception"},{"line_number":80,"context_line":"            self.assertTrue(True)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_0b3c36df","line":80,"range":{"start_line":75,"start_character":0,"end_line":80,"end_character":33},"in_reply_to":"5f7c97a3_1529b935","updated":"2018-06-11 08:12:24.000000000","message":"Done","commit_id":"d40d891b2c11ca438aa5e797e3c1dd9b4a8d83d7"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"c2eb4c58cf67d0c4564f0a0b0741f4cf05845144","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        self.assertTrue(user_method_with_action(self))"},{"line_number":75,"context_line":"        self.assertRaises(exceptions.PolicyNotAuthorized,"},{"line_number":76,"context_line":"                          adminonly_method_with_action, self)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_21283384","line":76,"range":{"start_line":76,"start_character":56,"end_line":76,"end_character":60},"updated":"2018-06-11 08:47:50.000000000","message":"Yup, we need the argument :)\nThanks!","commit_id":"99cb6b5199cd61cea218bd11848b11e2b1baaff4"}]}
