)]}'
{"keystone/catalog/core.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"2e05f01acb99e199864a362ce715ab2e7cda4bcf","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        for endpoint in endpoints:"},{"line_number":344,"context_line":"            is_candidate \u003d True"},{"line_number":345,"context_line":"            for key, value in filters.items():"},{"line_number":346,"context_line":"                if endpoint[key] !\u003d value:"},{"line_number":347,"context_line":"                    is_candidate \u003d False"},{"line_number":348,"context_line":"                    break"},{"line_number":349,"context_line":"            if is_candidate:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_f8b440d5","line":346,"updated":"2015-11-30 15:32:19.000000000","message":"Won\u0027t this always be false? The `endpoint` is a reference, correct?","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"3b00729ddbf7cda5fb2c79592a06e4c8beb50069","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        for endpoint in endpoints:"},{"line_number":344,"context_line":"            is_candidate \u003d True"},{"line_number":345,"context_line":"            for key, value in filters.items():"},{"line_number":346,"context_line":"                if endpoint[key] !\u003d value:"},{"line_number":347,"context_line":"                    is_candidate \u003d False"},{"line_number":348,"context_line":"                    break"},{"line_number":349,"context_line":"            if is_candidate:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_547d03e6","line":346,"in_reply_to":"9a8ffd7b_f8b440d5","updated":"2015-12-03 03:07:13.000000000","message":"Lance - I don\u0027t think so, the endpoint here is a dict and we should compare the \u0027key\u0027 in the endpoint with the one defined in filter.\n\n -\u003e if endpoint[key] !\u003d value:\n (Pdb) p endpoint\n {\u0027region_id\u0027: u\u002766eac4debc484612bdf29d674b7e9be8\u0027, \u0027url\u0027:    u\u0027https://ebcef791e1af4bb8a3512adbfedf49cb.com\u0027, u\u0027description\u0027: u\u002711fe57179eeb4b23bb7dcb046b0e7726\u0027, \u0027enabled\u0027: True, \u0027legacy_endpoint_id\u0027: None, \u0027interface\u0027: u\u0027public\u0027, \u0027service_id\u0027: u\u00275f115484e2484e56ad64c354871f82af\u0027, \u0027id\u0027: u\u0027559a671d117e4765bfd1b9b501a4a96b\u0027, u\u0027name\u0027: u\u002789fdcb59b7e443eabc4513490b332fce\u0027}\n (Pdb) p value\n u\u002751ae5b561fa5475b816adf255d0239e4\u0027\n (Pdb) p key\n u\u0027service_id\u0027\n\n (Pdb) endpoint[key]\n u\u00275f115484e2484e56ad64c354871f82af\u0027\n (Pdb) endpoint[key] !\u003d value\n True\n\n\nBasically, these code was copied from here: https://github.com/openstack/keystone/blob/master/keystone/catalog/controllers.py#L391, \n\nCopy them here and not removed them from controller layer since they are also referenced by other API.\n\nHope it\u0027s clear.","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"2e05f01acb99e199864a362ce715ab2e7cda4bcf","unresolved":false,"context_lines":[{"line_number":353,"context_line":"    def list_endpoints_for_project(self, project_id):"},{"line_number":354,"context_line":"        \"\"\"List all endpoints associated with a project."},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"        :param project_id: identity of the project to check"},{"line_number":357,"context_line":"        :type project_id: string"},{"line_number":358,"context_line":"        :returns: a list of identity endpoint ids or an empty list."},{"line_number":359,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_2492a8f7","line":356,"updated":"2015-11-30 15:32:19.000000000","message":"nit: project identifier","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"3b00729ddbf7cda5fb2c79592a06e4c8beb50069","unresolved":false,"context_lines":[{"line_number":353,"context_line":"    def list_endpoints_for_project(self, project_id):"},{"line_number":354,"context_line":"        \"\"\"List all endpoints associated with a project."},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"        :param project_id: identity of the project to check"},{"line_number":357,"context_line":"        :type project_id: string"},{"line_number":358,"context_line":"        :returns: a list of identity endpoint ids or an empty list."},{"line_number":359,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_720c9294","line":356,"in_reply_to":"9a8ffd7b_2492a8f7","updated":"2015-12-03 03:07:13.000000000","message":"Done","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"2e05f01acb99e199864a362ce715ab2e7cda4bcf","unresolved":false,"context_lines":[{"line_number":355,"context_line":""},{"line_number":356,"context_line":"        :param project_id: identity of the project to check"},{"line_number":357,"context_line":"        :type project_id: string"},{"line_number":358,"context_line":"        :returns: a list of identity endpoint ids or an empty list."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        \"\"\""},{"line_number":361,"context_line":"        refs \u003d self.driver.list_endpoints_for_project(project_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_c4b95c7b","line":358,"updated":"2015-11-30 15:32:19.000000000","message":"nit: identifiers*","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"3b00729ddbf7cda5fb2c79592a06e4c8beb50069","unresolved":false,"context_lines":[{"line_number":355,"context_line":""},{"line_number":356,"context_line":"        :param project_id: identity of the project to check"},{"line_number":357,"context_line":"        :type project_id: string"},{"line_number":358,"context_line":"        :returns: a list of identity endpoint ids or an empty list."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        \"\"\""},{"line_number":361,"context_line":"        refs \u003d self.driver.list_endpoints_for_project(project_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_326e0a30","line":358,"in_reply_to":"9a8ffd7b_c4b95c7b","updated":"2015-12-03 03:07:13.000000000","message":"Done","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"3b00729ddbf7cda5fb2c79592a06e4c8beb50069","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        refs \u003d self.driver.list_endpoints_for_project(project_id)"},{"line_number":362,"context_line":"        filtered_endpoints \u003d {ref[\u0027endpoint_id\u0027]:"},{"line_number":363,"context_line":"                              self.get_endpoint(ref[\u0027endpoint_id\u0027])"},{"line_number":364,"context_line":"                              for ref in refs}"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        # need to recover endpoint_groups associated with project"},{"line_number":367,"context_line":"        # then for each endpoint group return the endpoints."}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_551a5870","line":364,"updated":"2015-12-03 03:07:13.000000000","message":"should check the existence of endpoints?\n\n  for ref in refs:\n      try:\n          endpoint \u003d self.get_endpoint(ref[\u0027endpoint_id\u0027])\n          ref[\u0027endpoint_id\u0027] \u003d endpoint\n      except exception.EndpointNotFound:\n          self.catalog_api.remove_endpoint_from_project(entry[\u0027endpoint_id\u0027], project_id)","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"5aec984c988f5546aa5a24d190525f492f9a318d","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        except exception.EndpointGroupNotFound:"},{"line_number":336,"context_line":"            return []"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _get_endpoints_filtered_by_endpoint_group(self, endpoint_group_id):"},{"line_number":339,"context_line":"        endpoints \u003d self.list_endpoints()"},{"line_number":340,"context_line":"        filters \u003d self.driver.get_endpoint_group(endpoint_group_id)[\u0027filters\u0027]"},{"line_number":341,"context_line":"        filtered_endpoints \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_5bbac56f","line":338,"updated":"2015-12-07 06:10:57.000000000","message":"hmm, but now we have this duplicated here and in controllers.py","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"c2b9cbd367309f8d54c26c9cab498e0c36dc870e","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        except exception.EndpointGroupNotFound:"},{"line_number":336,"context_line":"            return []"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _get_endpoints_filtered_by_endpoint_group(self, endpoint_group_id):"},{"line_number":339,"context_line":"        endpoints \u003d self.list_endpoints()"},{"line_number":340,"context_line":"        filters \u003d self.driver.get_endpoint_group(endpoint_group_id)[\u0027filters\u0027]"},{"line_number":341,"context_line":"        filtered_endpoints \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_d697c638","line":338,"in_reply_to":"7a740942_14d15123","updated":"2015-12-09 17:35:21.000000000","message":"would the other api in the controller be able to use this implementation instead?","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"fdf9d1e7df2e709b8100693e0ebb3fd9e138043c","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        except exception.EndpointGroupNotFound:"},{"line_number":336,"context_line":"            return []"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _get_endpoints_filtered_by_endpoint_group(self, endpoint_group_id):"},{"line_number":339,"context_line":"        endpoints \u003d self.list_endpoints()"},{"line_number":340,"context_line":"        filters \u003d self.driver.get_endpoint_group(endpoint_group_id)[\u0027filters\u0027]"},{"line_number":341,"context_line":"        filtered_endpoints \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_14d15123","line":338,"in_reply_to":"7a740942_5bbac56f","updated":"2015-12-07 15:36:45.000000000","message":"yes, I don\u0027t like the duplication too, but the method is defined as the private method in the controller and referenced by other API in the controller.","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"97470858d049dcdfe2c52e5effd90a8cc3fb1097","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        except exception.EndpointGroupNotFound:"},{"line_number":336,"context_line":"            return []"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _get_endpoints_filtered_by_endpoint_group(self, endpoint_group_id):"},{"line_number":339,"context_line":"        endpoints \u003d self.list_endpoints()"},{"line_number":340,"context_line":"        filters \u003d self.driver.get_endpoint_group(endpoint_group_id)[\u0027filters\u0027]"},{"line_number":341,"context_line":"        filtered_endpoints \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_764a92ae","line":338,"in_reply_to":"7a740942_d697c638","updated":"2015-12-09 17:42:40.000000000","message":"looks like this is done by https://review.openstack.org/#/c/255070/1","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"5aec984c988f5546aa5a24d190525f492f9a318d","unresolved":false,"context_lines":[{"line_number":365,"context_line":"                endpoint \u003d self.get_endpoint(ref[\u0027endpoint_id\u0027])"},{"line_number":366,"context_line":"                filtered_endpoints.update({ref[\u0027endpoint_id\u0027]: endpoint})"},{"line_number":367,"context_line":"            except exception.EndpointNotFound:"},{"line_number":368,"context_line":"                # remove bad reference from association"},{"line_number":369,"context_line":"                self.remove_endpoint_from_project(ref[\u0027endpoint_id\u0027],"},{"line_number":370,"context_line":"                                                  project_id)"},{"line_number":371,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_1bff5d35","line":368,"updated":"2015-12-07 06:10:57.000000000","message":"nice handling here","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"fdf9d1e7df2e709b8100693e0ebb3fd9e138043c","unresolved":false,"context_lines":[{"line_number":365,"context_line":"                endpoint \u003d self.get_endpoint(ref[\u0027endpoint_id\u0027])"},{"line_number":366,"context_line":"                filtered_endpoints.update({ref[\u0027endpoint_id\u0027]: endpoint})"},{"line_number":367,"context_line":"            except exception.EndpointNotFound:"},{"line_number":368,"context_line":"                # remove bad reference from association"},{"line_number":369,"context_line":"                self.remove_endpoint_from_project(ref[\u0027endpoint_id\u0027],"},{"line_number":370,"context_line":"                                                  project_id)"},{"line_number":371,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_7438d53d","line":368,"in_reply_to":"7a740942_1bff5d35","updated":"2015-12-07 15:36:45.000000000","message":"this logic is moved from `catalog_sql.py`, i will check whether there was testcases somewhere and possibly add a testcase in the follow up if this was not tested.","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"5aec984c988f5546aa5a24d190525f492f9a318d","unresolved":false,"context_lines":[{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        # need to recover endpoint_groups associated with project"},{"line_number":373,"context_line":"        # then for each endpoint group return the endpoints."},{"line_number":374,"context_line":"        endpoint_groups \u003d self._get_endpoint_groups_for_project(project_id)"},{"line_number":375,"context_line":"        for endpoint_group in endpoint_groups:"},{"line_number":376,"context_line":"            endpoint_refs \u003d self._get_endpoints_filtered_by_endpoint_group("},{"line_number":377,"context_line":"                endpoint_group[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_5b7165df","line":374,"updated":"2015-12-07 06:10:57.000000000","message":"no way to call the controller here? or have the controller call these new functions?","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"fdf9d1e7df2e709b8100693e0ebb3fd9e138043c","unresolved":false,"context_lines":[{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        # need to recover endpoint_groups associated with project"},{"line_number":373,"context_line":"        # then for each endpoint group return the endpoints."},{"line_number":374,"context_line":"        endpoint_groups \u003d self._get_endpoint_groups_for_project(project_id)"},{"line_number":375,"context_line":"        for endpoint_group in endpoint_groups:"},{"line_number":376,"context_line":"            endpoint_refs \u003d self._get_endpoints_filtered_by_endpoint_group("},{"line_number":377,"context_line":"                endpoint_group[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_74a2154d","line":374,"in_reply_to":"7a740942_5b7165df","updated":"2015-12-07 15:36:45.000000000","message":"I think the controller cannot call these functions since `endpoint_filter.sql` backend need these in the API layer rather than controller layer.\n\nI am also not quite sure API layer could call the the private method from the controller layer.","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"97470858d049dcdfe2c52e5effd90a8cc3fb1097","unresolved":false,"context_lines":[{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        # need to recover endpoint_groups associated with project"},{"line_number":373,"context_line":"        # then for each endpoint group return the endpoints."},{"line_number":374,"context_line":"        endpoint_groups \u003d self._get_endpoint_groups_for_project(project_id)"},{"line_number":375,"context_line":"        for endpoint_group in endpoint_groups:"},{"line_number":376,"context_line":"            endpoint_refs \u003d self._get_endpoints_filtered_by_endpoint_group("},{"line_number":377,"context_line":"                endpoint_group[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_56e436ab","line":374,"in_reply_to":"7a740942_74a2154d","updated":"2015-12-09 17:42:40.000000000","message":"looks like this is done by - https://review.openstack.org/#/c/255070/1","commit_id":"f86448a3113fc594e78d3d9410f44c1f64a9ad58"}],"keystone/contrib/endpoint_filter/backends/catalog_sql.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"2e05f01acb99e199864a362ce715ab2e7cda4bcf","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        services \u003d {}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"        refs \u003d self.catalog_api.list_endpoints_for_project(project_id)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        if (not refs and"},{"line_number":37,"context_line":"                CONF.endpoint_filter.return_all_endpoints_if_no_filter):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_db7056df","line":34,"updated":"2015-11-30 15:32:19.000000000","message":"This seems a little confusing, only because it\u0027s named `refs` but it\u0027s traversed like a list. It\u0027s actually a dictionary of dictionaries (http://cdn.pasteraw.com/7rrl9jgw9zy5xg6ywpv70dr78obmhya). \n\nWe might be able to improve the name a bit: \n\n    # this is actually a dictionary where the key is the endpoint identifier and\n    # the value is the endpoint reference.\n    dict_of_endpoint_refs \u003d self.catalog_api.list_endpoints_for_project(project_id)","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"3b00729ddbf7cda5fb2c79592a06e4c8beb50069","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        services \u003d {}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"        refs \u003d self.catalog_api.list_endpoints_for_project(project_id)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        if (not refs and"},{"line_number":37,"context_line":"                CONF.endpoint_filter.return_all_endpoints_if_no_filter):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_362230a4","line":34,"in_reply_to":"9a8ffd7b_db7056df","updated":"2015-12-03 03:07:13.000000000","message":"Done","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"2e05f01acb99e199864a362ce715ab2e7cda4bcf","unresolved":false,"context_lines":[{"line_number":38,"context_line":"            return super(EndpointFilterCatalog, self).get_v3_catalog("},{"line_number":39,"context_line":"                user_id, project_id)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        for endpoint_id in refs:"},{"line_number":42,"context_line":"            try:"},{"line_number":43,"context_line":"                endpoint \u003d refs[endpoint_id]"},{"line_number":44,"context_line":"                if not endpoint[\u0027enabled\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_18990420","line":41,"updated":"2015-11-30 15:32:19.000000000","message":"Since we aren\u0027t actually calling self.get_catalog anymore, I don\u0027t think we need the try/except.\n\n    for endpoint_id, endpoint in dict_of_endpoint_refs.items():\n        if not endpoint[\u0027enabled\u0027]:\n            # Skip disabled endpoints\n            continue\n        ...\n\n\n++ to not going back to the DB unless we have to!","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"3b00729ddbf7cda5fb2c79592a06e4c8beb50069","unresolved":false,"context_lines":[{"line_number":38,"context_line":"            return super(EndpointFilterCatalog, self).get_v3_catalog("},{"line_number":39,"context_line":"                user_id, project_id)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        for endpoint_id in refs:"},{"line_number":42,"context_line":"            try:"},{"line_number":43,"context_line":"                endpoint \u003d refs[endpoint_id]"},{"line_number":44,"context_line":"                if not endpoint[\u0027enabled\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_96319cef","line":41,"in_reply_to":"9a8ffd7b_18990420","updated":"2015-12-03 03:07:13.000000000","message":"Good catch!","commit_id":"876516f668ab281f710521ccf5efa00368ab5694"}]}
