)]}'
{"keystone/auth/plugins/mapped.py":[{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"ef2a2a0d8fb5e9d9b2b3a8163c08b3387dee8ba8","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        return resp"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    assertion \u003d extract_assertion_data(request)"},{"line_number":205,"context_line":"    identity_provider \u003d auth_payload.get(\u0027identity_provider\u0027)"},{"line_number":206,"context_line":"    protocol \u003d auth_payload.get(\u0027protocol\u0027)"},{"line_number":207,"context_line":"    if not identity_provider or not protocol:"},{"line_number":208,"context_line":"        raise exception.ValidationError("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_d450a834","line":205,"updated":"2017-11-07 03:09:12.000000000","message":"In other places, we tend to favor catching the key error and keeping the different calls separate.  I\u0027d suggest you do that here.  It will be slightly longer code, but clearer, and you can tell the user which of the values is missing.  Ideally, you would catch all of the missing values and tell them explicitly, but I don\u0027t think our exception mechanism handles that well.\n\nraise exception.ValidationError(\n            attribute\u003d\u0027identity_provider or protocol\u0027, target\u003d\u0027mapped\u0027)  is invalid as you have an embedded \"or\" in there which will mess up the translation.  So the best you can get is:\n\ntry:\n   identity_provider \u003d auth_payload[\u0027identity_provider\u0027]\n\nexcept KeyError:\n           raise exception.ValidationError(\n            attribute\u003d\u0027identity_provider\u0027, target\u003d\u0027mapped\u0027)\n\n\nAnd the same for protocol.  I think there are other attributes that Federation requires, and you should make sure they are all handled consistently.","commit_id":"bcef602b6c72d0992408e5de7756a52fd7de0af6"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"ee35236473bd5e70ce8ea91ef57bf399f589c08e","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        return resp"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    assertion \u003d extract_assertion_data(request)"},{"line_number":205,"context_line":"    identity_provider \u003d auth_payload.get(\u0027identity_provider\u0027)"},{"line_number":206,"context_line":"    protocol \u003d auth_payload.get(\u0027protocol\u0027)"},{"line_number":207,"context_line":"    if not identity_provider or not protocol:"},{"line_number":208,"context_line":"        raise exception.ValidationError("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_837adfed","line":205,"in_reply_to":"3f4b6375_d450a834","updated":"2017-11-08 07:23:04.000000000","message":"Done","commit_id":"bcef602b6c72d0992408e5de7756a52fd7de0af6"}],"keystone/tests/unit/test_auth_plugin.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ace0fb2b0ec39863c88899907080b1d95dba692a","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def test_mapped_without_identity_provider_or_protocol(self):"},{"line_number":194,"context_line":"        test_mapped \u003d mapped.Mapped()"},{"line_number":195,"context_line":"        test_mapped.resource_api \u003d mock.Mock()"},{"line_number":196,"context_line":"        test_mapped.federation_api \u003d mock.Mock()"},{"line_number":197,"context_line":"        test_mapped.identity_api \u003d mock.Mock()"},{"line_number":198,"context_line":"        test_mapped.assignment_api \u003d mock.Mock()"},{"line_number":199,"context_line":"        test_mapped.role_api \u003d mock.Mock()"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        request \u003d self.make_request()"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff82abbf_a9400c37","line":199,"range":{"start_line":195,"start_character":0,"end_line":199,"end_character":42},"updated":"2017-11-21 20:51:20.000000000","message":"Instead of mocking all these APIs, we should have a functional test that exposes the issue. That also makes it easier to ensure a 500 was being raised before and now a 400 is being returned.","commit_id":"503882cb8c251cc948d50d07083666df439bf215"}]}
