)]}'
{"setup.cfg":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c339944e33eb767091b5340a3d728f647703c0fc","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    kms_keymaster \u003d swift.common.middleware.crypto.kms_keymaster:filter_factory"},{"line_number":108,"context_line":"    listing_formats \u003d swift.common.middleware.listing_formats:filter_factory"},{"line_number":109,"context_line":"    symlink \u003d swift.common.middleware.symlink:filter_factory"},{"line_number":110,"context_line":"    cors \u003d swift.common.middleware.cors:filter_factory"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"[build_sphinx]"},{"line_number":113,"context_line":"all_files \u003d 1"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"df87a7cf_edaa9517","line":110,"updated":"2017-12-15 00:13:39.000000000","message":"brand new entrypoint baby!","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"}],"swift/common/middleware/cors.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c339944e33eb767091b5340a3d728f647703c0fc","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    # CORS functionality used to live in the proxy server, so we register"},{"line_number":248,"context_line":"    # strict_cors_mode in the default location so clients don\u0027t know that"},{"line_number":249,"context_line":"    # it\u0027s a middleware now."},{"line_number":250,"context_line":"    register_swift_info("},{"line_number":251,"context_line":"        strict_cors_mode\u003dconfig_true_value("},{"line_number":252,"context_line":"            conf.get(\u0027strict_cors_mode\u0027, DEFAULT_STRICT_CORS_MODE)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_932a0c2a","line":249,"updated":"2017-12-15 00:13:39.000000000","message":"maintaining backwards compat is certainly venerable ... i guess this is sufficient.","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"98fa5b4c38cde73f73110b3fff80d163b775243f","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        self.strict_cors_mode \u003d config_true_value("},{"line_number":91,"context_line":"            conf.get(\u0027strict_cors_mode\u0027, DEFAULT_STRICT_CORS_MODE))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    @wsgify"},{"line_number":94,"context_line":"    def __call__(self, req):"},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            vrs, account, container, obj \u003d req.split_path(3, 4, True)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_61946438","line":93,"updated":"2018-01-03 02:22:02.000000000","message":"Huh. You actually got @wsgify to work for you? I ran into bad luck with it in https://review.openstack.org/#/c/449394/ -- finally dropped it in patchset 4. I guess it\u0027s because you often just return the app instead of a swob.Response?\n\nFWIW, my trouble was that if we tried to return repeated headers, one of them would get eaten :-(","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"7cf36a88b2c4fa3fa7d53ae371c3689d480ff53d","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        self.strict_cors_mode \u003d config_true_value("},{"line_number":91,"context_line":"            conf.get(\u0027strict_cors_mode\u0027, DEFAULT_STRICT_CORS_MODE))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    @wsgify"},{"line_number":94,"context_line":"    def __call__(self, req):"},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            vrs, account, container, obj \u003d req.split_path(3, 4, True)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_8c818b4d","line":93,"in_reply_to":"9f91af0f_61946438","updated":"2018-01-04 00:04:32.000000000","message":"Yeah, it\u0027s working fine here. I haven\u0027t noticed any repeated headers or problems with their absence.","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"98fa5b4c38cde73f73110b3fff80d163b775243f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        # First, get the proxy\u0027s OPTIONS response so we know what methods"},{"line_number":124,"context_line":"        # are allowed."},{"line_number":125,"context_line":"        options_resp \u003d req.get_response(self.app)"},{"line_number":126,"context_line":"        if not is_success(options_resp.status_int):"},{"line_number":127,"context_line":"            return options_resp"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        req_origin_value \u003d req.headers[\u0027Origin\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_e1695425","line":126,"updated":"2018-01-03 02:22:02.000000000","message":"We expect this could happen... because of some middleware or something, yeah? proxy-server should always be happy.","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"7cf36a88b2c4fa3fa7d53ae371c3689d480ff53d","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        # First, get the proxy\u0027s OPTIONS response so we know what methods"},{"line_number":124,"context_line":"        # are allowed."},{"line_number":125,"context_line":"        options_resp \u003d req.get_response(self.app)"},{"line_number":126,"context_line":"        if not is_success(options_resp.status_int):"},{"line_number":127,"context_line":"            return options_resp"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        req_origin_value \u003d req.headers[\u0027Origin\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_ace9ef1a","line":126,"in_reply_to":"9f91af0f_e1695425","updated":"2018-01-04 00:04:32.000000000","message":"Pretty much, yeah. Just being defensive.","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"98fa5b4c38cde73f73110b3fff80d163b775243f","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        preflight_method \u003d req.headers.get(\u0027Access-Control-Request-Method\u0027)"},{"line_number":131,"context_line":"        allowed_methods \u003d ["},{"line_number":132,"context_line":"            m.strip()"},{"line_number":133,"context_line":"            for m in options_resp.headers.get(\u0027Allow\u0027, \u0027\u0027).split(\u0027,\u0027)]"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        container_info \u003d get_container_info(req.environ, self.app,"},{"line_number":136,"context_line":"                                            swift_source\u003d\u0027CORS\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_a1734c15","line":133,"updated":"2018-01-03 02:22:02.000000000","message":"Huh. COPY doesn\u0027t seem to show up here? Something.\n\n $ curl http://saio:8090/v1/AUTH_test/c/o -X OPTIONS -H origin:http://localhost:8000 -H Access-Control-Request-Method:COPY\n *   Trying 192.168.8.80...\n * TCP_NODELAY set\n * Connected to saio (192.168.8.80) port 8090 (#0)\n \u003e OPTIONS /v1/AUTH_test/c/o HTTP/1.1\n \u003e Host: saio:8090\n \u003e User-Agent: curl/7.54.0\n \u003e Accept: application/json;q\u003d1, text/*;q\u003d.9, */*;q\u003d.8\n \u003e origin:http://localhost:8000\n \u003e Access-Control-Request-Method:COPY\n \u003e\n \u003c HTTP/1.1 401 Unauthorized\n \u003c Content-Length: 0\n \u003c Content-Type: text/html; charset\u003dUTF-8\n \u003c Allow: HEAD, GET, PUT, POST, OPTIONS, DELETE\n \u003c X-Trans-Id: tx1b95a5bf2a5544f6a49e8-005a4c38c4\n \u003c X-Openstack-Request-Id: tx1b95a5bf2a5544f6a49e8-005a4c38c4\n \u003c Date: Wed, 03 Jan 2018 01:58:28 GMT\n \u003c\n * Connection #0 to host saio left intact\n\n...but then it *does* show up when preflighting PUTs...\n\n $ curl http://saio:8090/v1/AUTH_test/c/o -X OPTIONS -H origin:http://localhost:8000 -H Access-Control-Request-Method:PUT\n *   Trying 192.168.8.80...\n * TCP_NODELAY set\n * Connected to saio (192.168.8.80) port 8090 (#0)\n \u003e OPTIONS /v1/AUTH_test/c/o HTTP/1.1\n \u003e Host: saio:8090\n \u003e User-Agent: curl/7.54.0\n \u003e Accept: application/json;q\u003d1, text/*;q\u003d.9, */*;q\u003d.8\n \u003e origin:http://localhost:8000\n \u003e Access-Control-Request-Method:PUT\n \u003e\n \u003c HTTP/1.1 200 OK\n \u003c Content-Length: 0\n \u003c Access-Control-Allow-Methods: HEAD, GET, PUT, POST, OPTIONS, DELETE, COPY\n \u003c Content-Type: text/html; charset\u003dUTF-8\n \u003c Access-Control-Allow-Origin: *\n \u003c Allow: HEAD, GET, PUT, POST, OPTIONS, DELETE, COPY\n \u003c X-Trans-Id: tx529219c1d8c24c4385b7c-005a4c38cc\n \u003c X-Openstack-Request-Id: tx529219c1d8c24c4385b7c-005a4c38cc\n \u003c Date: Wed, 03 Jan 2018 01:58:36 GMT\n \u003c\n * Connection #0 to host saio left intact\n\nPipeline auto-insertion looks sane though (cors left of copy):\n\n Jan  3 01:44:01 saio proxy-server: Pipeline was modified. New pipeline is \"catch_errors gatekeeper healthcheck proxy-logging cache cors listing_formats container_sync bulk tempurl tempauth staticweb copy slo dlo versioned_writes keymaster encryption proxy-logging proxy-server\".\n\nSee also: https://github.com/openstack/swift/blob/2.16.0/swift/common/middleware/copy.py#L234-L235","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"559a4e739bc4c4a803ff7bd11f838aeed80772c9","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        preflight_method \u003d req.headers.get(\u0027Access-Control-Request-Method\u0027)"},{"line_number":131,"context_line":"        allowed_methods \u003d ["},{"line_number":132,"context_line":"            m.strip()"},{"line_number":133,"context_line":"            for m in options_resp.headers.get(\u0027Allow\u0027, \u0027\u0027).split(\u0027,\u0027)]"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        container_info \u003d get_container_info(req.environ, self.app,"},{"line_number":136,"context_line":"                                            swift_source\u003d\u0027CORS\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_47326212","line":133,"in_reply_to":"9f91af0f_030309ba","updated":"2018-01-05 00:16:26.000000000","message":"Found my trouble -- I was looking at the wrong pipeline. With a starting pipeline like\n\n pipeline \u003d catch_errors gatekeeper healthcheck proxy-logging cache list-endpoints bulk tempurl slo dlo proxy-logging proxy-server\n\nI saw\n\n Pipeline was modified. New pipeline is \"catch_errors gatekeeper healthcheck proxy-logging copy cache cors listing_formats list-endpoints bulk tempurl slo dlo versioned_writes proxy-logging proxy-server\".\n\nwhich won\u0027t work because cors needs to come before copy. Something like\n\n diff --git a/swift/proxy/server.py b/swift/proxy/server.py\n index 9d2db9f01..05f11d1c4 100644\n --- a/swift/proxy/server.py\n +++ b/swift/proxy/server.py\n @@ -66,14 +66,14 @@ required_filters \u003d [\n       \u0027after_fn\u0027: lambda pipe: ([\u0027catch_errors\u0027]\n                                 if pipe.startswith(\u0027catch_errors\u0027)\n                                 else [])},\n -    {\u0027name\u0027: \u0027cors\u0027, \u0027after_fn\u0027: lambda _junk: [\n -        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},\n      {\u0027name\u0027: \u0027listing_formats\u0027, \u0027after_fn\u0027: lambda _junk: [\n          \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},\n      # Put copy before dlo, slo and versioned_writes\n      {\u0027name\u0027: \u0027copy\u0027, \u0027after_fn\u0027: lambda _junk: [\n -        \u0027staticweb\u0027, \u0027tempauth\u0027, \u0027keystoneauth\u0027,\n +        \u0027cors\u0027, \u0027staticweb\u0027, \u0027tempauth\u0027, \u0027keystoneauth\u0027,\n          \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027]},\n +    {\u0027name\u0027: \u0027cors\u0027, \u0027after_fn\u0027: lambda _junk: [\n +        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},\n      {\u0027name\u0027: \u0027dlo\u0027, \u0027after_fn\u0027: lambda _junk: [\n          \u0027copy\u0027, \u0027staticweb\u0027, \u0027tempauth\u0027, \u0027keystoneauth\u0027,\n          \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027]},\n\nseems to help. Interestingly, just adding cors to copy\u0027s after_fn wasn\u0027t enough -- copy was getting inserted *first* so it had no effect.\n\nOff-topic: why do we reverse required_filters over in modify_wsgi_pipeline? I feel like it makes the auto-insertion stuff harder to reason about...","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"7cf36a88b2c4fa3fa7d53ae371c3689d480ff53d","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        preflight_method \u003d req.headers.get(\u0027Access-Control-Request-Method\u0027)"},{"line_number":131,"context_line":"        allowed_methods \u003d ["},{"line_number":132,"context_line":"            m.strip()"},{"line_number":133,"context_line":"            for m in options_resp.headers.get(\u0027Allow\u0027, \u0027\u0027).split(\u0027,\u0027)]"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        container_info \u003d get_container_info(req.environ, self.app,"},{"line_number":136,"context_line":"                                            swift_source\u003d\u0027CORS\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_030309ba","line":133,"in_reply_to":"9f91af0f_a1734c15","updated":"2018-01-04 00:04:32.000000000","message":"Works on my machine(tm).\n\nIt actually does, though. I set my container to have X-Container-Meta-Access-Control-Allow-Origin: *, and preflight requests for GET, PUT, and COPY verbs all get 200s with appropriate headers. Preflight requests for BORK verb get a 401 response, which is also appropriate.","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f50d9b29ad03b77c160cd6748290bdb22dbd234e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    @wsgify"},{"line_number":94,"context_line":"    def __call__(self, req):"},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            vrs, account, container, obj \u003d req.split_path(3, 4, True)"},{"line_number":97,"context_line":"        except ValueError:"},{"line_number":98,"context_line":"            # Account, /info, and other miscellaneous requests"},{"line_number":99,"context_line":"            return self.app"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_a73b17e9","line":96,"range":{"start_line":96,"start_character":12,"end_line":96,"end_character":15},"updated":"2018-01-09 23:13:10.000000000","message":"We should probably add\n\n if not valid_api_version(vrs):\n     return self.app\n\nas a sanity check. Otherwise our get_container_info requests might be all crazy, yeah?\n\nDoes this have implications for pipeline ordering with regard to domain_remap and cname_lookup? Swift3... is probably SOL...","commit_id":"0c6dfd7f61c770596ae602c13fafa961194a4f96"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7b619bdf5ef004496d304ca65e76ef3caa9ab0f8","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            vrs, account, container, obj \u003d req.split_path(3, 4, True)"},{"line_number":97,"context_line":"        except ValueError:"},{"line_number":98,"context_line":"            # Account, /info, and other miscellaneous requests"},{"line_number":99,"context_line":"            return self.app"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        # All CORS requests have an Origin header"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f96bb07_76008d68","line":98,"range":{"start_line":98,"start_character":23,"end_line":98,"end_character":28},"updated":"2018-01-12 23:21:17.000000000","message":"As a counter-point to my comment above, it might be nice if *nothing* in proxy/controllers needed to think about CORS, /info included... but maybe that requires this new middleware have too much knowledge of how the proxy-server app works?","commit_id":"0c6dfd7f61c770596ae602c13fafa961194a4f96"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f50d9b29ad03b77c160cd6748290bdb22dbd234e","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        if req.method \u003d\u003d \u0027OPTIONS\u0027:"},{"line_number":106,"context_line":"            return self._handle_preflight(req)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        if req.method not in CORS_VERBS:"},{"line_number":109,"context_line":"            return self.app"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return self._handle_resource_request(req)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_077d23e6","line":108,"updated":"2018-01-09 23:13:10.000000000","message":"So any middleware that implements a new verb (like, say, copy), needs to handle resource requests on its own?\n\nOn the plus side, middlewares that capture \u0026 replace proxy-server responses (like, say, symlink) now get \"proper\" resource-request handling.","commit_id":"0c6dfd7f61c770596ae602c13fafa961194a4f96"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7b619bdf5ef004496d304ca65e76ef3caa9ab0f8","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        access to the requesting application."},{"line_number":188,"context_line":"        \"\"\""},{"line_number":189,"context_line":"        resp \u003d req.get_response(self.app)"},{"line_number":190,"context_line":"        if not is_success(resp.status_int):"},{"line_number":191,"context_line":"            return resp"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # The logic here was interpreted from"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f96bb07_d62e41f9","line":190,"updated":"2018-01-12 23:21:17.000000000","message":"This breaks from existing behavior. Currently, if you have a container that\u0027s public and CORS-enabled, you can see 404, 412, 304, etc. responses just fine.","commit_id":"0c6dfd7f61c770596ae602c13fafa961194a4f96"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f50d9b29ad03b77c160cd6748290bdb22dbd234e","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            else:"},{"line_number":235,"context_line":"                resp.headers[\u0027Access-Control-Allow-Origin\u0027] \u003d req_origin_value"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        return resp"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"def filter_factory(global_conf, **local_conf):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_2ac467f4","line":237,"updated":"2018-01-09 23:13:10.000000000","message":"I wonder if this (and the preflight handler above) should set Access-Control-Allow-Credentials... I guess, better as a feature request for later.","commit_id":"0c6dfd7f61c770596ae602c13fafa961194a4f96"}],"swift/proxy/controllers/base.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f81f8a83dc12071d92b276ad47353a72405511e3","unresolved":false,"context_lines":[{"line_number":1813,"context_line":""},{"line_number":1814,"context_line":"        return res"},{"line_number":1815,"context_line":""},{"line_number":1816,"context_line":"    def is_origin_allowed(self, cors_info, origin):"},{"line_number":1817,"context_line":"        \"\"\""},{"line_number":1818,"context_line":"        Is the given Origin allowed to make requests to this resource"},{"line_number":1819,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_e82043fa","line":1816,"updated":"2017-12-14 23:36:33.000000000","message":"Huh. So this is still used... somewhere?","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"5f559109f71736b3f67bfae8799d7013a0003033","unresolved":false,"context_lines":[{"line_number":1813,"context_line":""},{"line_number":1814,"context_line":"        return res"},{"line_number":1815,"context_line":""},{"line_number":1816,"context_line":"    def is_origin_allowed(self, cors_info, origin):"},{"line_number":1817,"context_line":"        \"\"\""},{"line_number":1818,"context_line":"        Is the given Origin allowed to make requests to this resource"},{"line_number":1819,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_13435cb1","line":1816,"in_reply_to":"df87a7cf_d3df340a","updated":"2017-12-15 00:41:34.000000000","message":"Looks dead to me. I\u0027ll take it out.","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a94d4175d35a16956dd31db3ae3eaab277f54ed1","unresolved":false,"context_lines":[{"line_number":1813,"context_line":""},{"line_number":1814,"context_line":"        return res"},{"line_number":1815,"context_line":""},{"line_number":1816,"context_line":"    def is_origin_allowed(self, cors_info, origin):"},{"line_number":1817,"context_line":"        \"\"\""},{"line_number":1818,"context_line":"        Is the given Origin allowed to make requests to this resource"},{"line_number":1819,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_d3df340a","line":1816,"in_reply_to":"df87a7cf_e82043fa","updated":"2017-12-15 00:15:55.000000000","message":"... unittests didn\u0027t seem to think so?","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f81f8a83dc12071d92b276ad47353a72405511e3","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"        \"\"\""},{"line_number":1842,"context_line":"        # Prepare the default response"},{"line_number":1843,"context_line":"        headers \u003d {\u0027Allow\u0027: \u0027, \u0027.join(self.allowed_methods)}"},{"line_number":1844,"context_line":"        return Response(status\u003d200, request\u003dreq, headers\u003dheaders)"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_a8131bb8","line":1844,"updated":"2017-12-14 23:36:33.000000000","message":"Well this is just wonderfully simple now :-)","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d09cb10f1001a10a1ad21fb1250876b4f669448b","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            # Not a CORS request so make the call as normal"},{"line_number":284,"context_line":"            return func(*a, **kw)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    return wrapped"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"def get_object_info(env, app, path\u003dNone, swift_source\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_d365f41e","side":"PARENT","line":286,"updated":"2017-12-18 19:49:07.000000000","message":"it just keeps getting better!","commit_id":"99b89aea1051208e3d71afa35fcd62035e702628"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"98fa5b4c38cde73f73110b3fff80d163b775243f","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    \"\"\""},{"line_number":221,"context_line":"    @functools.wraps(func)"},{"line_number":222,"context_line":"    def wrapped(*a, **kw):"},{"line_number":223,"context_line":"        controller \u003d a[0]"},{"line_number":224,"context_line":"        req \u003d a[1]"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        # The logic here was interpreted from"},{"line_number":227,"context_line":"        #    http://www.w3.org/TR/cors/#resource-requests"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_332d5243","side":"PARENT","line":224,"range":{"start_line":223,"start_character":8,"end_line":224,"end_character":18},"updated":"2018-01-03 02:22:02.000000000","message":"OK, given these, it seems reasonable to assume that there are no third-party middlewares relying on this function, which is nice.","commit_id":"99b89aea1051208e3d71afa35fcd62035e702628"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"98fa5b4c38cde73f73110b3fff80d163b775243f","unresolved":false,"context_lines":[{"line_number":1957,"context_line":"        if cors.get(\u0027max_age\u0027) is not None:"},{"line_number":1958,"context_line":"            headers[\u0027access-control-max-age\u0027] \u003d cors.get(\u0027max_age\u0027)"},{"line_number":1959,"context_line":""},{"line_number":1960,"context_line":"        headers[\u0027access-control-allow-methods\u0027] \u003d \\"},{"line_number":1961,"context_line":"            \u0027, \u0027.join(self.allowed_methods)"},{"line_number":1962,"context_line":""},{"line_number":1963,"context_line":"        # Allow all headers requested in the request. The CORS"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_41d2805e","side":"PARENT","line":1960,"updated":"2018-01-03 02:22:02.000000000","message":"We lost this header. Without it, browsers complain:\n\n\u003e Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://saio:8090/v1/AUTH_test/c/o2. (Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’).","commit_id":"99b89aea1051208e3d71afa35fcd62035e702628"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"7cf36a88b2c4fa3fa7d53ae371c3689d480ff53d","unresolved":false,"context_lines":[{"line_number":1957,"context_line":"        if cors.get(\u0027max_age\u0027) is not None:"},{"line_number":1958,"context_line":"            headers[\u0027access-control-max-age\u0027] \u003d cors.get(\u0027max_age\u0027)"},{"line_number":1959,"context_line":""},{"line_number":1960,"context_line":"        headers[\u0027access-control-allow-methods\u0027] \u003d \\"},{"line_number":1961,"context_line":"            \u0027, \u0027.join(self.allowed_methods)"},{"line_number":1962,"context_line":""},{"line_number":1963,"context_line":"        # Allow all headers requested in the request. The CORS"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_f6ab411a","side":"PARENT","line":1960,"in_reply_to":"9f91af0f_41d2805e","updated":"2018-01-04 00:04:32.000000000","message":"Done","commit_id":"99b89aea1051208e3d71afa35fcd62035e702628"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"98fa5b4c38cde73f73110b3fff80d163b775243f","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        \u0027bytes\u0027: headers.get(\u0027x-container-bytes-used\u0027),"},{"line_number":180,"context_line":"        \u0027versions\u0027: headers.get(\u0027x-versions-location\u0027),"},{"line_number":181,"context_line":"        \u0027storage_policy\u0027: headers.get(\u0027x-backend-storage-policy-index\u0027, \u00270\u0027),"},{"line_number":182,"context_line":"        \u0027cors\u0027: {"},{"line_number":183,"context_line":"            \u0027allow_origin\u0027: meta.get(\u0027access-control-allow-origin\u0027),"},{"line_number":184,"context_line":"            \u0027expose_headers\u0027: meta.get(\u0027access-control-expose-headers\u0027),"},{"line_number":185,"context_line":"            \u0027max_age\u0027: meta.get(\u0027access-control-max-age\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_730bda8d","line":182,"updated":"2018-01-03 02:22:02.000000000","message":"OK, so we still know *something* about CORS stuff in here, but not *that* much...","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"7cf36a88b2c4fa3fa7d53ae371c3689d480ff53d","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        \u0027bytes\u0027: headers.get(\u0027x-container-bytes-used\u0027),"},{"line_number":180,"context_line":"        \u0027versions\u0027: headers.get(\u0027x-versions-location\u0027),"},{"line_number":181,"context_line":"        \u0027storage_policy\u0027: headers.get(\u0027x-backend-storage-policy-index\u0027, \u00270\u0027),"},{"line_number":182,"context_line":"        \u0027cors\u0027: {"},{"line_number":183,"context_line":"            \u0027allow_origin\u0027: meta.get(\u0027access-control-allow-origin\u0027),"},{"line_number":184,"context_line":"            \u0027expose_headers\u0027: meta.get(\u0027access-control-expose-headers\u0027),"},{"line_number":185,"context_line":"            \u0027max_age\u0027: meta.get(\u0027access-control-max-age\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_d6087dda","line":182,"in_reply_to":"9f91af0f_730bda8d","updated":"2018-01-04 00:04:32.000000000","message":"Yeah, this should probably get pulled out at some point too. Maybe I\u0027ll toss it in a dependent patch.","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"}],"swift/proxy/server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c339944e33eb767091b5340a3d728f647703c0fc","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                               else [])},"},{"line_number":69,"context_line":"    {\u0027name\u0027: \u0027cors\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":70,"context_line":"        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027,"},{"line_number":71,"context_line":"        \u0027tempauth\u0027, \u0027keystoneauth\u0027]},"},{"line_number":72,"context_line":"    {\u0027name\u0027: \u0027listing_formats\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":73,"context_line":"        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},"},{"line_number":74,"context_line":"    # Put copy before dlo, slo and versioned_writes"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_cd331113","line":71,"updated":"2017-12-15 00:13:39.000000000","message":"I guess this is covered in the commit message but I worried about this if you\u0027re using a 3-rd parth auth system (like swauth)\n\nis there really nothing better we can do?","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"5f559109f71736b3f67bfae8799d7013a0003033","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                               else [])},"},{"line_number":69,"context_line":"    {\u0027name\u0027: \u0027cors\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":70,"context_line":"        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027,"},{"line_number":71,"context_line":"        \u0027tempauth\u0027, \u0027keystoneauth\u0027]},"},{"line_number":72,"context_line":"    {\u0027name\u0027: \u0027listing_formats\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":73,"context_line":"        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},"},{"line_number":74,"context_line":"    # Put copy before dlo, slo and versioned_writes"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_d39734eb","line":71,"in_reply_to":"df87a7cf_cd331113","updated":"2017-12-15 00:41:34.000000000","message":"What I was looking to do was the following:\n\n* not have CORS stuff on SLO/DLO segment responses (no client sees those headers anyway)\n\n* not have CORS stuff on responses that auth rejects\n\n* have cors-middleware\u0027s requests get logged by proxy-logging\n\nHaving CORS after auth was mostly because that\u0027s where it was before.\n\nI think we can get all the good properties here by moving cors-middleware before auth and only adding CORS headers to 2xx responses.\n\nThoughts?","commit_id":"052fc5ba11274cdaa538792d921bf6d0f938e719"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d09cb10f1001a10a1ad21fb1250876b4f669448b","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                               if pipe.startswith(\u0027catch_errors\u0027)"},{"line_number":68,"context_line":"                               else [])},"},{"line_number":69,"context_line":"    {\u0027name\u0027: \u0027cors\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":70,"context_line":"        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},"},{"line_number":71,"context_line":"    {\u0027name\u0027: \u0027listing_formats\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":72,"context_line":"        \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027, \u0027memcache\u0027]},"},{"line_number":73,"context_line":"    # Put copy before dlo, slo and versioned_writes"}],"source_content_type":"text/x-python","patch_set":4,"id":"df87a7cf_82158ae7","line":70,"updated":"2017-12-18 19:49:07.000000000","message":"NICE!","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f50d9b29ad03b77c160cd6748290bdb22dbd234e","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    {\u0027name\u0027: \u0027versioned_writes\u0027, \u0027after_fn\u0027: lambda _junk: ["},{"line_number":81,"context_line":"        \u0027slo\u0027, \u0027dlo\u0027, \u0027copy\u0027, \u0027staticweb\u0027, \u0027tempauth\u0027,"},{"line_number":82,"context_line":"        \u0027keystoneauth\u0027, \u0027catch_errors\u0027, \u0027gatekeeper\u0027, \u0027proxy_logging\u0027]},"},{"line_number":83,"context_line":"]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def _label_for_policy(policy):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_bb53e76a","line":83,"updated":"2018-01-09 23:13:10.000000000","message":"OK, I think http://paste.openstack.org/show/641642/ demonstrates what goes wrong here pretty well. I can\u0027t help but feel like we\u0027ve got the dependency model backwards here, though...\n\nLike, copy *depends on* the app right of it having behavior from dlo, versioned_writes, and slo -- and to denote that, we *add copy* to dlo and versioned_writes after_fns, and slo is SOL :-/","commit_id":"0c6dfd7f61c770596ae602c13fafa961194a4f96"}],"test/unit/common/test_wsgi.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c339944e33eb767091b5340a3d728f647703c0fc","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"                tempdir, policy.ring_name + \u0027.ring.gz\u0027)"},{"line_number":1823,"context_line":""},{"line_number":1824,"context_line":"        app \u003d wsgi.loadapp(conf_path)"},{"line_number":1825,"context_line":"        proxy_app \u003d app.app.app.app.app.app.app.app.app"},{"line_number":1826,"context_line":"        self.assertEqual(proxy_app.account_ring.serialized_path,"},{"line_number":1827,"context_line":"                         account_ring_path)"},{"line_number":1828,"context_line":"        self.assertEqual(proxy_app.container_ring.serialized_path,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_4d50615f","line":1825,"updated":"2017-12-15 00:13:39.000000000","message":"rofl","commit_id":"3297664cba39c14e39351d73d2fddac34cbc6d5c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"559a4e739bc4c4a803ff7bd11f838aeed80772c9","unresolved":false,"context_lines":[{"line_number":1544,"context_line":"            exp \u003d swift.proxy.server.Application"},{"line_number":1545,"context_line":"            self.assertTrue(isinstance(app.app, exp), app.app)"},{"line_number":1546,"context_line":""},{"line_number":1547,"context_line":"    def test_proxy_unmodified_wsgi_pipeline(self):"},{"line_number":1548,"context_line":"        # Make sure things are sane even when we modify nothing"},{"line_number":1549,"context_line":"        config \u003d \"\"\""},{"line_number":1550,"context_line":"        [DEFAULT]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_c24bc028","line":1547,"updated":"2018-01-05 00:16:26.000000000","message":"This seems so horribly named now... I\u0027m sure it was perfect when we were only messing with catch_errors and gatekeeper...","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"559a4e739bc4c4a803ff7bd11f838aeed80772c9","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                          \u0027swift.common.middleware.versioned_writes\u0027,"},{"line_number":1583,"context_line":"                          \u0027swift.proxy.server\u0027])"},{"line_number":1584,"context_line":""},{"line_number":1585,"context_line":"    def test_proxy_modify_wsgi_pipeline(self):"},{"line_number":1586,"context_line":"        config \u003d \"\"\""},{"line_number":1587,"context_line":"        [DEFAULT]"},{"line_number":1588,"context_line":"        swift_dir \u003d TEMPDIR"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f91af0f_8255b8c8","line":1585,"updated":"2018-01-05 00:16:26.000000000","message":"I would love to see a test that\u0027s similarly bare, except it includes memcache. I\u0027m pretty sure that\u0027s the one that fouled me up.","commit_id":"97e396bb8dc11ad095bd34760b9d3a55c114af6d"}]}
