)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"44746446e27944acaf0a7e26eda5509d6f999de5","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If evaluating a policy rule that throws an exception,"},{"line_number":10,"context_line":"the policy engine gets the ability to manage the return message"},{"line_number":11,"context_line":"and process any additional rules."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I5ec26b8ce72907a7ef5d319410c09a1c5a33d812"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a6ced46_0caa7670","line":12,"updated":"2015-03-22 18:34:04.000000000","message":"Please file a bug on this and add it to the commit message. This feels like it is a defect that should be explicitly tracked.","commit_id":"f42eeada8b47b2d0c09d9b7dc83057b6b839e96c"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"98214265bb8fd34d13f300b4b895e415566b3f4c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If evaluating a policy rule that throws an exception,"},{"line_number":10,"context_line":"the policy engine gets the ability to manage the return message"},{"line_number":11,"context_line":"and process any additional rules."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I5ec26b8ce72907a7ef5d319410c09a1c5a33d812"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a016987_e84da49a","line":12,"in_reply_to":"1a6ced46_0caa7670","updated":"2015-05-21 21:39:58.000000000","message":"++\n\nalso, an example of such \"bad rule\" would be nice.","commit_id":"f42eeada8b47b2d0c09d9b7dc83057b6b839e96c"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"85d244eeaf3aebc72ca3cb403e5f978a23e8a936","unresolved":false,"context_lines":[{"line_number":10,"context_line":"the policy engine gets the ability to manage the return message"},{"line_number":11,"context_line":"and process any additional rules."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-Bug: 1459884"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I5ec26b8ce72907a7ef5d319410c09a1c5a33d812"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3ac371cc_8f74cb9c","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":19},"updated":"2016-08-15 18:19:38.000000000","message":"reference 1547684 as it has a lot more history and detail","commit_id":"af9f2b11c1a496d39813dabeeccbe42081cbac61"}],"oslo_policy/_checks.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"289b5034225a9e683c1786465dc56ee19c3807fa","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        Requires that all rules accept in order to return True."},{"line_number":144,"context_line":"        \"\"\""},{"line_number":145,"context_line":"        try:"},{"line_number":146,"context_line":"            for rule in self.rules:"},{"line_number":147,"context_line":"                if not rule(target, cred, enforcer):"},{"line_number":148,"context_line":"                    return False"},{"line_number":149,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_58df1f3a","line":146,"updated":"2015-05-29 01:51:57.000000000","message":"I\u0027d prefer that this is written as:\n\n    for rule in self.rules:\n        try:\n            result \u003d rule(target, cred, enforcer)\n        except Exception:\n            return False\n\n        if not result:\n            return False\n\nBecause it keeps the exception handling very close to what we\u0027re expecting will raise it. There should never be a problem iterating over self.rules, but it would be good to not catch that if that ever causes a problem. Or maybe\n\n    for rule in self.rules\n        try:\n            if not rule(target, cred, enforcer):\n                return False\n        except Exception:\n            return False\n\nBut I personally feel the former is a bit more aesthetically pleasing.","commit_id":"2109299f29f9160044a3432665bfd49cda6ce709"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"895b1b8e01a14f939dc1d99a10e51fd7f00082e4","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        Requires that all rules accept in order to return True."},{"line_number":144,"context_line":"        \"\"\""},{"line_number":145,"context_line":"        try:"},{"line_number":146,"context_line":"            for rule in self.rules:"},{"line_number":147,"context_line":"                if not rule(target, cred, enforcer):"},{"line_number":148,"context_line":"                    return False"},{"line_number":149,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_4909b9dc","line":146,"in_reply_to":"7a016987_58df1f3a","updated":"2015-07-21 01:46:54.000000000","message":"Done","commit_id":"2109299f29f9160044a3432665bfd49cda6ce709"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"289b5034225a9e683c1786465dc56ee19c3807fa","unresolved":false,"context_lines":[{"line_number":254,"context_line":"    def __call__(self, target, creds, enforcer):"},{"line_number":255,"context_line":"        try:"},{"line_number":256,"context_line":"            return self.match.lower() in [x.lower() for x in creds[\u0027roles\u0027]]"},{"line_number":257,"context_line":"        except Exception:"},{"line_number":258,"context_line":"            return False"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_38e903e7","line":257,"updated":"2015-05-29 01:51:57.000000000","message":"What exception are we trying to catch here?","commit_id":"2109299f29f9160044a3432665bfd49cda6ce709"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"895b1b8e01a14f939dc1d99a10e51fd7f00082e4","unresolved":false,"context_lines":[{"line_number":254,"context_line":"    def __call__(self, target, creds, enforcer):"},{"line_number":255,"context_line":"        try:"},{"line_number":256,"context_line":"            return self.match.lower() in [x.lower() for x in creds[\u0027roles\u0027]]"},{"line_number":257,"context_line":"        except Exception:"},{"line_number":258,"context_line":"            return False"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_092ad12c","line":257,"in_reply_to":"7a016987_38e903e7","updated":"2015-07-21 01:46:54.000000000","message":"Usually a Key Error,  but for policy, it does not matter;  returning flase is sufficient, as then something else will report to the end user there was an error.  We don\u0027t document what errors are thrown outside of the API, so being more comprehensive in coverage is the proper approach.","commit_id":"2109299f29f9160044a3432665bfd49cda6ce709"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"289b5034225a9e683c1786465dc56ee19c3807fa","unresolved":false,"context_lines":[{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def __call__(self, target, creds, enforcer):"},{"line_number":270,"context_line":"        try:"},{"line_number":271,"context_line":"            url \u003d (\u0027http:\u0027 + self.match) % target"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"            # Convert instances of object() in target temporarily to"},{"line_number":274,"context_line":"            # empty dict to avoid circular reference detection"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_18e64715","line":271,"updated":"2015-05-29 01:51:57.000000000","message":"Can we isolate these and make what we\u0027re expecting to cause a problem explicit?","commit_id":"2109299f29f9160044a3432665bfd49cda6ce709"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"895b1b8e01a14f939dc1d99a10e51fd7f00082e4","unresolved":false,"context_lines":[{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def __call__(self, target, creds, enforcer):"},{"line_number":270,"context_line":"        try:"},{"line_number":271,"context_line":"            url \u003d (\u0027http:\u0027 + self.match) % target"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"            # Convert instances of object() in target temporarily to"},{"line_number":274,"context_line":"            # empty dict to avoid circular reference detection"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_49be99d5","line":271,"in_reply_to":"7a016987_18e64715","updated":"2015-07-21 01:46:54.000000000","message":"This one is many different errors, and there is no reason trying to differentiate between them.","commit_id":"2109299f29f9160044a3432665bfd49cda6ce709"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"3d7e71212b64ebf7428f1dddc2699734ccea06b5","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                    return True"},{"line_number":195,"context_line":"            except Exception:"},{"line_number":196,"context_line":"                # Treat an exception as the failure of an individual rule"},{"line_number":197,"context_line":"                # not of the whole OrCheck."},{"line_number":198,"context_line":"                pass"},{"line_number":199,"context_line":"        return False"},{"line_number":200,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_40969095","line":197,"updated":"2015-12-10 04:52:01.000000000","message":"This is way too broad. Policy failing to enforce should generally be considered a configuration error right? - not something a user did wrong that should be hidden","commit_id":"e30d069907e64bf51258eb07cb3827aa751a9555"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"3d7e71212b64ebf7428f1dddc2699734ccea06b5","unresolved":false,"context_lines":[{"line_number":254,"context_line":"    def __call__(self, target, creds, enforcer):"},{"line_number":255,"context_line":"        try:"},{"line_number":256,"context_line":"            return self.match.lower() in [x.lower() for x in creds[\u0027roles\u0027]]"},{"line_number":257,"context_line":"        except KeyError:"},{"line_number":258,"context_line":"            return False"},{"line_number":259,"context_line":"        except TypeError:"},{"line_number":260,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_80f23805","line":257,"updated":"2015-12-10 04:52:01.000000000","message":"(KeyError, TypeError):","commit_id":"e30d069907e64bf51258eb07cb3827aa751a9555"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"3d7e71212b64ebf7428f1dddc2699734ccea06b5","unresolved":false,"context_lines":[{"line_number":285,"context_line":"                    \u0027credentials\u0027: jsonutils.dumps(creds)}"},{"line_number":286,"context_line":"            with contextlib.closing(requests.post(url, data\u003ddata)) as r:"},{"line_number":287,"context_line":"                return r.text \u003d\u003d \u0027True\u0027"},{"line_number":288,"context_line":"        except Exception:"},{"line_number":289,"context_line":"            return False"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_80c9d8ae","line":288,"updated":"2015-12-10 04:52:01.000000000","message":"again too broad. Triggering this means that something the administrator has done to configure a detailed policy has failed and we aren\u0027t going to tell them why.","commit_id":"e30d069907e64bf51258eb07cb3827aa751a9555"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"85d244eeaf3aebc72ca3cb403e5f978a23e8a936","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            try:"},{"line_number":125,"context_line":"                if not rule(target, cred, enforcer):"},{"line_number":126,"context_line":"                    return False"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                return False"},{"line_number":129,"context_line":"        return True"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_0f69fbbe","line":127,"range":{"start_line":127,"start_character":12,"end_line":127,"end_character":28},"updated":"2016-08-15 18:19:38.000000000","message":"can we convert these all to just KeyErrors? using Exception would squash too many proper failures","commit_id":"af9f2b11c1a496d39813dabeeccbe42081cbac61"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"85d244eeaf3aebc72ca3cb403e5f978a23e8a936","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    def __call__(self, target, creds, enforcer):"},{"line_number":220,"context_line":"        try:"},{"line_number":221,"context_line":"            return self.match.lower() in [x.lower() for x in creds[\u0027roles\u0027]]"},{"line_number":222,"context_line":"        except KeyError:"},{"line_number":223,"context_line":"            return False"},{"line_number":224,"context_line":"        except TypeError:"},{"line_number":225,"context_line":"            return False"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"@register(\u0027http\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_749a0216","line":225,"range":{"start_line":222,"start_character":0,"end_line":225,"end_character":24},"updated":"2016-08-15 18:19:38.000000000","message":"save a few lines: \n\n  except (KeyError, TypeError):\n    return False","commit_id":"af9f2b11c1a496d39813dabeeccbe42081cbac61"}]}
