)]}'
{"barbican/common/validators.py":[{"author":{"_account_id":16046,"name":"Fernando Diaz","email":"diazjf@us.ibm.com","username":"diazjf"},"change_message_id":"8ad59eafb209c07059180c86150f94fa8cd340b8","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                    \"items\": {"},{"line_number":795,"context_line":"                        \"type\": \"object\","},{"line_number":796,"context_line":"                        \"required\": [\"secret_ref\"],"},{"line_number":797,"context_line":"                        \"properties\": {"},{"line_number":798,"context_line":"                            \"name\": {"},{"line_number":799,"context_line":"                                \"type\": [\"string\", \"null\"], \"maxLength\": 255"},{"line_number":800,"context_line":"                            },"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_7fd7f6ed","line":797,"updated":"2016-05-05 16:12:35.000000000","message":"\"additionalProperties\": False. Only name and secret_ref should be accepted. Not needed in this patch, but we should consider it in another.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"c12452b0a21a5f7c26386d975631914e250cef8f","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                    \"items\": {"},{"line_number":795,"context_line":"                        \"type\": \"object\","},{"line_number":796,"context_line":"                        \"required\": [\"secret_ref\"],"},{"line_number":797,"context_line":"                        \"properties\": {"},{"line_number":798,"context_line":"                            \"name\": {"},{"line_number":799,"context_line":"                                \"type\": [\"string\", \"null\"], \"maxLength\": 255"},{"line_number":800,"context_line":"                            },"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_f9a5e1b4","line":797,"in_reply_to":"1a122d0e_7fd7f6ed","updated":"2016-05-05 17:05:10.000000000","message":"I think, that\u0027s a common concern around many validation. Generally its open question whether we want to report error for some unrecognized data fields or allow them to pass if payload contains otherwise recognized/valid values.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"e735bd6ff4c9861564ef9a49a0cc5853e5056c4a","unresolved":false,"context_lines":[{"line_number":842,"context_line":"        # spoofing allowed!"},{"line_number":843,"context_line":"        req_host_href \u003d utils.get_base_url_from_request()"},{"line_number":844,"context_line":"        for secret_ref in secret_refs:"},{"line_number":845,"context_line":"            if not secret_ref.get(\u0027secret_ref\u0027).startswith(req_host_href):"},{"line_number":846,"context_line":"                raise exception.UnsupportedField("},{"line_number":847,"context_line":"                    field\u003d\u0027secret_ref\u0027,"},{"line_number":848,"context_line":"                    schema\u003dschema_name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_0b143a42","line":845,"range":{"start_line":845,"start_character":19,"end_line":845,"end_character":73},"updated":"2016-04-18 06:30:20.000000000","message":"why not use urlparse first for both the req_host_href and the secret_ref paramter and then compare those? It\u0027s more verbose but probably more secure.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"f278484ab9dda2019d68632054983bc1ef9bc841","unresolved":false,"context_lines":[{"line_number":842,"context_line":"        # spoofing allowed!"},{"line_number":843,"context_line":"        req_host_href \u003d utils.get_base_url_from_request()"},{"line_number":844,"context_line":"        for secret_ref in secret_refs:"},{"line_number":845,"context_line":"            if not secret_ref.get(\u0027secret_ref\u0027).startswith(req_host_href):"},{"line_number":846,"context_line":"                raise exception.UnsupportedField("},{"line_number":847,"context_line":"                    field\u003d\u0027secret_ref\u0027,"},{"line_number":848,"context_line":"                    schema\u003dschema_name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_8c4a04ab","line":845,"range":{"start_line":845,"start_character":19,"end_line":845,"end_character":73},"in_reply_to":"1a122d0e_0b143a42","updated":"2016-04-18 16:15:20.000000000","message":"Existing validation intention is to make sure that client provided secret_href has a barbican hostname.\n\nreq_host_href is already a parsed/validated hostname if its coming from wsgi request or a valid value if read from CONF.host_href.\n\nFrom that perspective, startsWith check ensure that input href has the expected validated hostname or not? \n\nParsing input ref is additional validation check to make sure that provided input is indeed in a valid URL format. That validation check will likely have different error.\n\nSo it can added here if preferred or can be done as a separate change as that\u0027s not the purpose of original bug.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":16046,"name":"Fernando Diaz","email":"diazjf@us.ibm.com","username":"diazjf"},"change_message_id":"8ad59eafb209c07059180c86150f94fa8cd340b8","unresolved":false,"context_lines":[{"line_number":842,"context_line":"        # spoofing allowed!"},{"line_number":843,"context_line":"        req_host_href \u003d utils.get_base_url_from_request()"},{"line_number":844,"context_line":"        for secret_ref in secret_refs:"},{"line_number":845,"context_line":"            if not secret_ref.get(\u0027secret_ref\u0027).startswith(req_host_href):"},{"line_number":846,"context_line":"                raise exception.UnsupportedField("},{"line_number":847,"context_line":"                    field\u003d\u0027secret_ref\u0027,"},{"line_number":848,"context_line":"                    schema\u003dschema_name,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_fff94683","line":845,"range":{"start_line":845,"start_character":19,"end_line":845,"end_character":73},"in_reply_to":"1a122d0e_8c4a04ab","updated":"2016-05-05 16:12:35.000000000","message":"This works for me.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"}],"barbican/tests/common/test_validators.py":[{"author":{"_account_id":16046,"name":"Fernando Diaz","email":"diazjf@us.ibm.com","username":"diazjf"},"change_message_id":"8ad59eafb209c07059180c86150f94fa8cd340b8","unresolved":false,"context_lines":[{"line_number":833,"context_line":"            container_req,"},{"line_number":834,"context_line":"        )"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    def test_ensure_secret_ref_startsWith_request_hostname(self):"},{"line_number":837,"context_line":"        # Attempt to add some bogus secret refs."},{"line_number":838,"context_line":"        secret_refs \u003d ["},{"line_number":839,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_ffc5c68f","line":836,"range":{"start_line":836,"start_character":31,"end_line":836,"end_character":41},"updated":"2016-05-05 16:12:35.000000000","message":"change to \"starts_with\"","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"c12452b0a21a5f7c26386d975631914e250cef8f","unresolved":false,"context_lines":[{"line_number":833,"context_line":"            container_req,"},{"line_number":834,"context_line":"        )"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    def test_ensure_secret_ref_startsWith_request_hostname(self):"},{"line_number":837,"context_line":"        # Attempt to add some bogus secret refs."},{"line_number":838,"context_line":"        secret_refs \u003d ["},{"line_number":839,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_593df58c","line":836,"range":{"start_line":836,"start_character":31,"end_line":836,"end_character":41},"in_reply_to":"1a122d0e_ffc5c68f","updated":"2016-05-05 17:05:10.000000000","message":"Okay.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":16046,"name":"Fernando Diaz","email":"diazjf@us.ibm.com","username":"diazjf"},"change_message_id":"8ad59eafb209c07059180c86150f94fa8cd340b8","unresolved":false,"context_lines":[{"line_number":839,"context_line":"            {"},{"line_number":840,"context_line":"                \u0027name\u0027: \u0027pass_malicious_hostname\u0027,"},{"line_number":841,"context_line":"                \u0027secret_ref\u0027: \u0027http://www.malicious.com:8080/spoofForToken?\u0027"},{"line_number":842,"context_line":"                \u0027?dummy\u003dhttp://localhost:9311\u0027"},{"line_number":843,"context_line":"            },"},{"line_number":844,"context_line":"        ]"},{"line_number":845,"context_line":"        container_req \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_5ffcbab4","line":842,"range":{"start_line":842,"start_character":16,"end_line":842,"end_character":46},"updated":"2016-05-05 16:12:35.000000000","message":"what is the purpose of this block? secret_ref.get(\u0027secret_ref\u0027) will only read secret_ref.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"c12452b0a21a5f7c26386d975631914e250cef8f","unresolved":false,"context_lines":[{"line_number":839,"context_line":"            {"},{"line_number":840,"context_line":"                \u0027name\u0027: \u0027pass_malicious_hostname\u0027,"},{"line_number":841,"context_line":"                \u0027secret_ref\u0027: \u0027http://www.malicious.com:8080/spoofForToken?\u0027"},{"line_number":842,"context_line":"                \u0027?dummy\u003dhttp://localhost:9311\u0027"},{"line_number":843,"context_line":"            },"},{"line_number":844,"context_line":"        ]"},{"line_number":845,"context_line":"        container_req \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_b9b7e91f","line":842,"range":{"start_line":842,"start_character":16,"end_line":842,"end_character":46},"in_reply_to":"1a122d0e_5ffcbab4","updated":"2016-05-05 17:05:10.000000000","message":"Its the continuation of previous line. \n\nThe bug is that earlier we were just looking for presence of expected hostname anywhere in secret_ref value. And in that case, the earlier validation used to pass. Now with this change, it should fail as secret_ref value is not starting with expected hostname.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"},{"author":{"_account_id":16046,"name":"Fernando Diaz","email":"diazjf@us.ibm.com","username":"diazjf"},"change_message_id":"90423f60b90cbb74e38622504365fbf0622c25da","unresolved":false,"context_lines":[{"line_number":839,"context_line":"            {"},{"line_number":840,"context_line":"                \u0027name\u0027: \u0027pass_malicious_hostname\u0027,"},{"line_number":841,"context_line":"                \u0027secret_ref\u0027: \u0027http://www.malicious.com:8080/spoofForToken?\u0027"},{"line_number":842,"context_line":"                \u0027?dummy\u003dhttp://localhost:9311\u0027"},{"line_number":843,"context_line":"            },"},{"line_number":844,"context_line":"        ]"},{"line_number":845,"context_line":"        container_req \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_c88c8d82","line":842,"range":{"start_line":842,"start_character":16,"end_line":842,"end_character":46},"in_reply_to":"1a122d0e_b9b7e91f","updated":"2016-05-05 19:01:45.000000000","message":"whoops. I just realized that \"dummy\" is not a key. Thanks for clarifying.","commit_id":"700adf06b1a8641b79d11171d599b33c42c7ad80"}]}
