)]}'
{"ceilometer/api/controllers/v2/events.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"8f912692f106a29a3218835b5d3b3a2b28633550","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    \"\"\"Works on Events.\"\"\""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @staticmethod"},{"line_number":240,"context_line":"    def chk_ownership(event, do_raise):"},{"line_number":241,"context_line":"        target_dict \u003d dict()"},{"line_number":242,"context_line":"        for trait in event.traits:"},{"line_number":243,"context_line":"            d \u003d trait.as_dict()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_1cd0f8c8","line":240,"updated":"2015-07-06 17:09:11.000000000","message":"rename to check_ownerhsip, no need to shorten the name\n\nalso, remove do_raise from the arguments as you never set it in line 267","commit_id":"2d5315343aa97f92f76d9a3fb7e5a8f547d301a1"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"8f912692f106a29a3218835b5d3b3a2b28633550","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                              traits\u003devent.traits,"},{"line_number":265,"context_line":"                              raw\u003devent.raw)"},{"line_number":266,"context_line":"            # Enforce policy-based rbac validation"},{"line_number":267,"context_line":"            if EventsController.chk_ownership(event):"},{"line_number":268,"context_line":"                events.append(event_new)"},{"line_number":269,"context_line":"            else:"},{"line_number":270,"context_line":"                LOG.debug(_(\"User doesn\u0027t have access to event %s \")"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_fcfe7437","line":267,"updated":"2015-07-06 17:09:11.000000000","message":"if self.chk_ownership(event):","commit_id":"2d5315343aa97f92f76d9a3fb7e5a8f547d301a1"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"8f912692f106a29a3218835b5d3b3a2b28633550","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            if EventsController.chk_ownership(event):"},{"line_number":268,"context_line":"                events.append(event_new)"},{"line_number":269,"context_line":"            else:"},{"line_number":270,"context_line":"                LOG.debug(_(\"User doesn\u0027t have access to event %s \")"},{"line_number":271,"context_line":"                          % event.message_id)"},{"line_number":272,"context_line":"        return events"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_5c5f6075","line":270,"updated":"2015-07-06 17:09:11.000000000","message":"use warn or info, debug probably isn\u0027t high enough priority","commit_id":"2d5315343aa97f92f76d9a3fb7e5a8f547d301a1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"b6b6375c4c97e0f2b124ba00a4ba52b4fbadec1e","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        # has access to this event based on the rule"},{"line_number":242,"context_line":"        # defined in the policy.json"},{"line_number":243,"context_line":"        target_dict \u003d dict()"},{"line_number":244,"context_line":"        for trait in event.traits:"},{"line_number":245,"context_line":"            d \u003d trait.as_dict()"},{"line_number":246,"context_line":"            if d[\u0027name\u0027] in [\u0027project_id\u0027, \u0027user_id\u0027]:"},{"line_number":247,"context_line":"                if d[\u0027value\u0027] is not None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_d6b227e5","line":244,"updated":"2015-07-07 12:31:20.000000000","message":"i\u0027m not sure we need to loop through all traits.. i think you can just check if traits.get(\u0027project_id\u0027) or traits.get(\u0027user_id\u0027)","commit_id":"49a8e351300ed433b669b2af0c3420da0d69c4e8"},{"author":{"_account_id":13637,"name":"Divya K Konoor","email":"dikonoor@in.ibm.com","username":"dikonoor"},"change_message_id":"02ff256333411152433ecbf345638c81eb06babb","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        # has access to this event based on the rule"},{"line_number":242,"context_line":"        # defined in the policy.json"},{"line_number":243,"context_line":"        target_dict \u003d dict()"},{"line_number":244,"context_line":"        for trait in event.traits:"},{"line_number":245,"context_line":"            d \u003d trait.as_dict()"},{"line_number":246,"context_line":"            if d[\u0027name\u0027] in [\u0027project_id\u0027, \u0027user_id\u0027]:"},{"line_number":247,"context_line":"                if d[\u0027value\u0027] is not None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_053ef027","line":244,"in_reply_to":"ba3cc151_d6b227e5","updated":"2015-07-08 05:05:11.000000000","message":"event.traits returns a list of Trait objects (and not a dict of Trait key value pairs).Thus event.traits.get(\u0027project_id\u0027) returns *** AttributeError: \u0027list\u0027 object has no attribute \u0027get\u0027","commit_id":"49a8e351300ed433b669b2af0c3420da0d69c4e8"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"4e2e6fb7d30c7e59bdb1b3d17a36c82b54dd661e","unresolved":false,"context_lines":[{"line_number":236,"context_line":"class EventsController(rest.RestController):"},{"line_number":237,"context_line":"    \"\"\"Works on Events.\"\"\""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def _check_ownership(self, event):"},{"line_number":240,"context_line":"        # Check if the user requesting this API call"},{"line_number":241,"context_line":"        # has access to this event based on the rule"},{"line_number":242,"context_line":"        # defined in the policy.json"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_d6b65ddb","line":239,"updated":"2015-07-08 16:24:13.000000000","message":"THis is going to be really expensive.  It makes more sense to check policy before performing the query.  Start with the most generic, and move to the most specific.    A simplified view would be:\nA) select all events\nB) select all events for a project\nC) select all events for a user in a project\n\nYou want to check policy that says a user has the right to execute that query, not on the results returned.\n\nPolicy should not be explicit to a user_id, rather, that is the default case where all other policy has failed.\n\nIt does mean that you need a way to be able to query by any field on which you want to enforce policy","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":13637,"name":"Divya K Konoor","email":"dikonoor@in.ibm.com","username":"dikonoor"},"change_message_id":"c0fe788dec605ed19b69d0044fe8e38c16dde181","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        # has access to this event based on the rule"},{"line_number":242,"context_line":"        # defined in the policy.json"},{"line_number":243,"context_line":"        target_dict \u003d dict()"},{"line_number":244,"context_line":"        for trait in event.traits:"},{"line_number":245,"context_line":"            d \u003d trait.as_dict()"},{"line_number":246,"context_line":"            if d[\u0027name\u0027] in [\u0027project_id\u0027, \u0027user_id\u0027]:"},{"line_number":247,"context_line":"                if d[\u0027value\u0027] is not None:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_ad460abe","line":244,"updated":"2015-07-08 06:37:43.000000000","message":"I have to loop through the traits as this is list of Trait objects and not a dict","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":1894,"name":"Ryota MIBU","email":"r-mibu@cq.jp.nec.com","username":"r-mibu"},"change_message_id":"c5c96acc13dc16100d496d7ac21ec7d5e06c7296","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        target_dict \u003d dict()"},{"line_number":244,"context_line":"        for trait in event.traits:"},{"line_number":245,"context_line":"            d \u003d trait.as_dict()"},{"line_number":246,"context_line":"            if d[\u0027name\u0027] in [\u0027project_id\u0027, \u0027user_id\u0027]:"},{"line_number":247,"context_line":"                if d[\u0027value\u0027] is not None:"},{"line_number":248,"context_line":"                    # To take care of values like"},{"line_number":249,"context_line":"                    # \u0027openstack:b01a2c00d9f9402cb795c76d721d70c9\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_10406933","line":246,"updated":"2015-07-08 09:53:30.000000000","message":"nit, you can use tuple \u0027()\u0027 instead of list \u0027[]\u0027, since contents are immutable.","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":13637,"name":"Divya K Konoor","email":"dikonoor@in.ibm.com","username":"dikonoor"},"change_message_id":"c0fe788dec605ed19b69d0044fe8e38c16dde181","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                        target_dict[d[\u0027name\u0027]] \u003d val[1]"},{"line_number":253,"context_line":"                    else:"},{"line_number":254,"context_line":"                        target_dict[d[\u0027name\u0027]] \u003d val[0]"},{"line_number":255,"context_line":"        return rbac.enforce(\u0027get_events\u0027, pecan.request, target_dict)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    @wsme_pecan.wsexpose([Event], [EventQuery])"},{"line_number":258,"context_line":"    def get_all(self, q\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_ad1daabf","line":255,"updated":"2015-07-08 06:37:43.000000000","message":"I have used \"get_events\" as the name that corresponds to events","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"f7ad0d5250e6b17a76fc38b4de21c1fa901550bd","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                        target_dict[d[\u0027name\u0027]] \u003d val[1]"},{"line_number":253,"context_line":"                    else:"},{"line_number":254,"context_line":"                        target_dict[d[\u0027name\u0027]] \u003d val[0]"},{"line_number":255,"context_line":"        return rbac.enforce(\u0027get_events\u0027, pecan.request, target_dict)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    @wsme_pecan.wsexpose([Event], [EventQuery])"},{"line_number":258,"context_line":"    def get_all(self, q\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_fbbcaf6d","line":255,"updated":"2015-07-08 15:27:35.000000000","message":"Why is this returning a value that\u0027s not used?","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"c8f75486ef747de0003dbac2621542fa57b7f7fd","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                        target_dict[d[\u0027name\u0027]] \u003d val[1]"},{"line_number":253,"context_line":"                    else:"},{"line_number":254,"context_line":"                        target_dict[d[\u0027name\u0027]] \u003d val[0]"},{"line_number":255,"context_line":"        return rbac.enforce(\u0027get_events\u0027, pecan.request, target_dict)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    @wsme_pecan.wsexpose([Event], [EventQuery])"},{"line_number":258,"context_line":"    def get_all(self, q\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_6bfb9fc1","line":255,"in_reply_to":"ba3cc151_ad1daabf","updated":"2015-07-09 22:00:05.000000000","message":"we should really have separate rules for get_one vs. get_all. To be consistent with keystone, nova, cinder, etc. get_one should use \u0027events:show\u0027 and get_all should use \u0027events:index\u0027","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"c8f75486ef747de0003dbac2621542fa57b7f7fd","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        :param q: Filter arguments for which Events to return"},{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        q \u003d q or []"},{"line_number":264,"context_line":"        event_filter \u003d _event_query_to_event_filter(q)"},{"line_number":265,"context_line":"        events \u003d []"},{"line_number":266,"context_line":"        for event in pecan.request.event_storage_conn.get_events(event_filter):"},{"line_number":267,"context_line":"            event_new \u003d Event(message_id\u003devent.message_id,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_2c5b6a23","line":264,"updated":"2015-07-09 22:00:05.000000000","message":"instead of _check_ownership after the fact, use the EventFilter here to filter out events the caller may not access","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":13637,"name":"Divya K Konoor","email":"dikonoor@in.ibm.com","username":"dikonoor"},"change_message_id":"c0fe788dec605ed19b69d0044fe8e38c16dde181","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                              traits\u003devent.traits,"},{"line_number":271,"context_line":"                              raw\u003devent.raw)"},{"line_number":272,"context_line":"            # Enforce policy-based rbac validation"},{"line_number":273,"context_line":"            try:"},{"line_number":274,"context_line":"                self._check_ownership(event)"},{"line_number":275,"context_line":"                events.append(event_new)"},{"line_number":276,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_ed2652cd","line":273,"updated":"2015-07-08 06:37:43.000000000","message":"I checked for rules like the following :\n\"user_id:%(user_id)s\"\n\"project_id:%(project_id)s\"\nrole:admin\n\"role:admin or user_id:%(user_id)s\"\n\n1.if you want only admin to be able to access events, rule would be:\nrole:admin\n2 if you want the events corresponding to a user to be returned and if that doesn\u0027t exist then you want admin to see all events, then the rule is:\n\"role:admin or user_id:%(user_id)s\"\n3. Return events owned by an admin user:\n\"role:admin and user_id:%(user_id)s\"\netc..","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"f7ad0d5250e6b17a76fc38b4de21c1fa901550bd","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                self._check_ownership(event)"},{"line_number":275,"context_line":"                events.append(event_new)"},{"line_number":276,"context_line":"            except Exception:"},{"line_number":277,"context_line":"                LOG.debug(_(\"User doesn\u0027t have access to event %s \")"},{"line_number":278,"context_line":"                          % event.message_id)"},{"line_number":279,"context_line":"        return events"},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_3bd8d71d","line":277,"updated":"2015-07-08 15:27:35.000000000","message":"Debug log messages should not be translated: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#log-translation\n\nAlso is this really a debug message? Wouldn\u0027t this be useful in production system do know if policy can\u0027t be enforced for a particular event?","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"f7ad0d5250e6b17a76fc38b4de21c1fa901550bd","unresolved":false,"context_lines":[{"line_number":275,"context_line":"                events.append(event_new)"},{"line_number":276,"context_line":"            except Exception:"},{"line_number":277,"context_line":"                LOG.debug(_(\"User doesn\u0027t have access to event %s \")"},{"line_number":278,"context_line":"                          % event.message_id)"},{"line_number":279,"context_line":"        return events"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"    @wsme_pecan.wsexpose(Event, wtypes.text)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_dbff6b64","line":278,"updated":"2015-07-08 15:27:35.000000000","message":"Don\u0027t use a % in a logging call, use a comma instead.","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"}],"ceilometer/api/rbac.py":[{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"2e2b41400842d6d4fd238c47403e282ed3765d53","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    return name in _ENFORCER.rules.keys()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def enforce(policy_name, request, target\u003d{}):"},{"line_number":33,"context_line":"    \"\"\"Return the user and project the request should be limited to."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    :param request: HTTP request"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_21cd2185","line":32,"updated":"2015-07-08 08:35:36.000000000","message":"Please, don\u0027t use the mutable default arguments in function signature, because Python’s default arguments are evaluated once when the function is defined, not each time the function is called. This means that if you use a mutable default argument and mutate it, you will and have mutated that object for all future calls to the function as well.\n\nNext code is useful in this case:\n\ndef enforce(policy_name, request, target\u003dNone):\ntarget \u003d target or None","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"f7ad0d5250e6b17a76fc38b4de21c1fa901550bd","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    return name in _ENFORCER.rules.keys()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def enforce(policy_name, request, target\u003d{}):"},{"line_number":33,"context_line":"    \"\"\"Return the user and project the request should be limited to."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    :param request: HTTP request"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_3ba77751","line":32,"in_reply_to":"ba3cc151_21cd2185","updated":"2015-07-08 15:27:35.000000000","message":"++ this can be really bad if used incorrectly","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"1dec6cb59c819cd46210d3a51a4af59cd54c6dc2","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    return name in _ENFORCER.rules.keys()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def enforce(policy_name, request, target\u003d{}):"},{"line_number":33,"context_line":"    \"\"\"Return the user and project the request should be limited to."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    :param request: HTTP request"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_15d92257","line":32,"in_reply_to":"ba3cc151_21cd2185","updated":"2015-07-08 16:03:06.000000000","message":"def enforce(policy_name, request, target\u003dNone):\n    target \u003d target or {}","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"c8f75486ef747de0003dbac2621542fa57b7f7fd","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    rule_method \u003d \"telemetry:\" + policy_name"},{"line_number":46,"context_line":"    headers \u003d request.headers"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    policy_dict \u003d dict()"},{"line_number":49,"context_line":"    policy_dict[\u0027roles\u0027] \u003d headers.get(\u0027X-Roles\u0027, \"\").split(\",\")"},{"line_number":50,"context_line":"    # Changing target.user_id to user_id because former doesn\u0027t"},{"line_number":51,"context_line":"    # work with oslo_policy on request credentials"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_4b16db49","line":48,"updated":"2015-07-09 22:00:05.000000000","message":"policy_dict is such a bad name for this... can we change it to \"creds\" to match what it really is (and what oslo_policy calls it)?","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"10a3124eb83387aaa92326d7ab7387d7c5fa437e","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    rule_method \u003d \"telemetry:\" + policy_name"},{"line_number":46,"context_line":"    headers \u003d request.headers"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    policy_dict \u003d dict()"},{"line_number":49,"context_line":"    policy_dict[\u0027roles\u0027] \u003d headers.get(\u0027X-Roles\u0027, \"\").split(\",\")"},{"line_number":50,"context_line":"    # Changing target.user_id to user_id because former doesn\u0027t"},{"line_number":51,"context_line":"    # work with oslo_policy on request credentials"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a4dcd0f_b445f643","line":48,"in_reply_to":"ba3cc151_4b16db49","updated":"2015-08-11 14:12:08.000000000","message":"For dict you could just use:\npolicy_dict \u003d {}","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"1dec6cb59c819cd46210d3a51a4af59cd54c6dc2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"# TODO(fabiog): these methods are still used because the scoping part is really"},{"line_number":63,"context_line":"# convoluted and difficult to separate out."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def get_limited_to(headers):"},{"line_number":66,"context_line":"    \"\"\"Return the user and project the request should be limited to."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    :param headers: HTTP headers dictionary"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_d32c2f4c","line":65,"updated":"2015-07-08 16:03:06.000000000","message":"can you try using this? this seems to return user/project values.\n\nfrom that you can pass that into query as filter param.","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"c8f75486ef747de0003dbac2621542fa57b7f7fd","unresolved":false,"context_lines":[{"line_number":62,"context_line":"# TODO(fabiog): these methods are still used because the scoping part is really"},{"line_number":63,"context_line":"# convoluted and difficult to separate out."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def get_limited_to(headers):"},{"line_number":66,"context_line":"    \"\"\"Return the user and project the request should be limited to."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    :param headers: HTTP headers dictionary"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_d0a5b602","line":65,"in_reply_to":"ba3cc151_d32c2f4c","updated":"2015-07-09 22:00:05.000000000","message":"This method remains for backward compat purposes only, and should not be used for anything new. It is a remnant from the days of hardcoding policy rules rather than relying on policy.json.","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"c8f75486ef747de0003dbac2621542fa57b7f7fd","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    policy_dict \u003d dict()"},{"line_number":79,"context_line":"    policy_dict[\u0027roles\u0027] \u003d headers.get(\u0027X-Roles\u0027, \"\").split(\",\")"},{"line_number":80,"context_line":"    policy_dict[\u0027target.user_id\u0027] \u003d (headers.get(\u0027X-User-Id\u0027))"},{"line_number":81,"context_line":"    policy_dict[\u0027target.project_id\u0027] \u003d (headers.get(\u0027X-Project-Id\u0027))"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    # maintain backward compat with Juno and previous by using context_is_admin"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_f019da88","line":80,"updated":"2015-07-09 22:00:05.000000000","message":"shouldn\u0027t the policy_dict here be consistent with the one in the enforce() method?","commit_id":"303bd00b2f98d192f9b5c7fe53a88484cbfd3f0b"}],"etc/ceilometer/event_definitions.yaml":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"8f912692f106a29a3218835b5d3b3a2b28633550","unresolved":false,"context_lines":[{"line_number":332,"context_line":"- event_type: \u0027*http.*\u0027"},{"line_number":333,"context_line":"  traits: \u0026http_audit"},{"line_number":334,"context_line":"    project_id:"},{"line_number":335,"context_line":"      fields: payload.project_id"},{"line_number":336,"context_line":"    user_id:"},{"line_number":337,"context_line":"      fields: payload.user_id"},{"line_number":338,"context_line":"    typeURI:"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"ba3cc151_83256a5d","line":335,"updated":"2015-07-06 17:09:11.000000000","message":"payload.initiator.project_id","commit_id":"2d5315343aa97f92f76d9a3fb7e5a8f547d301a1"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"8f912692f106a29a3218835b5d3b3a2b28633550","unresolved":false,"context_lines":[{"line_number":334,"context_line":"    project_id:"},{"line_number":335,"context_line":"      fields: payload.project_id"},{"line_number":336,"context_line":"    user_id:"},{"line_number":337,"context_line":"      fields: payload.user_id"},{"line_number":338,"context_line":"    typeURI:"},{"line_number":339,"context_line":"      fields: payload.typeURI"},{"line_number":340,"context_line":"    eventType:"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"ba3cc151_4320c249","line":337,"updated":"2015-07-06 17:09:11.000000000","message":"payload.initiator.id","commit_id":"2d5315343aa97f92f76d9a3fb7e5a8f547d301a1"}]}
