)]}'
{"barbican/api/controllers/versions.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"ec7e963c603a13737dfba745bd2125fd5352bef3","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_46bbeac4","line":48,"updated":"2016-03-11 23:25:21.000000000","message":"So I think this relies on someone doing the following in the config file:\n\n    [DEFAULT]\n    host_href \u003d\n    # rest of config\n\nWhich means that simply omitting host_href is not enough, they need to explicitly set it to nothing (because the default is http://localhost:9311 (unless this patch also changes that)).\n\nI\u0027m not confident it\u0027s relevant.","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"7b2eb7e20a921e5059cfa21284d951a1f6c432c1","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_5649c58a","line":48,"in_reply_to":"3afc51ec_12dbce7d","updated":"2016-03-21 16:50:04.000000000","message":"Yes, deployment will need to explictly set to blank. That\u0027s why, the comments are updated in https://review.openstack.org/#/c/282581/3/etc/barbican/barbican.conf .\n\nSetting default to None causes bunch of unit and functional failures and its not just setting this default in those tests. There are bunch of tests which expects it to be \u0027http://localhost:9311\u0027.","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"799e58e687080533a584928b08177d260fb7eedc","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_12dbce7d","line":48,"in_reply_to":"3afc51ec_46bbeac4","updated":"2016-03-12 15:50:28.000000000","message":"yeah, I believe that for this to work then we would need to change the default for host_href to None. Unless we instruct users to explicitly set the host_href as Ian says.","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"799e58e687080533a584928b08177d260fb7eedc","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"},{"line_number":52,"context_line":"    return parse.urljoin(host_part, version)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_72917299","line":51,"range":{"start_line":48,"start_character":0,"end_line":51,"end_character":34},"updated":"2016-03-12 15:50:28.000000000","message":"wouldn\u0027t you be able to get the host_part from get_base_url_from_request ?","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"7b2eb7e20a921e5059cfa21284d951a1f6c432c1","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"},{"line_number":52,"context_line":"    return parse.urljoin(host_part, version)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_ac3c5030","line":51,"range":{"start_line":48,"start_character":0,"end_line":51,"end_character":34},"in_reply_to":"3afc51ec_72917299","updated":"2016-03-21 16:50:04.000000000","message":"I don\u0027t recall why I did not do that way as its old patch. Will check against my setup this week. If it can be done by referencing common code, I agree that\u0027s better and will submit a new patch.","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"6a848d4855976735f5e7b5e57b92b6cab99eb830","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"},{"line_number":52,"context_line":"    return parse.urljoin(host_part, version)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_c31438ea","line":51,"range":{"start_line":48,"start_character":0,"end_line":51,"end_character":34},"in_reply_to":"fa0719c6_ac3c5030","updated":"2016-03-24 16:01:47.000000000","message":"Re-looked into the code. New logic added in common.utils module for get_base_url_from_request() derives base URL without any input argument as it uses pecan request object. In above method, \u0027full_url\u0027 is already provided so there is no need to derive it. \n\nIt appears to be same functionality but current logic might need to be changed to use this full_url as input. Let me know if you think its better to be that way.","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"442bb63ed8da3a504cae5a57068e36ada1af528a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if version[-1] !\u003d \u0027/\u0027:"},{"line_number":46,"context_line":"        version +\u003d \u0027/\u0027"},{"line_number":47,"context_line":"    # If host_href is not set in barbican conf, then derive it from request url"},{"line_number":48,"context_line":"    if not CONF.host_href:"},{"line_number":49,"context_line":"        host_part, _ \u003d parse.urldefrag(full_url)"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        host_part \u003d CONF.host_href"},{"line_number":52,"context_line":"    return parse.urljoin(host_part, version)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da0c15f0_22acf4ec","line":51,"range":{"start_line":48,"start_character":0,"end_line":51,"end_character":34},"in_reply_to":"fa0719c6_c31438ea","updated":"2016-03-24 17:52:58.000000000","message":"Made the change and uploaded new patch as it looks more cleaner to maintain.","commit_id":"14fb45691e46a957a8df7eb7d8075e763051937b"}],"barbican/common/utils.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"01057b9a28f06c1cc48a148314f807d0b598909a","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    attr check on pecan instance."},{"line_number":70,"context_line":"    \"\"\""},{"line_number":71,"context_line":"    if not CONF.host_href and hasattr(pecan.request, \u0027url\u0027):"},{"line_number":72,"context_line":"        request \u003d pecan.request"},{"line_number":73,"context_line":"        p_url \u003d parse.urlsplit(request.url)"},{"line_number":74,"context_line":"        proto \u003d request.environ.get(\u0027HTTP_X_FORWARDED_PROTO\u0027, p_url.scheme)"},{"line_number":75,"context_line":"        base_url \u003d \u0027%s://%s\u0027 % (proto, p_url.netloc)"},{"line_number":76,"context_line":"        return base_url"},{"line_number":77,"context_line":"    else:  # when host_href is set or flow is not within wsgi request context"},{"line_number":78,"context_line":"        return CONF.host_href"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_65cfc77f","line":76,"range":{"start_line":72,"start_character":8,"end_line":76,"end_character":23},"updated":"2016-02-22 06:10:24.000000000","message":"I really think we should stop doing this and we should use the appropriate middleware already written in oslo middleware\" https://github.com/openstack/oslo.middleware/blob/master/oslo_middleware/http_proxy_to_wsgi.py","commit_id":"861e1ff12ba1a67e28b07097b13bf7892b01f115"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8654e5f5172aa931b048aeeddcfe7e1f7586b02b","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    attr check on pecan instance."},{"line_number":70,"context_line":"    \"\"\""},{"line_number":71,"context_line":"    if not CONF.host_href and hasattr(pecan.request, \u0027url\u0027):"},{"line_number":72,"context_line":"        request \u003d pecan.request"},{"line_number":73,"context_line":"        p_url \u003d parse.urlsplit(request.url)"},{"line_number":74,"context_line":"        proto \u003d request.environ.get(\u0027HTTP_X_FORWARDED_PROTO\u0027, p_url.scheme)"},{"line_number":75,"context_line":"        base_url \u003d \u0027%s://%s\u0027 % (proto, p_url.netloc)"},{"line_number":76,"context_line":"        return base_url"},{"line_number":77,"context_line":"    else:  # when host_href is set or flow is not within wsgi request context"},{"line_number":78,"context_line":"        return CONF.host_href"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_83a6270e","line":76,"range":{"start_line":72,"start_character":8,"end_line":76,"end_character":23},"in_reply_to":"bae84128_5006a3ce","updated":"2016-02-22 17:19:00.000000000","message":"I meant that we still need to have logic to bypass CONF.host_href usage. I was talking about that aspect.\n\nIts okay to use middleware as we really don\u0027t need to do protocol header lookup..looks like we will get this correctly similar to hostname part.","commit_id":"861e1ff12ba1a67e28b07097b13bf7892b01f115"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"8028962bba6091d631443580d826f8ccdcfa5e9c","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    attr check on pecan instance."},{"line_number":70,"context_line":"    \"\"\""},{"line_number":71,"context_line":"    if not CONF.host_href and hasattr(pecan.request, \u0027url\u0027):"},{"line_number":72,"context_line":"        request \u003d pecan.request"},{"line_number":73,"context_line":"        p_url \u003d parse.urlsplit(request.url)"},{"line_number":74,"context_line":"        proto \u003d request.environ.get(\u0027HTTP_X_FORWARDED_PROTO\u0027, p_url.scheme)"},{"line_number":75,"context_line":"        base_url \u003d \u0027%s://%s\u0027 % (proto, p_url.netloc)"},{"line_number":76,"context_line":"        return base_url"},{"line_number":77,"context_line":"    else:  # when host_href is set or flow is not within wsgi request context"},{"line_number":78,"context_line":"        return CONF.host_href"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_5006a3ce","line":76,"range":{"start_line":72,"start_character":8,"end_line":76,"end_character":23},"in_reply_to":"bae84128_5027c3b5","updated":"2016-02-22 17:02:31.000000000","message":"why won\u0027t it? It does set the url scheme that we need? So wouldn\u0027t just removing the HTTP_X_FORWARDED_PROTO handling from here, and letting that middleware do it work?","commit_id":"861e1ff12ba1a67e28b07097b13bf7892b01f115"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"2f47f28f0ec263281e2a379b7520b79dc0a10ad7","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    attr check on pecan instance."},{"line_number":70,"context_line":"    \"\"\""},{"line_number":71,"context_line":"    if not CONF.host_href and hasattr(pecan.request, \u0027url\u0027):"},{"line_number":72,"context_line":"        request \u003d pecan.request"},{"line_number":73,"context_line":"        p_url \u003d parse.urlsplit(request.url)"},{"line_number":74,"context_line":"        proto \u003d request.environ.get(\u0027HTTP_X_FORWARDED_PROTO\u0027, p_url.scheme)"},{"line_number":75,"context_line":"        base_url \u003d \u0027%s://%s\u0027 % (proto, p_url.netloc)"},{"line_number":76,"context_line":"        return base_url"},{"line_number":77,"context_line":"    else:  # when host_href is set or flow is not within wsgi request context"},{"line_number":78,"context_line":"        return CONF.host_href"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_5027c3b5","line":76,"range":{"start_line":72,"start_character":8,"end_line":76,"end_character":23},"in_reply_to":"bae84128_65cfc77f","updated":"2016-02-22 16:56:05.000000000","message":"I agree that we don\u0027t need to build custom base URLs as wsgi layer already takes care of it.\n\nI am not sure what is alternative approach available here. \n\nWe already have existing application logic which relies on static host value in barbican configuration. And this logic is used by deployments. So now, we need a mechanism to bypass this logic for reasons mentioned in related bug.\nAbove mentioned middleware is doing the right thing but it will not have influence as per existing logic.","commit_id":"861e1ff12ba1a67e28b07097b13bf7892b01f115"}],"barbican/tests/common/test_utils.py":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"07887e32c751107a81a5a9c80ad2bcf68728edc3","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def test_hostname_for_refs_no_resource(self):"},{"line_number":87,"context_line":"        uri \u003d utils.hostname_for_refs()"},{"line_number":88,"context_line":"        self.assertEqual(\"{0}/{1}\".format(self.host, self.version), uri)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"class WhenTestingAcceptEncodingGetter(test_utils.BaseTestCase):"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_65ed2d8b","line":89,"updated":"2016-04-12 16:07:06.000000000","message":"It would be good to have a test for overriding \u0027host_href\u0027 with non-None/empty as well.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"8a8829ce789e69b08863ec6069609ffb8f68ca3b","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def test_hostname_for_refs_no_resource(self):"},{"line_number":87,"context_line":"        uri \u003d utils.hostname_for_refs()"},{"line_number":88,"context_line":"        self.assertEqual(\"{0}/{1}\".format(self.host, self.version), uri)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"class WhenTestingAcceptEncodingGetter(test_utils.BaseTestCase):"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_0374f165","line":89,"in_reply_to":"5a18252c_0149c031","updated":"2016-04-13 16:18:15.000000000","message":"I was thinking of a host_href set to something other than None or \u0027\u0027, but I guess that is the default case anyway (i.e. whereby host_href is set to localhost:9311)?","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"7ea2cc633f7c63b4949c54d846d6b73ee2fc2655","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def test_hostname_for_refs_no_resource(self):"},{"line_number":87,"context_line":"        uri \u003d utils.hostname_for_refs()"},{"line_number":88,"context_line":"        self.assertEqual(\"{0}/{1}\".format(self.host, self.version), uri)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"class WhenTestingAcceptEncodingGetter(test_utils.BaseTestCase):"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_8319218b","line":89,"in_reply_to":"5a18252c_0374f165","updated":"2016-04-13 16:24:42.000000000","message":"Yes, those tests are covered in existing tests e.g see line #44 in current file for such test.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"5efbaab2c938b6659fd74be8e2673a1fc5756cf6","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def test_hostname_for_refs_no_resource(self):"},{"line_number":87,"context_line":"        uri \u003d utils.hostname_for_refs()"},{"line_number":88,"context_line":"        self.assertEqual(\"{0}/{1}\".format(self.host, self.version), uri)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"class WhenTestingAcceptEncodingGetter(test_utils.BaseTestCase):"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_0149c031","line":89,"in_reply_to":"5a18252c_65ed2d8b","updated":"2016-04-12 20:17:40.000000000","message":"Previous test \u0027test_blank_conf_hosthref_for_refs\u0027  checks for same case by setting CONF host_href value to \u0027\u0027 (empty) (line # 81). So in that case, it will use host value set in pecan request instead of CONF value.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"}],"barbican/tests/utils.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"86eeb8486b31b6b91140afec831efabf1ee514eb","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from barbican.tests import database_utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def mock_pecan_request(self, host\u003dNone):"},{"line_number":37,"context_line":"    patcher_obj \u003d mock.patch(\u0027pecan.request\u0027)"},{"line_number":38,"context_line":"    mock_req \u003d patcher_obj.start()"},{"line_number":39,"context_line":"    self.addCleanup(patcher_obj.stop)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_bcc5ae5c","line":36,"updated":"2016-04-04 16:28:54.000000000","message":"If these are utility functions, perhaps a different parameter name should be chosen then. I understand \"self\" will be passed in, but it should be less obvious that we\u0027re avoiding creating a mixin to provide these two methods to subclasses of two other classes.","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"78ff9d34b7665fe03cf0bc2d29d82ac146ad7b34","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from barbican.tests import database_utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def mock_pecan_request(self, host\u003dNone):"},{"line_number":37,"context_line":"    patcher_obj \u003d mock.patch(\u0027pecan.request\u0027)"},{"line_number":38,"context_line":"    mock_req \u003d patcher_obj.start()"},{"line_number":39,"context_line":"    self.addCleanup(patcher_obj.stop)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_22f0f2fd","line":36,"updated":"2016-03-30 16:30:12.000000000","message":"Why isn\u0027t this simply a method on the BaseTestCase below (along with the context manager pecan_context)?","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"1d95d01fb74266ff053fdd34164ae79108d6737a","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from barbican.tests import database_utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def mock_pecan_request(self, host\u003dNone):"},{"line_number":37,"context_line":"    patcher_obj \u003d mock.patch(\u0027pecan.request\u0027)"},{"line_number":38,"context_line":"    mock_req \u003d patcher_obj.start()"},{"line_number":39,"context_line":"    self.addCleanup(patcher_obj.stop)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_9941d70e","line":36,"in_reply_to":"9a061dce_bcc5ae5c","updated":"2016-04-04 17:42:33.000000000","message":"Makes sense. Let me make that change in next patch.","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"c7d9dc6ab662e4c7c43f139947cf065db9b67b5f","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from barbican.tests import database_utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def mock_pecan_request(self, host\u003dNone):"},{"line_number":37,"context_line":"    patcher_obj \u003d mock.patch(\u0027pecan.request\u0027)"},{"line_number":38,"context_line":"    mock_req \u003d patcher_obj.start()"},{"line_number":39,"context_line":"    self.addCleanup(patcher_obj.stop)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_66a54903","line":36,"in_reply_to":"ba0121b8_22f0f2fd","updated":"2016-04-04 15:59:14.000000000","message":"Being a utility function used in both BarbicanAPIBaseTestCase (line# 49) and BaseTestCase (Line# 88) classes, I have written them separately instead of creating a new class hierarchy. This function is not tied to specific API test case type, just like other functions defined after line #313 in this file.","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"537f09de4d0a78015d190316f87b3ce3c08a4769","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from barbican.tests import database_utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def mock_pecan_request(self, host\u003dNone):"},{"line_number":37,"context_line":"    patcher_obj \u003d mock.patch(\u0027pecan.request\u0027)"},{"line_number":38,"context_line":"    mock_req \u003d patcher_obj.start()"},{"line_number":39,"context_line":"    self.addCleanup(patcher_obj.stop)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_0679ed93","line":36,"in_reply_to":"ba0121b8_22f0f2fd","updated":"2016-04-04 15:53:19.000000000","message":"I agree but don\u0027t consider it a blocker","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"}],"etc/barbican/barbican-functional.conf":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"78ff9d34b7665fe03cf0bc2d29d82ac146ad7b34","unresolved":false,"context_lines":[{"line_number":65,"context_line":"# its API server configuration. In that case, barbican href\u0027s base URL is"},{"line_number":66,"context_line":"# derived from wsgi request instead."},{"line_number":67,"context_line":"# Default value is True."},{"line_number":68,"context_line":"server_host_href_set \u003d True"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"[quotas]"},{"line_number":71,"context_line":"# For each resource, the default maximum number that can be used for"}],"source_content_type":"text/plain","patch_set":6,"id":"ba0121b8_02e68e43","line":68,"updated":"2016-03-30 16:30:12.000000000","message":"So this is only for barbican\u0027s functional test cases, right? (I\u0027m newer to Barbican development, sorry for the question.)","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"62c50fef7d638052eec107e9fcdfd7c8e7a5669b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"# its API server configuration. In that case, barbican href\u0027s base URL is"},{"line_number":66,"context_line":"# derived from wsgi request instead."},{"line_number":67,"context_line":"# Default value is True."},{"line_number":68,"context_line":"server_host_href_set \u003d True"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"[quotas]"},{"line_number":71,"context_line":"# For each resource, the default maximum number that can be used for"}],"source_content_type":"text/plain","patch_set":6,"id":"ba0121b8_e67b9526","line":68,"in_reply_to":"ba0121b8_02e68e43","updated":"2016-03-31 05:13:02.000000000","message":"There are people actually using the host_href in production. So I don\u0027t think this will be deprecated any time soon.","commit_id":"90985be0f8adae5c5776f8d0738da3a0a36d5882"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"07887e32c751107a81a5a9c80ad2bcf68728edc3","unresolved":false,"context_lines":[{"line_number":61,"context_line":"# override_url\u003dhttp://localhost:9311"},{"line_number":62,"context_line":"# override_url_version\u003dv1"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Flag to disable when barbican api server is not using \u0027host_href\u0027 setting in"},{"line_number":65,"context_line":"# its API server configuration. In that case, barbican href\u0027s base URL is"},{"line_number":66,"context_line":"# derived from wsgi request instead."},{"line_number":67,"context_line":"# Default value is True."}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_b8f80c7e","line":64,"updated":"2016-04-12 16:07:06.000000000","message":"I was a bit confused by this comment...maybe this?:\n\nFlag to indicate if (when True) the server is setting the href\u0027s returned in requests via barbican.conf\u0027s \u0027host_href\u0027 setting, or else (when False) the server is setting the href\u0027s from the wsgi request.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"7ea2cc633f7c63b4949c54d846d6b73ee2fc2655","unresolved":false,"context_lines":[{"line_number":61,"context_line":"# override_url\u003dhttp://localhost:9311"},{"line_number":62,"context_line":"# override_url_version\u003dv1"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Flag to disable when barbican api server is not using \u0027host_href\u0027 setting in"},{"line_number":65,"context_line":"# its API server configuration. In that case, barbican href\u0027s base URL is"},{"line_number":66,"context_line":"# derived from wsgi request instead."},{"line_number":67,"context_line":"# Default value is True."}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_de581035","line":64,"in_reply_to":"5a18252c_239c8d68","updated":"2016-04-13 16:24:42.000000000","message":"Got it. Will make those changes.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"8a8829ce789e69b08863ec6069609ffb8f68ca3b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"# override_url\u003dhttp://localhost:9311"},{"line_number":62,"context_line":"# override_url_version\u003dv1"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Flag to disable when barbican api server is not using \u0027host_href\u0027 setting in"},{"line_number":65,"context_line":"# its API server configuration. In that case, barbican href\u0027s base URL is"},{"line_number":66,"context_line":"# derived from wsgi request instead."},{"line_number":67,"context_line":"# Default value is True."}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_239c8d68","line":64,"in_reply_to":"5a18252c_5c30bf01","updated":"2016-04-13 16:18:15.000000000","message":"I think the \u0027dis\u0027able and \u0027not\u0027 words in the original are confusing to me and make it not so clear what setting True or False actually means. So I think this should be more explicit what it means when the flag is set True or False.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"5efbaab2c938b6659fd74be8e2673a1fc5756cf6","unresolved":false,"context_lines":[{"line_number":61,"context_line":"# override_url\u003dhttp://localhost:9311"},{"line_number":62,"context_line":"# override_url_version\u003dv1"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Flag to disable when barbican api server is not using \u0027host_href\u0027 setting in"},{"line_number":65,"context_line":"# its API server configuration. In that case, barbican href\u0027s base URL is"},{"line_number":66,"context_line":"# derived from wsgi request instead."},{"line_number":67,"context_line":"# Default value is True."}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_5c30bf01","line":64,"in_reply_to":"5a18252c_b8f80c7e","updated":"2016-04-12 20:17:40.000000000","message":"To me, existing text also make sense as this setting is used only to disable/change default behavior. I can change it to suggested text as well as I don\u0027t have any strong preference over other.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"}],"etc/barbican/barbican.conf":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"07887e32c751107a81a5a9c80ad2bcf68728edc3","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# Host name, for use in HATEOAS-style references"},{"line_number":15,"context_line":"#  Note: Typically this would be the load balanced endpoint that clients would use"},{"line_number":16,"context_line":"#  communicate back with this service."},{"line_number":17,"context_line":"# If a deployment wants to derive host from wsgi request instead then make this"},{"line_number":18,"context_line":"# blank. Blank is needed to override default config value which is"},{"line_number":19,"context_line":"# \u0027http://localhost:9311\u0027."},{"line_number":20,"context_line":"host_href \u003d http://localhost:9311"}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_fb1d5e67","line":17,"updated":"2016-04-12 16:07:06.000000000","message":"Maybe change to \u0027Comment out or remove to derive host from wsgi request instead\u0027.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"056dd97ad2c22671e078e37a64d0fd7c68f2b697","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# Host name, for use in HATEOAS-style references"},{"line_number":15,"context_line":"#  Note: Typically this would be the load balanced endpoint that clients would use"},{"line_number":16,"context_line":"#  communicate back with this service."},{"line_number":17,"context_line":"# If a deployment wants to derive host from wsgi request instead then make this"},{"line_number":18,"context_line":"# blank. Blank is needed to override default config value which is"},{"line_number":19,"context_line":"# \u0027http://localhost:9311\u0027."},{"line_number":20,"context_line":"host_href \u003d http://localhost:9311"}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_b0cf77af","line":17,"in_reply_to":"5a18252c_10b0eb42","updated":"2016-04-12 20:18:40.000000000","message":"Sorry missed the key word above in question.\n\"Can you please clarify what you want me to change here?\"","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"eb418b38bdc32b42dc2fba79637beab5bf46f18f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# Host name, for use in HATEOAS-style references"},{"line_number":15,"context_line":"#  Note: Typically this would be the load balanced endpoint that clients would use"},{"line_number":16,"context_line":"#  communicate back with this service."},{"line_number":17,"context_line":"# If a deployment wants to derive host from wsgi request instead then make this"},{"line_number":18,"context_line":"# blank. Blank is needed to override default config value which is"},{"line_number":19,"context_line":"# \u0027http://localhost:9311\u0027."},{"line_number":20,"context_line":"host_href \u003d http://localhost:9311"}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_703652e7","line":17,"in_reply_to":"5a18252c_b0cf77af","updated":"2016-04-13 14:45:06.000000000","message":"Ok I see what you mean here.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"5efbaab2c938b6659fd74be8e2673a1fc5756cf6","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# Host name, for use in HATEOAS-style references"},{"line_number":15,"context_line":"#  Note: Typically this would be the load balanced endpoint that clients would use"},{"line_number":16,"context_line":"#  communicate back with this service."},{"line_number":17,"context_line":"# If a deployment wants to derive host from wsgi request instead then make this"},{"line_number":18,"context_line":"# blank. Blank is needed to override default config value which is"},{"line_number":19,"context_line":"# \u0027http://localhost:9311\u0027."},{"line_number":20,"context_line":"host_href \u003d http://localhost:9311"}],"source_content_type":"text/plain","patch_set":8,"id":"5a18252c_10b0eb42","line":17,"in_reply_to":"5a18252c_fb1d5e67","updated":"2016-04-12 20:17:40.000000000","message":"Can you please what you want me to change here? This value needs to be made blank and cannot be commented out. In commented out case, logic will use default defined in code for this property.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"}],"functionaltests/api/v1/functional/test_containers.py":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"07887e32c751107a81a5a9c80ad2bcf68728edc3","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        regex \u003d \u0027.*{0}.*\u0027.format(malicious_hostname)"},{"line_number":234,"context_line":"        self.assertNotRegexpMatches(resp.headers[\u0027location\u0027], regex)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    @testcase.skipIf(base.conf_host_href_used, \u0027response href using \u0027"},{"line_number":237,"context_line":"                     \u0027CONF.host_href instead of wsgi request\u0027)"},{"line_number":238,"context_line":"    @testcase.attr(\u0027positive\u0027)"},{"line_number":239,"context_line":"    def test_get_change_host_with_header_allowed(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_1b7e5ae4","line":236,"updated":"2016-04-12 16:07:06.000000000","message":"It seems the logic is reversed here....so does base.conf_host_href_used \u003d True mean the server\u0027s \u0027host_href\u0027 is set, or not set? This test implies to me that wsgi request is setting the return href, in which case I was expecting the \u0027not base.conf_host_href_used\u0027 clause?","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"5efbaab2c938b6659fd74be8e2673a1fc5756cf6","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        regex \u003d \u0027.*{0}.*\u0027.format(malicious_hostname)"},{"line_number":234,"context_line":"        self.assertNotRegexpMatches(resp.headers[\u0027location\u0027], regex)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    @testcase.skipIf(base.conf_host_href_used, \u0027response href using \u0027"},{"line_number":237,"context_line":"                     \u0027CONF.host_href instead of wsgi request\u0027)"},{"line_number":238,"context_line":"    @testcase.attr(\u0027positive\u0027)"},{"line_number":239,"context_line":"    def test_get_change_host_with_header_allowed(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_7cbf7bd0","line":236,"in_reply_to":"5a18252c_1b7e5ae4","updated":"2016-04-12 20:17:40.000000000","message":"skipIf is used to skip following test when condition is true.\n\nWhich means that when \u0027base.conf_host_href_used\u0027 is true, do not run the test. And this flag is set to True when barbican server is using \u0027CONF.host_href\u0027 value to construct hrefs in its response.\n\nnot clause is used in previous test which is a existing test. We don\u0027t want to run that test if barbican server is using host from wsgi request (as it will fail in that case)","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"8a8829ce789e69b08863ec6069609ffb8f68ca3b","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        regex \u003d \u0027.*{0}.*\u0027.format(malicious_hostname)"},{"line_number":234,"context_line":"        self.assertNotRegexpMatches(resp.headers[\u0027location\u0027], regex)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    @testcase.skipIf(base.conf_host_href_used, \u0027response href using \u0027"},{"line_number":237,"context_line":"                     \u0027CONF.host_href instead of wsgi request\u0027)"},{"line_number":238,"context_line":"    @testcase.attr(\u0027positive\u0027)"},{"line_number":239,"context_line":"    def test_get_change_host_with_header_allowed(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_8313e1b7","line":236,"in_reply_to":"5a18252c_7cbf7bd0","updated":"2016-04-13 16:18:15.000000000","message":"Ok sounds good.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"07887e32c751107a81a5a9c80ad2bcf68728edc3","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        another_proxy_hostname \u003d \u0027proxy2.server.com\u0027"},{"line_number":362,"context_line":"        changed_host_header \u003d {\u0027Host\u0027: another_proxy_hostname}"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        # In test, cannot pass different host header during create as returned"},{"line_number":365,"context_line":"        # container_href in response contains that host in url. That url is"},{"line_number":366,"context_line":"        # used in deleting that container during cleanup step."},{"line_number":367,"context_line":"        resp, container_href \u003d self.behaviors.create_container(test_model)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_bb7766d3","line":364,"updated":"2016-04-12 16:07:06.000000000","message":"This confuses me a bit...so if the host is not specified in the host header (as is probably the case for clean up), it defaults to the host_href perhaps?","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"8a8829ce789e69b08863ec6069609ffb8f68ca3b","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        another_proxy_hostname \u003d \u0027proxy2.server.com\u0027"},{"line_number":362,"context_line":"        changed_host_header \u003d {\u0027Host\u0027: another_proxy_hostname}"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        # In test, cannot pass different host header during create as returned"},{"line_number":365,"context_line":"        # container_href in response contains that host in url. That url is"},{"line_number":366,"context_line":"        # used in deleting that container during cleanup step."},{"line_number":367,"context_line":"        resp, container_href \u003d self.behaviors.create_container(test_model)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_e33bb536","line":364,"in_reply_to":"5a18252c_1cdc87e3","updated":"2016-04-13 16:18:15.000000000","message":"Ok I think I got it","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"5efbaab2c938b6659fd74be8e2673a1fc5756cf6","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        another_proxy_hostname \u003d \u0027proxy2.server.com\u0027"},{"line_number":362,"context_line":"        changed_host_header \u003d {\u0027Host\u0027: another_proxy_hostname}"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        # In test, cannot pass different host header during create as returned"},{"line_number":365,"context_line":"        # container_href in response contains that host in url. That url is"},{"line_number":366,"context_line":"        # used in deleting that container during cleanup step."},{"line_number":367,"context_line":"        resp, container_href \u003d self.behaviors.create_container(test_model)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_1cdc87e3","line":364,"in_reply_to":"5a18252c_bb7766d3","updated":"2016-04-12 20:17:40.000000000","message":"I was just trying to highlight that we cannot set \u0027Host\u0027 header during create_container request as returned container_href is stored in created_entities list. This list is read during cleanup for deleting entities created during the test. \nLine appends to entity list (https://github.com/openstack/barbican/blob/master/functionaltests/api/v1/behaviors/container_behaviors.py#L44)\n\nLine used during cleanup for deleting entities\n(https://github.com/openstack/barbican/blob/master/functionaltests/api/v1/behaviors/container_behaviors.py#L117)\n\nIf we modify \u0027HOST\u0027 header to other than localhost during create_container request, then stored container_href will be incorrect and cleanup will fail.","commit_id":"5bc021e09a47c4fef76ea44740abec69d9ff62d0"}]}
