)]}'
{"doc/middleware/.gitignore":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0db42bfb1b82fe5417f20fcb5423a5ea2866a0d3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"dab17558_9c0b6d7d","line":3,"updated":"2016-05-12 18:58:42.000000000","message":"I think these would be covered by the root .gitignore?","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"803e2b4ed3d05416fe619c645ca5bca55b174c96","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"dab17558_0b07031e","line":3,"in_reply_to":"dab17558_4cb4aed0","updated":"2016-05-13 14:39:53.000000000","message":"Tim: The main reason I put this here, was so someone intending to write their own middleware could just copy the middleware directory somewhere and have a good starting point.  But maybe you are right, putting this here maybe assumes they will use git, which might not be the case.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":21231,"name":"Bryan Keller","email":"kellerbr@us.ibm.com","username":"bkeller"},"change_message_id":"1452a9aaed410031cd7b8b323c7e28c23d3a712c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"dab17558_4cb4aed0","line":3,"in_reply_to":"dab17558_9c0b6d7d","updated":"2016-05-12 20:51:58.000000000","message":"The root .gitignore has *.egg-info and *.py[co]","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"}],"doc/middleware/README.md":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1e5a25a70e892401fb1f5e7cbbc2a1b53b70b59d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Sample Middleware"},{"line_number":2,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"Reference middleware to be used as an example/starting point for OpenStack swift"},{"line_number":5,"context_line":"middleware.  The provided example has been written with the proxy server in mind, but could easily be adapted to work as  account/container/object middleware."},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Usage"}],"source_content_type":"text/x-gfm","patch_set":1,"id":"dae33548_ff30fb57","line":4,"updated":"2016-02-18 15:58:58.000000000","message":"Swift","commit_id":"363aca49e66cda4b7dbed614074a3d521e2d7e1a"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1e5a25a70e892401fb1f5e7cbbc2a1b53b70b59d","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"```Shell"},{"line_number":33,"context_line":"$ cd $PATH_TO_MIDDLEWARE"},{"line_number":34,"context_line":"$ sudo python setyp.py [install|develop]"},{"line_number":35,"context_line":"```"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"And don\u0027t forget to add it to your pipeline in proxy-server.conf as follows:"}],"source_content_type":"text/x-gfm","patch_set":1,"id":"dae33548_3f8543ce","line":34,"range":{"start_line":34,"start_character":14,"end_line":34,"end_character":19},"updated":"2016-02-18 15:58:58.000000000","message":"setup.py","commit_id":"363aca49e66cda4b7dbed614074a3d521e2d7e1a"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1e5a25a70e892401fb1f5e7cbbc2a1b53b70b59d","unresolved":false,"context_lines":[{"line_number":87,"context_line":"Say you had the following Pipeline"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"```INI"},{"line_number":90,"context_line":"pipeline \u003d ... sample1 sample2 sampel3 ..."},{"line_number":91,"context_line":"```"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"When the proxy is started, functions/methods would be executed as follows:"}],"source_content_type":"text/x-gfm","patch_set":1,"id":"dae33548_1f631f43","line":90,"range":{"start_line":90,"start_character":31,"end_line":90,"end_character":38},"updated":"2016-02-18 15:58:58.000000000","message":"sample3","commit_id":"363aca49e66cda4b7dbed614074a3d521e2d7e1a"},{"author":{"_account_id":21231,"name":"Bryan Keller","email":"kellerbr@us.ibm.com","username":"bkeller"},"change_message_id":"1452a9aaed410031cd7b8b323c7e28c23d3a712c","unresolved":false,"context_lines":[{"line_number":76,"context_line":"Pipeline"},{"line_number":77,"context_line":"--------"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"The pipeline defines the order which middleware is executed.  Middleware on the left hand side wraps middleware on the right hand side.  Each name in the pipeline will use it\u0027s corresponding section in the config to determine the code that is loaded."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"The config section is named with the convention \"[filter:sample]\" where \"sample\" is the name that was added to the pipeline."},{"line_number":82,"context_line":""}],"source_content_type":"text/x-gfm","patch_set":2,"id":"dab17558_0aad6688","line":79,"updated":"2016-05-12 20:51:58.000000000","message":"I know Swift always calls it left and right but perhaps something like \"first in the pipeline wraps middleware that is farther into the pipeline\" is probably more accessible to people who aren\u0027t already knee-deep into middleware. That might be considered inconsistent though.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"803e2b4ed3d05416fe619c645ca5bca55b174c96","unresolved":false,"context_lines":[{"line_number":76,"context_line":"Pipeline"},{"line_number":77,"context_line":"--------"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"The pipeline defines the order which middleware is executed.  Middleware on the left hand side wraps middleware on the right hand side.  Each name in the pipeline will use it\u0027s corresponding section in the config to determine the code that is loaded."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"The config section is named with the convention \"[filter:sample]\" where \"sample\" is the name that was added to the pipeline."},{"line_number":82,"context_line":""}],"source_content_type":"text/x-gfm","patch_set":2,"id":"dab17558_e6563605","line":79,"in_reply_to":"dab17558_0aad6688","updated":"2016-05-13 14:39:53.000000000","message":"Good point.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"}],"doc/middleware/sample/middleware.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0db42bfb1b82fe5417f20fcb5423a5ea2866a0d3","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            print(\u0027request for object: {0} belonging to {1}/{2}\u0027.format("},{"line_number":41,"context_line":"                  o, a, c))"},{"line_number":42,"context_line":"        elif c and v \u003d\u003d \u0027v1\u0027:"},{"line_number":43,"context_line":"            print(\u0027request for container: {0} beloning to {1}\u0027.format(c, a))"},{"line_number":44,"context_line":"        elif a and v \u003d\u003d \u0027v1\u0027:"},{"line_number":45,"context_line":"            print(\u0027request for account: {0}\u0027.format(a))"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_dc53356b","line":43,"range":{"start_line":43,"start_character":46,"end_line":43,"end_character":54},"updated":"2016-05-12 18:58:42.000000000","message":"nit: belonging","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":21231,"name":"Bryan Keller","email":"kellerbr@us.ibm.com","username":"bkeller"},"change_message_id":"1452a9aaed410031cd7b8b323c7e28c23d3a712c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            :param headers: list of tuples represnting the headers to be"},{"line_number":53,"context_line":"                            returned."},{"line_number":54,"context_line":"                            For example: [(\u0027Content-Type\u0027, \u0027text/plain\u0027), ...]"},{"line_number":55,"context_line":"            :param exc_info: ..."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            :returns: the response from the next middleware in the pipeline."},{"line_number":58,"context_line":"            \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_4a780ef9","line":55,"range":{"start_line":55,"start_character":29,"end_line":55,"end_character":32},"updated":"2016-05-12 20:51:58.000000000","message":"?","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"803e2b4ed3d05416fe619c645ca5bca55b174c96","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            :param headers: list of tuples represnting the headers to be"},{"line_number":53,"context_line":"                            returned."},{"line_number":54,"context_line":"                            For example: [(\u0027Content-Type\u0027, \u0027text/plain\u0027), ...]"},{"line_number":55,"context_line":"            :param exc_info: ..."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            :returns: the response from the next middleware in the pipeline."},{"line_number":58,"context_line":"            \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_66b9a62e","line":55,"range":{"start_line":55,"start_character":29,"end_line":55,"end_character":32},"in_reply_to":"dab17558_4a780ef9","updated":"2016-05-13 14:39:53.000000000","message":"Yeah, I should have put TODO there instead so I could have grepped for it.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"}],"doc/middleware/sample/simple.py":[{"author":{"_account_id":21231,"name":"Bryan Keller","email":"kellerbr@us.ibm.com","username":"bkeller"},"change_message_id":"1452a9aaed410031cd7b8b323c7e28c23d3a712c","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"    def __call__(self, env, start_response):"},{"line_number":14,"context_line":"        \"\"\""},{"line_number":15,"context_line":"        The entry point for your middleware, this get\u0027s called with"},{"line_number":16,"context_line":"        every request to Swift."},{"line_number":17,"context_line":"        \"\"\""},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_4ac64e17","line":15,"range":{"start_line":15,"start_character":50,"end_line":15,"end_character":55},"updated":"2016-05-12 20:51:58.000000000","message":"gets","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"}],"doc/middleware/sample/webhook.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0db42bfb1b82fe5417f20fcb5423a5ea2866a0d3","unresolved":false,"context_lines":[{"line_number":20,"context_line":"        self.app \u003d app"},{"line_number":21,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\u0027webhook\u0027)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # TODO: what does wsgify do?"},{"line_number":24,"context_line":"    @wsgify"},{"line_number":25,"context_line":"    def __call__(self, req):"},{"line_number":26,"context_line":"        obj \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_82d5c4ba","line":23,"updated":"2016-05-12 18:58:42.000000000","message":"wsgify\n- turns the WSGI environment into a swob.Request,\n- expects a callable (usually a swob.Response, but could be the underlying app) to be returned,\n- handles calling start_response so the middleware doesn\u0027t have to, and\n- catches HTTPExceptions to use as Responses.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":21231,"name":"Bryan Keller","email":"kellerbr@us.ibm.com","username":"bkeller"},"change_message_id":"1452a9aaed410031cd7b8b323c7e28c23d3a712c","unresolved":false,"context_lines":[{"line_number":20,"context_line":"        self.app \u003d app"},{"line_number":21,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\u0027webhook\u0027)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # TODO: what does wsgify do?"},{"line_number":24,"context_line":"    @wsgify"},{"line_number":25,"context_line":"    def __call__(self, req):"},{"line_number":26,"context_line":"        obj \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_6a3fd2d6","line":23,"in_reply_to":"dab17558_82d5c4ba","updated":"2016-05-12 20:51:58.000000000","message":"Done","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0db42bfb1b82fe5417f20fcb5423a5ea2866a0d3","unresolved":false,"context_lines":[{"line_number":28,"context_line":"            (version, account, container, obj) \u003d \\"},{"line_number":29,"context_line":"                split_path(req.path_info, 4, 4, True)"},{"line_number":30,"context_line":"        except ValueError:"},{"line_number":31,"context_line":"            # not an object request"},{"line_number":32,"context_line":"            pass"},{"line_number":33,"context_line":"        if \u0027x-webhook\u0027 in req.headers:"},{"line_number":34,"context_line":"            # translate user\u0027s request header to sysmeta"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_6230a008","line":31,"range":{"start_line":31,"start_character":21,"end_line":31,"end_character":27},"updated":"2016-05-12 18:58:42.000000000","message":"Don\u0027t we want to handle both object and container requests?","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"803e2b4ed3d05416fe619c645ca5bca55b174c96","unresolved":false,"context_lines":[{"line_number":28,"context_line":"            (version, account, container, obj) \u003d \\"},{"line_number":29,"context_line":"                split_path(req.path_info, 4, 4, True)"},{"line_number":30,"context_line":"        except ValueError:"},{"line_number":31,"context_line":"            # not an object request"},{"line_number":32,"context_line":"            pass"},{"line_number":33,"context_line":"        if \u0027x-webhook\u0027 in req.headers:"},{"line_number":34,"context_line":"            # translate user\u0027s request header to sysmeta"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_a636eeb1","line":31,"range":{"start_line":31,"start_character":21,"end_line":31,"end_character":27},"in_reply_to":"dab17558_6230a008","updated":"2016-05-13 14:39:53.000000000","message":"Probably, but initially I just took the existing example here: https://github.com/openstack/swift/blob/master/doc/source/development_middleware.rst and was adding some comments to it.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0db42bfb1b82fe5417f20fcb5423a5ea2866a0d3","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            webhook \u003d container_info[\u0027sysmeta\u0027].get(\u0027webhook\u0027)"},{"line_number":46,"context_line":"            if webhook:"},{"line_number":47,"context_line":"                # create a POST request with obj name as body"},{"line_number":48,"context_line":"                webhook_req \u003d urllib2.Request(webhook, data\u003dobj)"},{"line_number":49,"context_line":"                with Timeout(20):"},{"line_number":50,"context_line":"                    try:"},{"line_number":51,"context_line":"                        urllib2.urlopen(webhook_req).read()"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_d63031eb","line":48,"range":{"start_line":48,"start_character":30,"end_line":48,"end_character":37},"updated":"2016-05-12 18:58:42.000000000","message":"I think there\u0027s an eventlet-friendly HTTP client in https://github.com/openstack/swift/blob/master/swift/common/bufferedhttp.py that might be better to use. I\u0027ve not really played around with it, though.","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"beb17a161fd31a220537fef96fdc4e51e2cfc96b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"def filter_factory(global_conf, **local_conf):"},{"line_number":66,"context_line":"    conf \u003d {key.lower(): value for (key, value) in local_conf.iteritems()}"},{"line_number":67,"context_line":"    #TODO: remove: conf \u003d global_conf.copy()"},{"line_number":68,"context_line":"    #TODO: remove: conf.update(local_conf)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    register_swift_info(MIDDLEWARE_NAME)"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_9cc9adaf","line":68,"updated":"2016-05-12 17:54:54.000000000","message":"looks like this was already done?","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"0db42bfb1b82fe5417f20fcb5423a5ea2866a0d3","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    register_swift_info(MIDDLEWARE_NAME)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def webhook_filter(app, conf):"},{"line_number":73,"context_line":"        return WebhookMiddleware(app)"},{"line_number":74,"context_line":"    return webhook_filter"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_36737db6","line":73,"range":{"start_line":72,"start_character":4,"end_line":73,"end_character":37},"updated":"2016-05-12 18:58:42.000000000","message":"I think you wanted\n\n    def webhook_filter(app):\n        return WebhookMiddleware(app, conf)","commit_id":"9d450b8d5c828cd0385333778fa0abaa5738270e"}]}
