)]}'
{"oslo_policy/_opa.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"8615540eebed31f0a41f337d91b5340000ebd9e3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright (c) 2018 OpenStack Foundation."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_aa413aa8","line":3,"updated":"2019-02-14 22:00:08.000000000","message":"Pretty sure this should say Red Hat. You don\u0027t work for the Foundation, so you shouldn\u0027t assign copyright to them.","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"46b3ff168c4ba7db6fef189ead4000c936cebacf","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright (c) 2018 OpenStack Foundation."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_87e45ae1","line":3,"in_reply_to":"9fdfeff1_aa413aa8","updated":"2019-02-15 20:15:55.000000000","message":"Please correct this before we land the code.","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"8615540eebed31f0a41f337d91b5340000ebd9e3","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo_policy import _checks"},{"line_number":23,"context_line":"from oslo_policy._i18n import _"},{"line_number":24,"context_line":"import requests"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_SESSION \u003d None"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_0a0c0692","line":24,"updated":"2019-02-14 22:00:08.000000000","message":"Nit: Third-party library should be in its own section.","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"46b3ff168c4ba7db6fef189ead4000c936cebacf","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo_policy import _checks"},{"line_number":23,"context_line":"from oslo_policy._i18n import _"},{"line_number":24,"context_line":"import requests"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_SESSION \u003d None"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_07d86a1b","line":24,"in_reply_to":"9fdfeff1_0a0c0692","updated":"2019-02-15 20:15:55.000000000","message":"Since we have another patch pending, this should be fixed.","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"8615540eebed31f0a41f337d91b5340000ebd9e3","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        elif not url.startswith(\"http:\"):"},{"line_number":71,"context_line":"            raise RuntimeError(\"The URL %s is not valid\" % url)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        json \u003d self._construct_payload(creds, current_rule, enforcer, target)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        with contextlib.closing("},{"line_number":76,"context_line":"                self.session.post(url, json\u003djson, **request_kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_4a644e4a","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":12},"updated":"2019-02-14 22:00:08.000000000","message":"Technically this not JSON, it\u0027s a Python dict. I assume requests must dump it to a JSON string before sending.","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"46b3ff168c4ba7db6fef189ead4000c936cebacf","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        elif not url.startswith(\"http:\"):"},{"line_number":71,"context_line":"            raise RuntimeError(\"The URL %s is not valid\" % url)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        json \u003d self._construct_payload(creds, current_rule, enforcer, target)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        with contextlib.closing("},{"line_number":76,"context_line":"                self.session.post(url, json\u003djson, **request_kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_e70a0688","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":12},"in_reply_to":"9fdfeff1_4a644e4a","updated":"2019-02-15 20:15:55.000000000","message":"I\u0027m fine with this as is personally. It\u0027s conveying that it is intended to be JSON compliant (when dumped for the wire)","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"46b3ff168c4ba7db6fef189ead4000c936cebacf","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        json \u003d self._construct_payload(creds, current_rule, enforcer, target)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        with contextlib.closing("},{"line_number":76,"context_line":"                self.session.post(url, json\u003djson, **request_kwargs)"},{"line_number":77,"context_line":"        ) as resp:"},{"line_number":78,"context_line":"            data \u003d resp.json()"},{"line_number":79,"context_line":"            try:"},{"line_number":80,"context_line":"                return data[\u0027result\u0027] is True"},{"line_number":81,"context_line":"            except (ValueError, KeyError):"},{"line_number":82,"context_line":"                return False"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @property"},{"line_number":85,"context_line":"    def session(self):"},{"line_number":86,"context_line":"        global _SESSION"},{"line_number":87,"context_line":"        if not _SESSION:"},{"line_number":88,"context_line":"            _SESSION \u003d requests.Session()"},{"line_number":89,"context_line":"        return _SESSION"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @staticmethod"},{"line_number":92,"context_line":"    def _construct_payload(creds, current_rule, enforcer, target):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_2741eea6","line":89,"range":{"start_line":75,"start_character":0,"end_line":89,"end_character":23},"updated":"2019-02-15 20:15:55.000000000","message":"Is it really desirable to have a connection (session) per active thread/greenlet (eventlet)? We may need to do some pooling to ensure we don\u0027t overload OPA if many sources are all leaning on OPA.\n\nSomething to think about, but not needed for the moment.","commit_id":"276c2aa36940f9511d6dfbb2d454ff03f85eb737"}]}
