)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adding sw_admin as an api endpoint to invalidate"},{"line_number":10,"context_line":"cached auth tokens."},{"line_number":11,"context_line":"sw_admin middleware for Admin/Op use only"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"If the path is /sw_admin and ‘enable_sw_admin’ in the"},{"line_number":14,"context_line":"proxy-server.conf is set to ‘true\u0027 -"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa6399be_ef707342","line":11,"updated":"2016-10-14 23:20:56.000000000","message":"nit: \u0027Op\u0027 -\u003e \u0027Ops\u0027","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":14,"context_line":"proxy-server.conf is set to ‘true\u0027 -"},{"line_number":15,"context_line":"$ curl http://127.0.0.1:8080/sw_admin -X DELETE -H ‘X-DELETE-TOKEN: test:tester\u0027"},{"line_number":16,"context_line":"-H \u0027x-auth-token: AUTH_tk90701b3135704effbab7d1438e2ed649\u0027"},{"line_number":17,"context_line":"will delete the cached auth tokens for user- tester in account- test."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"If ‘enable_sw_admin’ is set to ‘false’ it will respond with"},{"line_number":20,"context_line":"412 “Bad URL\"."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa6399be_6f00e366","line":17,"updated":"2016-10-14 23:20:56.000000000","message":"multiple tokens (plural?) or a single token?","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"00b2778a2f81d11412b193210af0e01837de704c","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"[filter:sw_admin]"},{"line_number":28,"context_line":"use \u003d egg:swift#sw_admin"},{"line_number":29,"context_line":"enable_sw_admin \u003d true"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"note: sw_admin middleware is meant to be extended for other types of Admin/Ops"},{"line_number":32,"context_line":"functions"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa6399be_870f1e38","line":29,"updated":"2016-10-20 15:39:10.000000000","message":"Probably must remove \"enable_sw_admin\" per the current logic","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"04a45864ba8a0040ec067142a782c183b7a97906","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"[filter:sw_admin]"},{"line_number":28,"context_line":"use \u003d egg:swift#sw_admin"},{"line_number":29,"context_line":"enable_sw_admin \u003d true"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"note: sw_admin middleware is meant to be extended for other types of Admin/Ops"},{"line_number":32,"context_line":"functions"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"ba5da102_2392f59e","line":29,"in_reply_to":"fa6399be_870f1e38","updated":"2016-10-31 15:47:53.000000000","message":"Done","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"}],"doc/manpages/proxy-server.conf.5":[{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"52b083a67cebd6cc4e5cd8d46b415b356725f794","unresolved":false,"context_lines":[{"line_number":471,"context_line":".IP \"\\fB[filter:sw_admin]\\fR\""},{"line_number":472,"context_line":".RE"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"SW-Admin middleware used for Admin/Ops functions e.g. deleting cached tokens."},{"line_number":475,"context_line":""},{"line_number":476,"context_line":".RS 3"},{"line_number":477,"context_line":".IP \"\\fBuse\\fR\""}],"source_content_type":"text/troff","patch_set":10,"id":"7a77a97e_ecbb3de3","line":474,"updated":"2016-11-23 20:02:23.000000000","message":"Nit: maybe change \"SW-Admin middleware\" to \"Admin middleware\" since this is just descriptive text (overview)?","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"7d9df466004c9e5919a26c7a40c4abd8f74206ae","unresolved":false,"context_lines":[{"line_number":471,"context_line":".IP \"\\fB[filter:sw_admin]\\fR\""},{"line_number":472,"context_line":".RE"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"SW-Admin middleware used for Admin/Ops functions e.g. deleting cached tokens."},{"line_number":475,"context_line":""},{"line_number":476,"context_line":".RS 3"},{"line_number":477,"context_line":".IP \"\\fBuse\\fR\""}],"source_content_type":"text/troff","patch_set":10,"id":"3a71b18c_28974191","line":474,"in_reply_to":"7a77a97e_ecbb3de3","updated":"2016-12-02 14:20:05.000000000","message":"Done","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"}],"doc/source/middleware.rst":[{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"52b083a67cebd6cc4e5cd8d46b415b356725f794","unresolved":false,"context_lines":[{"line_number":149,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"Swift Admin middleware provides Ops with an endpoint to delete"},{"line_number":152,"context_line":"cached auth tokens for a user. DELETE request to ``/sw_admin`` with header"},{"line_number":153,"context_line":"value for ``X-DELETE-TOKEN`` as the ``account:user`` and with valid auth"},{"line_number":154,"context_line":"token as header value for ``X-AUTH-TOKEN`` will delete the cached tokens for"},{"line_number":155,"context_line":"this user. An example request::"}],"source_content_type":"text/x-rst","patch_set":10,"id":"7a77a97e_bbe4efab","line":152,"updated":"2016-11-23 20:02:23.000000000","message":"Would it be helpful to state why an operator would want to delete the cached auth tokens?","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"7d9df466004c9e5919a26c7a40c4abd8f74206ae","unresolved":false,"context_lines":[{"line_number":149,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"Swift Admin middleware provides Ops with an endpoint to delete"},{"line_number":152,"context_line":"cached auth tokens for a user. DELETE request to ``/sw_admin`` with header"},{"line_number":153,"context_line":"value for ``X-DELETE-TOKEN`` as the ``account:user`` and with valid auth"},{"line_number":154,"context_line":"token as header value for ``X-AUTH-TOKEN`` will delete the cached tokens for"},{"line_number":155,"context_line":"this user. An example request::"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3a71b18c_c8ec0d2c","line":152,"in_reply_to":"7a77a97e_bbe4efab","updated":"2016-12-02 14:20:05.000000000","message":"Done","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"52b083a67cebd6cc4e5cd8d46b415b356725f794","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"Swift Admin middleware provides Ops with an endpoint to delete"},{"line_number":152,"context_line":"cached auth tokens for a user. DELETE request to ``/sw_admin`` with header"},{"line_number":153,"context_line":"value for ``X-DELETE-TOKEN`` as the ``account:user`` and with valid auth"},{"line_number":154,"context_line":"token as header value for ``X-AUTH-TOKEN`` will delete the cached tokens for"},{"line_number":155,"context_line":"this user. An example request::"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"7a77a97e_bbfb0f46","line":153,"updated":"2016-11-23 20:02:23.000000000","message":"maybe change \u0027as the\u0027 to \u0027in the format\u0027 or something similar","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"7d9df466004c9e5919a26c7a40c4abd8f74206ae","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"Swift Admin middleware provides Ops with an endpoint to delete"},{"line_number":152,"context_line":"cached auth tokens for a user. DELETE request to ``/sw_admin`` with header"},{"line_number":153,"context_line":"value for ``X-DELETE-TOKEN`` as the ``account:user`` and with valid auth"},{"line_number":154,"context_line":"token as header value for ``X-AUTH-TOKEN`` will delete the cached tokens for"},{"line_number":155,"context_line":"this user. An example request::"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"3a71b18c_08f7e5f5","line":153,"in_reply_to":"7a77a97e_bbfb0f46","updated":"2016-12-02 14:20:05.000000000","message":"Done","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"52b083a67cebd6cc4e5cd8d46b415b356725f794","unresolved":false,"context_lines":[{"line_number":157,"context_line":"    curl http://127.0.0.1:8080/sw_admin -X DELETE -H \u0027X-DELETE-TOKEN:"},{"line_number":158,"context_line":"    test:tester\u0027 -H \u0027x-auth-token: AUTH_tk90701b3135704effbab7d1438e2ed649\u0027"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"This may be op/administrator-only middlware available via ``/sw_admin``."},{"line_number":161,"context_line":""},{"line_number":162,"context_line":".. automodule:: swift.common.middleware.sw_admin"},{"line_number":163,"context_line":"    :members:"}],"source_content_type":"text/x-rst","patch_set":10,"id":"7a77a97e_bb76af03","line":160,"updated":"2016-11-23 20:02:23.000000000","message":"should this be more emphatic with \u0027is\u0027 in lieu of \u0027may be\u0027?","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"7d9df466004c9e5919a26c7a40c4abd8f74206ae","unresolved":false,"context_lines":[{"line_number":157,"context_line":"    curl http://127.0.0.1:8080/sw_admin -X DELETE -H \u0027X-DELETE-TOKEN:"},{"line_number":158,"context_line":"    test:tester\u0027 -H \u0027x-auth-token: AUTH_tk90701b3135704effbab7d1438e2ed649\u0027"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"This may be op/administrator-only middlware available via ``/sw_admin``."},{"line_number":161,"context_line":""},{"line_number":162,"context_line":".. automodule:: swift.common.middleware.sw_admin"},{"line_number":163,"context_line":"    :members:"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3a71b18c_28de616d","line":160,"in_reply_to":"7a77a97e_bb76af03","updated":"2016-12-02 14:20:05.000000000","message":"Done","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"}],"etc/proxy-server.conf-sample":[{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"ae6138ee26170fa2809b236b26125e99fce0320d","unresolved":false,"context_lines":[{"line_number":408,"context_line":"# node back into the load balancer pool)."},{"line_number":409,"context_line":"# disable_path \u003d"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"# Note: Put after auth in the pipeline."},{"line_number":412,"context_line":"[filter:sw_admin]"},{"line_number":413,"context_line":"use \u003d egg:swift#sw_admin"},{"line_number":414,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":8,"id":"fa6399be_be37d34b","line":411,"range":{"start_line":411,"start_character":0,"end_line":411,"end_character":39},"updated":"2016-10-20 14:24:51.000000000","message":"Since the pipeline above shows this middleware after auth, I am not sure if it is necessary to explicitly note it here.","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"04a45864ba8a0040ec067142a782c183b7a97906","unresolved":false,"context_lines":[{"line_number":408,"context_line":"# node back into the load balancer pool)."},{"line_number":409,"context_line":"# disable_path \u003d"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"# Note: Put after auth in the pipeline."},{"line_number":412,"context_line":"[filter:sw_admin]"},{"line_number":413,"context_line":"use \u003d egg:swift#sw_admin"},{"line_number":414,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":8,"id":"ba5da102_83866163","line":411,"range":{"start_line":411,"start_character":0,"end_line":411,"end_character":39},"in_reply_to":"fa6399be_be37d34b","updated":"2016-10-31 15:47:53.000000000","message":"yes you are right, no need to explicitly note it here. Had seen couple of similar references and thought nice to add, not needed though!","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"}],"swift/common/middleware/sw_admin.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"11b117bc835c86e14827fa9db72f077852e17bfd","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def DISABLED(self, req):"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":"        Returns a 503 response with \"DISABLED BY ADMIN\" in the body."},{"line_number":55,"context_line":"        :param req: swob.Request object"},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        return Response(request\u003dreq, status\u003d503, body\u003d\"FEATURE DISABLED BY ADMIN\","}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_2bd2e1d2","line":54,"updated":"2016-09-14 17:40:14.000000000","message":"It seems like it\u0027d be just as well to 404, same as if the middleware wasn\u0027t in the pipeline at all.\n\nThen you could even handle disablement down in your filter factory, with something like\n\n if config_true_value(conf.get(\u0027enable_sw_admin\u0027, \u0027False\u0027)):\n     return SWAdminMiddleware(app, conf)\n else:\n     return app","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"548c8a53659ef97ff17f28a063cd36d8528678f9","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def DISABLED(self, req):"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":"        Returns a 503 response with \"DISABLED BY ADMIN\" in the body."},{"line_number":55,"context_line":"        :param req: swob.Request object"},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        return Response(request\u003dreq, status\u003d503, body\u003d\"FEATURE DISABLED BY ADMIN\","}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_95e6ef42","line":54,"in_reply_to":"7a8ec9b2_2bd2e1d2","updated":"2016-09-27 22:37:07.000000000","message":"Done","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"11b117bc835c86e14827fa9db72f077852e17bfd","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        try:"},{"line_number":84,"context_line":"            if req.path \u003d\u003d \u0027/sw_admin\u0027:"},{"line_number":85,"context_line":"                handler \u003d self.get_request_handler(req)"},{"line_number":86,"context_line":"                return handler(req)(env, start_response)"},{"line_number":87,"context_line":"            return self.app(env, start_response)"},{"line_number":88,"context_line":"        except ValueError as error:"},{"line_number":89,"context_line":"            return HTTPBadRequest(str(error))(env, start_response)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_0b936550","line":86,"updated":"2016-09-14 17:40:14.000000000","message":"There\u0027s no auth mechanism to this? Anonymous users can remove arbitrary users\u0027 tokens? That seems ripe for abuse.","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"548c8a53659ef97ff17f28a063cd36d8528678f9","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        try:"},{"line_number":84,"context_line":"            if req.path \u003d\u003d \u0027/sw_admin\u0027:"},{"line_number":85,"context_line":"                handler \u003d self.get_request_handler(req)"},{"line_number":86,"context_line":"                return handler(req)(env, start_response)"},{"line_number":87,"context_line":"            return self.app(env, start_response)"},{"line_number":88,"context_line":"        except ValueError as error:"},{"line_number":89,"context_line":"            return HTTPBadRequest(str(error))(env, start_response)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_355c3bed","line":86,"in_reply_to":"7a8ec9b2_0b936550","updated":"2016-09-27 22:37:07.000000000","message":"moved the sw_admin in the pipeline after the auth system ; now requires valid auth token to issue the delete cache now. But I wanted to see if I could make use of env[\u0027swift_owner\u0027] or something similar to check the .admin or .reseller_admin role, not sure how to go about this as of now. will update in next patch.","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"11b117bc835c86e14827fa9db72f077852e17bfd","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                    raise ValueError("},{"line_number":111,"context_line":"                        \u0027Request method DELETE is missing Headers/Header values.\\n\u0027)"},{"line_number":112,"context_line":"            else:"},{"line_number":113,"context_line":"                raise NotImplementedError("},{"line_number":114,"context_line":"                    \u0027Request method %s is not supported.\\n\u0027 % (req.method))"},{"line_number":115,"context_line":"        else:"},{"line_number":116,"context_line":"            handler \u003d self.DISABLED"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_50b43cd0","line":113,"updated":"2016-09-14 17:40:14.000000000","message":"405 Method Not Allowed may be more appropriate.\n\nShould this support OPTIONS?","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"548c8a53659ef97ff17f28a063cd36d8528678f9","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                    raise ValueError("},{"line_number":111,"context_line":"                        \u0027Request method DELETE is missing Headers/Header values.\\n\u0027)"},{"line_number":112,"context_line":"            else:"},{"line_number":113,"context_line":"                raise NotImplementedError("},{"line_number":114,"context_line":"                    \u0027Request method %s is not supported.\\n\u0027 % (req.method))"},{"line_number":115,"context_line":"        else:"},{"line_number":116,"context_line":"            handler \u003d self.DISABLED"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_95198f25","line":113,"in_reply_to":"7a8ec9b2_50b43cd0","updated":"2016-09-27 22:37:07.000000000","message":"will update this one in next patch.","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"11b117bc835c86e14827fa9db72f077852e17bfd","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        :param user_id:"},{"line_number":122,"context_line":"        :return: boolean status"},{"line_number":123,"context_line":"        \"\"\""},{"line_number":124,"context_line":"        token \u003d self.memcache.get(\u0027AUTH_/user/%s\u0027 % (user_id))"},{"line_number":125,"context_line":"        if token is None:"},{"line_number":126,"context_line":"            raise ValueError("},{"line_number":127,"context_line":"                \u0027Invalid Account Name: %s \\n\u0027 % (user_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_6be869e3","line":124,"updated":"2016-09-14 17:40:14.000000000","message":"This seems specific to tempauth, and only with the default reseller_prefix. Do we want to support swauth (which seems to use cache keys like \u0027%(reseller_prefix)s/auth/%(token)s\u0027) or keystone\u0027s authtoken (which uses \u0027tokens/%(hash_of_token)s\u0027)?\n\nWould this maybe be better as a new feature for the respective auth systems, rather than its own middleware?","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"548c8a53659ef97ff17f28a063cd36d8528678f9","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        :param user_id:"},{"line_number":122,"context_line":"        :return: boolean status"},{"line_number":123,"context_line":"        \"\"\""},{"line_number":124,"context_line":"        token \u003d self.memcache.get(\u0027AUTH_/user/%s\u0027 % (user_id))"},{"line_number":125,"context_line":"        if token is None:"},{"line_number":126,"context_line":"            raise ValueError("},{"line_number":127,"context_line":"                \u0027Invalid Account Name: %s \\n\u0027 % (user_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_55946743","line":124,"in_reply_to":"7a8ec9b2_6be869e3","updated":"2016-09-27 22:37:07.000000000","message":"using reseller_prefix ; but I haven\u0027t tested this patch with keystone (in devstack envt) or swauth. I will update this after checking this patch in devstack with keystone.","commit_id":"94969bba5f4b74460fb492b6168264a03a7964dd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b7fca3a56745e628b2ec8464ffcd4e3c2e006ca6","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        :param start_response: WSGI callable"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        req \u003d Request(env)"},{"line_number":79,"context_line":"        if \u0027swift.authorize\u0027 in env: #and \u0027swift_owner\u0027 in env"},{"line_number":80,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":81,"context_line":"            #Unauthorized, exit"},{"line_number":82,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a8bc5a2_9057dd25","line":79,"updated":"2016-09-28 00:40:16.000000000","message":"swift_owner won\u0027t really work for you; that only makes sense in the context of a particular account (i.e., the user \"owns\" that account), whereas we\u0027re making up an endpoint that deals purely with users and tokens.\n\nSomething like\n\n if env.get(\u0027reseller_request\u0027):\n\nseems a bit more appropriate. See https://github.com/openstack/swift/blob/2.10.0/swift/common/middleware/keystoneauth.py#L216 and https://github.com/openstack/swift/blob/2.10.0/swift/common/middleware/tempauth.py#L256 for where it gets set.","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"e5348cfb980a34b685e8d658c41ba295e21d026d","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        :param start_response: WSGI callable"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        req \u003d Request(env)"},{"line_number":79,"context_line":"        if \u0027swift.authorize\u0027 in env: #and \u0027swift_owner\u0027 in env"},{"line_number":80,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":81,"context_line":"            #Unauthorized, exit"},{"line_number":82,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a98d1f4_91946a8b","line":79,"in_reply_to":"5a8bc5a2_9057dd25","updated":"2016-10-03 18:55:19.000000000","message":"Done","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b7fca3a56745e628b2ec8464ffcd4e3c2e006ca6","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        req \u003d Request(env)"},{"line_number":79,"context_line":"        if \u0027swift.authorize\u0027 in env: #and \u0027swift_owner\u0027 in env"},{"line_number":80,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":81,"context_line":"            #Unauthorized, exit"},{"line_number":82,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"},{"line_number":83,"context_line":"                return HTTPForbidden(str(\u0027Access was denied to this resource.\u0027))(env, start_response)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a8bc5a2_6be34006","line":80,"range":{"start_line":80,"start_character":28,"end_line":80,"end_character":59},"updated":"2016-09-28 00:40:16.000000000","message":"In light of the above this probably doesn\u0027t matter for this patch, but it might be educational anyway.\n\nThat\u0027s not really how env[\u0027swift.authorize\u0027] gets used. It\u0027s a callback that expects a swob.Request object and returns either a swob.Response indicating an error or None if the request should be allowed. See the object controller [1] or versioned_writes middleware [2] (or elsewhere in those files) for how it gets used.\n\nTypically, the error will be either\n\n* 401 if an invalid auth token (or no auth token) is present and anonymous access is not allowed or\n* 403 if a valid auth token *is* present but the user does not have access\n\n...although it looks like keystoneauth.py may sometimes return a 404 [3]?\n\n[1] https://github.com/openstack/swift/blob/2.10.0/swift/proxy/controllers/obj.py#L182-L184\n\n[2] https://github.com/openstack/swift/blob/2.10.0/swift/common/middleware/versioned_writes.py#L427-L429\n\n[3] https://github.com/openstack/swift/blob/2.10.0/swift/common/middleware/keystoneauth.py#L410","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"e5348cfb980a34b685e8d658c41ba295e21d026d","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        req \u003d Request(env)"},{"line_number":79,"context_line":"        if \u0027swift.authorize\u0027 in env: #and \u0027swift_owner\u0027 in env"},{"line_number":80,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":81,"context_line":"            #Unauthorized, exit"},{"line_number":82,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"},{"line_number":83,"context_line":"                return HTTPForbidden(str(\u0027Access was denied to this resource.\u0027))(env, start_response)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a98d1f4_113dba8e","line":80,"range":{"start_line":80,"start_character":28,"end_line":80,"end_character":59},"in_reply_to":"5a8bc5a2_6be34006","updated":"2016-10-03 18:55:19.000000000","message":"I couldn\u0027t use response as below, errors [1] and [2]\nresponse \u003d env[\u0027swift.authorize\u0027](req) \n            if response: \n                return response \n\n[1]. Tempauth - Valid AUTH token: fails with 403 Forbidden - because of the path- /sw_admin which doesn’t follow the a/c/o structure-fails because of no account name, gets into the req.remote_user in the denied_response method.\n         https://github.com/openstack/swift/blob/2.10.0/swift/common/middleware/tempauth.py#L483-L492\n[2]. If I return the response like above, then for - No AUTH token - 401 Unauthorized - puts the traceback in the logs like this -http://paste.openstack.org/show/583662/ ;","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b7fca3a56745e628b2ec8464ffcd4e3c2e006ca6","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    conf.update(local_conf)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def swadmin_filter(app):"},{"line_number":139,"context_line":"        if config_true_value(conf.get(\u0027enable_sw_admin\u0027, \u0027False\u0027)):"},{"line_number":140,"context_line":"            return SWAdminMiddleware(app, conf)"},{"line_number":141,"context_line":"        else:"},{"line_number":142,"context_line":"            return app"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a8bc5a2_5001d538","line":139,"updated":"2016-09-28 00:40:16.000000000","message":"I know this was my idea but...\n\nThe more I think about it, I\u0027m not sure it makes sense to have the config option. There\u0027s no difference between including this in your pipeline with it disabled and just not including it in your pipeline, right? So why not just have pipeline inclusion signal that it should be enabled?","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"2ed4ffc8b4375ea4f02178f94301d5b007b86032","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    conf.update(local_conf)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def swadmin_filter(app):"},{"line_number":139,"context_line":"        if config_true_value(conf.get(\u0027enable_sw_admin\u0027, \u0027False\u0027)):"},{"line_number":140,"context_line":"            return SWAdminMiddleware(app, conf)"},{"line_number":141,"context_line":"        else:"},{"line_number":142,"context_line":"            return app"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_33b60e8b","line":139,"in_reply_to":"5a8bc5a2_5001d538","updated":"2016-10-04 19:17:28.000000000","message":"Done","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"e5348cfb980a34b685e8d658c41ba295e21d026d","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    conf.update(local_conf)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def swadmin_filter(app):"},{"line_number":139,"context_line":"        if config_true_value(conf.get(\u0027enable_sw_admin\u0027, \u0027False\u0027)):"},{"line_number":140,"context_line":"            return SWAdminMiddleware(app, conf)"},{"line_number":141,"context_line":"        else:"},{"line_number":142,"context_line":"            return app"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a98d1f4_11321aa7","line":139,"in_reply_to":"5a8bc5a2_5001d538","updated":"2016-10-03 18:55:19.000000000","message":"So I just remove the enable_sw_admin option from the proxy-config ? and make changes accordingly in my code ?","commit_id":"ae3b0417c768b521aac381e7972048d7bd98bd2a"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ea7d2c69f70917999e82ffb22bbfb5028efa7c21","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def __init__(self, app, conf):"},{"line_number":51,"context_line":"        self.app \u003d app"},{"line_number":52,"context_line":"        self.memcache \u003d memcached.MemcacheRing([\u0027127.0.0.1:11211\u0027])"},{"line_number":53,"context_line":"        self.reseller_prefixes, self.account_rules \u003d \\"},{"line_number":54,"context_line":"            config_read_reseller_options(conf, dict(require_group\u003d\u0027\u0027))"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_b1bad108","line":52,"updated":"2016-10-06 06:01:03.000000000","message":"We really shouldn\u0027t hardcode the memcache address here, only use this as a default. See the memcache middleware, it will look for an config value and for the memcache.conf file in /etc/swift to point to the servers memcache servers.. nothing there could be more then 1.","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"ba07f939120dca2cde16e865d1d406f8ec2e9431","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def __init__(self, app, conf):"},{"line_number":51,"context_line":"        self.app \u003d app"},{"line_number":52,"context_line":"        self.memcache \u003d memcached.MemcacheRing([\u0027127.0.0.1:11211\u0027])"},{"line_number":53,"context_line":"        self.reseller_prefixes, self.account_rules \u003d \\"},{"line_number":54,"context_line":"            config_read_reseller_options(conf, dict(require_group\u003d\u0027\u0027))"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_6bae7199","line":52,"in_reply_to":"1a95cdbc_b1bad108","updated":"2016-10-06 18:48:36.000000000","message":"Thanks Matt, fixing it partially now. will update in next patch","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ea7d2c69f70917999e82ffb22bbfb5028efa7c21","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        self.reseller_prefixes, self.account_rules \u003d \\"},{"line_number":54,"context_line":"            config_read_reseller_options(conf, dict(require_group\u003d\u0027\u0027))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def DELETE_CACHE(self, req):"},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":"        Deletes the cached auth tokens from memcached"},{"line_number":59,"context_line":"        :param req: swob.Request object"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_d1375dae","line":56,"updated":"2016-10-06 06:01:03.000000000","message":"This is very capitalised.. why\u0027s that.. should this method name be shouted? :P","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"ba07f939120dca2cde16e865d1d406f8ec2e9431","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        self.reseller_prefixes, self.account_rules \u003d \\"},{"line_number":54,"context_line":"            config_read_reseller_options(conf, dict(require_group\u003d\u0027\u0027))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def DELETE_CACHE(self, req):"},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":"        Deletes the cached auth tokens from memcached"},{"line_number":59,"context_line":"        :param req: swob.Request object"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_ab94f942","line":56,"in_reply_to":"1a95cdbc_d1375dae","updated":"2016-10-06 18:48:36.000000000","message":"Done","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ea7d2c69f70917999e82ffb22bbfb5028efa7c21","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        Deletes the cached auth tokens from memcached"},{"line_number":59,"context_line":"        :param req: swob.Request object"},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        user_id \u003d req.headers.get(\u0027X-DELETE-TOKEN\u0027)"},{"line_number":62,"context_line":"        try:"},{"line_number":63,"context_line":"            if self.delete_cached_token(user_id):"},{"line_number":64,"context_line":"                return Response(request\u003dreq, status\u003d204, body\u003d\"Deleted Tokens\","}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_f13a9997","line":61,"updated":"2016-10-06 06:01:03.000000000","message":"The header is stored in the HeaderKeyDict and so is case sensitive. So you don\u0027t need to capitalise it. Either lowercase or titled is better:\n\n  reg.headers.get(\u0027X-Delete-Token\u0027)","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"ba07f939120dca2cde16e865d1d406f8ec2e9431","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        Deletes the cached auth tokens from memcached"},{"line_number":59,"context_line":"        :param req: swob.Request object"},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        user_id \u003d req.headers.get(\u0027X-DELETE-TOKEN\u0027)"},{"line_number":62,"context_line":"        try:"},{"line_number":63,"context_line":"            if self.delete_cached_token(user_id):"},{"line_number":64,"context_line":"                return Response(request\u003dreq, status\u003d204, body\u003d\"Deleted Tokens\","}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_0b8a4d1b","line":61,"in_reply_to":"1a95cdbc_f13a9997","updated":"2016-10-06 18:48:36.000000000","message":"Done","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ea7d2c69f70917999e82ffb22bbfb5028efa7c21","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        req \u003d Request(env)"},{"line_number":79,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":80,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":81,"context_line":"            # Unauthorized, exit"},{"line_number":82,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"},{"line_number":83,"context_line":"                return HTTPForbidden(str(\u0027Access was denied to this \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_1142a510","line":80,"updated":"2016-10-06 06:01:03.000000000","message":"Would the name of this come out as denied repsonse seeing as (in tempauth) at least this is just the autorise method which wont be called until the request hits the proxy? Although I could be wrong, I\u0027ll need to test this.","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ea7d2c69f70917999e82ffb22bbfb5028efa7c21","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                handler \u003d self.DELETE_CACHE  # to delete cached tokens"},{"line_number":111,"context_line":"            else:"},{"line_number":112,"context_line":"                raise ValueError(\u0027Request method DELETE is missing \u0027"},{"line_number":113,"context_line":"                                 \u0027Headers/Header values.\\n\u0027)"},{"line_number":114,"context_line":"        else:"},{"line_number":115,"context_line":"            raise NotImplementedError("},{"line_number":116,"context_line":"                \u0027Request method %s is not supported.\\n\u0027 % (req.method))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_3145e116","line":113,"updated":"2016-10-06 06:01:03.000000000","message":"I don\u0027t really understand this error message. What Headers are you expecting, you seem to only be expecting 1. So maybe it should be something like:\n\n  Delete request missing X-Delete-Token header\n\nUnless you expect more.","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"ba07f939120dca2cde16e865d1d406f8ec2e9431","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                handler \u003d self.DELETE_CACHE  # to delete cached tokens"},{"line_number":111,"context_line":"            else:"},{"line_number":112,"context_line":"                raise ValueError(\u0027Request method DELETE is missing \u0027"},{"line_number":113,"context_line":"                                 \u0027Headers/Header values.\\n\u0027)"},{"line_number":114,"context_line":"        else:"},{"line_number":115,"context_line":"            raise NotImplementedError("},{"line_number":116,"context_line":"                \u0027Request method %s is not supported.\\n\u0027 % (req.method))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_0b916d47","line":113,"in_reply_to":"1a95cdbc_3145e116","updated":"2016-10-06 18:48:36.000000000","message":"Done","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ea7d2c69f70917999e82ffb22bbfb5028efa7c21","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        :param user_id:"},{"line_number":123,"context_line":"        :return: boolean status"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        token \u003d self.memcache.get(\u0027AUTH_/user/%s\u0027 % (user_id))"},{"line_number":126,"context_line":"        if token is None:"},{"line_number":127,"context_line":"            raise ValueError("},{"line_number":128,"context_line":"                \u0027Invalid Name/User does not exist: %s \\n\u0027 % (user_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_514c2d42","line":125,"updated":"2016-10-06 06:01:03.000000000","message":"You\u0027ve hardcoded the AITH_ reseller prefix here. Meaning it\u0027ll valurerror if any other is used.","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"ba07f939120dca2cde16e865d1d406f8ec2e9431","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        :param user_id:"},{"line_number":123,"context_line":"        :return: boolean status"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        token \u003d self.memcache.get(\u0027AUTH_/user/%s\u0027 % (user_id))"},{"line_number":126,"context_line":"        if token is None:"},{"line_number":127,"context_line":"            raise ValueError("},{"line_number":128,"context_line":"                \u0027Invalid Name/User does not exist: %s \\n\u0027 % (user_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_4b97f539","line":125,"in_reply_to":"1a95cdbc_514c2d42","updated":"2016-10-06 18:48:36.000000000","message":"Done","commit_id":"19e99cd4bcf2187eecc9d9bb9960b674fe64dfe6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_6f37034d","line":1,"updated":"2016-10-14 23:20:56.000000000","message":"Change copyright to Intel","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_4f3dadba","line":1,"in_reply_to":"fa6399be_6f37034d","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    SW-Admin middleware used for deleting cached tokens."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Admin/Op use only :"},{"line_number":28,"context_line":"    If the path is /sw_admin, and  \u0027enable_sw_admin\u0027 in the proxy-server.conf"},{"line_number":29,"context_line":"    is set to \u0027false\u0027 it will respond with 412 \"Bad URL\" as the body."},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_4fd07fc9","line":27,"updated":"2016-10-14 23:20:56.000000000","message":"Nit: \u0027Op\u0027 -\u003e \u0027Ops\u0027?","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    SW-Admin middleware used for deleting cached tokens."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Admin/Op use only :"},{"line_number":28,"context_line":"    If the path is /sw_admin, and  \u0027enable_sw_admin\u0027 in the proxy-server.conf"},{"line_number":29,"context_line":"    is set to \u0027false\u0027 it will respond with 412 \"Bad URL\" as the body."},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_f458188d","line":27,"in_reply_to":"fa6399be_4fd07fc9","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":20508,"name":"Mohit Motiani","email":"mohit.motiani@intel.com","username":"mohit.motiani"},"change_message_id":"30a6a497a26ee30fd107f52e409d940052b0dc70","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    SW-Admin middleware used for deleting cached tokens."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Admin/Op use only :"},{"line_number":28,"context_line":"    If the path is /sw_admin, and  \u0027enable_sw_admin\u0027 in the proxy-server.conf"},{"line_number":29,"context_line":"    is set to \u0027false\u0027 it will respond with 412 \"Bad URL\" as the body."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    To invalidate/delete cached auth tokens, set \u0027enable_sw_admin\u0027 to \u0027true\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_0e5ec243","line":28,"range":{"start_line":28,"start_character":33,"end_line":28,"end_character":35},"updated":"2016-10-13 20:13:19.000000000","message":"Nit: extra space","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    SW-Admin middleware used for deleting cached tokens."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Admin/Op use only :"},{"line_number":28,"context_line":"    If the path is /sw_admin, and  \u0027enable_sw_admin\u0027 in the proxy-server.conf"},{"line_number":29,"context_line":"    is set to \u0027false\u0027 it will respond with 412 \"Bad URL\" as the body."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    To invalidate/delete cached auth tokens, set \u0027enable_sw_admin\u0027 to \u0027true\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_7476c807","line":28,"range":{"start_line":28,"start_character":33,"end_line":28,"end_character":35},"in_reply_to":"fa6399be_0e5ec243","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def delete_cache(self, req):"},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":"        Deletes the cached auth tokens from memcached"},{"line_number":61,"context_line":"        :param req: swob.Request object"},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":"        user_id \u003d req.headers.get(\u0027X-Delete-Token\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_fae1132b","line":60,"updated":"2016-10-14 23:20:56.000000000","message":"can there be more than 1 token? (singular vs. plural)","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def delete_cache(self, req):"},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":"        Deletes the cached auth tokens from memcached"},{"line_number":61,"context_line":"        :param req: swob.Request object"},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":"        user_id \u003d req.headers.get(\u0027X-Delete-Token\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_54d704bf","line":60,"in_reply_to":"fa6399be_fae1132b","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :param env: WSGI environment dictionary"},{"line_number":78,"context_line":"        :param start_response: WSGI callable"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        req \u003d Request(env)"},{"line_number":81,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":82,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":83,"context_line":"            # Unauthorized, exit"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_ef523334","line":80,"updated":"2016-10-14 23:20:56.000000000","message":"suggest moving construction of Request to just before it\u0027s first used. That way it doesn\u0027t incur any overhead unless it\u0027s actually used.","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :param env: WSGI environment dictionary"},{"line_number":78,"context_line":"        :param start_response: WSGI callable"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        req \u003d Request(env)"},{"line_number":81,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":82,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":83,"context_line":"            # Unauthorized, exit"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_2fdcf973","line":80,"in_reply_to":"fa6399be_ef523334","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        return handler"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def delete_cached_token(self, user_id):"},{"line_number":122,"context_line":"        \"\"\" To delete cached tokens from memcache, for users who are no"},{"line_number":123,"context_line":"        longer valid"},{"line_number":124,"context_line":"        :param user_id:"},{"line_number":125,"context_line":"        :return: boolean status"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_1ad6c727","line":122,"updated":"2016-10-14 23:20:56.000000000","message":"same question of singular vs. plural","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        return handler"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def delete_cached_token(self, user_id):"},{"line_number":122,"context_line":"        \"\"\" To delete cached tokens from memcache, for users who are no"},{"line_number":123,"context_line":"        longer valid"},{"line_number":124,"context_line":"        :param user_id:"},{"line_number":125,"context_line":"        :return: boolean status"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_54fe2439","line":122,"in_reply_to":"fa6399be_1ad6c727","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                                                  user_id))"},{"line_number":129,"context_line":"        if token is None:"},{"line_number":130,"context_line":"            raise ValueError("},{"line_number":131,"context_line":"                \u0027Invalid Name/User does not exist: %s \\n\u0027 % (user_id))"},{"line_number":132,"context_line":"        result1 \u003d self.memcache.delete(\u0027%s/user/%s\u0027 %"},{"line_number":133,"context_line":"                                       (self.reseller_prefixes[0], user_id))"},{"line_number":134,"context_line":"        result2 \u003d self.memcache.delete(\u0027%s/token/%s\u0027 %"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_bac87b56","line":131,"updated":"2016-10-14 23:20:56.000000000","message":"I was expecting to see HTTPNotFound here. It looks like this ValueError results in HTTPBadRequest.","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                                                  user_id))"},{"line_number":129,"context_line":"        if token is None:"},{"line_number":130,"context_line":"            raise ValueError("},{"line_number":131,"context_line":"                \u0027Invalid Name/User does not exist: %s \\n\u0027 % (user_id))"},{"line_number":132,"context_line":"        result1 \u003d self.memcache.delete(\u0027%s/user/%s\u0027 %"},{"line_number":133,"context_line":"                                       (self.reseller_prefixes[0], user_id))"},{"line_number":134,"context_line":"        result2 \u003d self.memcache.delete(\u0027%s/token/%s\u0027 %"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_55129b59","line":131,"in_reply_to":"fa6399be_bac87b56","updated":"2016-10-17 20:10:02.000000000","message":"It throws 404 error (HTTPNotFound) at L69 ; just sending in the specific error string here.\n[ http://paste.openstack.org/show/585999/ ]","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            raise ValueError("},{"line_number":131,"context_line":"                \u0027Invalid Name/User does not exist: %s \\n\u0027 % (user_id))"},{"line_number":132,"context_line":"        result1 \u003d self.memcache.delete(\u0027%s/user/%s\u0027 %"},{"line_number":133,"context_line":"                                       (self.reseller_prefixes[0], user_id))"},{"line_number":134,"context_line":"        result2 \u003d self.memcache.delete(\u0027%s/token/%s\u0027 %"},{"line_number":135,"context_line":"                                       (self.reseller_prefixes[0], token))"},{"line_number":136,"context_line":"        if result1 is None and result2 is None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_3a0aab8a","line":133,"updated":"2016-10-14 23:20:56.000000000","message":"instead of reconstructing the memcache key for user_id, maybe construct once and store in a variable and then use that key here?","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            raise ValueError("},{"line_number":131,"context_line":"                \u0027Invalid Name/User does not exist: %s \\n\u0027 % (user_id))"},{"line_number":132,"context_line":"        result1 \u003d self.memcache.delete(\u0027%s/user/%s\u0027 %"},{"line_number":133,"context_line":"                                       (self.reseller_prefixes[0], user_id))"},{"line_number":134,"context_line":"        result2 \u003d self.memcache.delete(\u0027%s/token/%s\u0027 %"},{"line_number":135,"context_line":"                                       (self.reseller_prefixes[0], token))"},{"line_number":136,"context_line":"        if result1 is None and result2 is None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_cbc44761","line":133,"in_reply_to":"fa6399be_3a0aab8a","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                                       (self.reseller_prefixes[0], user_id))"},{"line_number":134,"context_line":"        result2 \u003d self.memcache.delete(\u0027%s/token/%s\u0027 %"},{"line_number":135,"context_line":"                                       (self.reseller_prefixes[0], token))"},{"line_number":136,"context_line":"        if result1 is None and result2 is None:"},{"line_number":137,"context_line":"            return True"},{"line_number":138,"context_line":"        else:"},{"line_number":139,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_9a42d7ac","line":136,"updated":"2016-10-14 23:20:56.000000000","message":"maybe just \"return not result1 and not result2\"?","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                                       (self.reseller_prefixes[0], user_id))"},{"line_number":134,"context_line":"        result2 \u003d self.memcache.delete(\u0027%s/token/%s\u0027 %"},{"line_number":135,"context_line":"                                       (self.reseller_prefixes[0], token))"},{"line_number":136,"context_line":"        if result1 is None and result2 is None:"},{"line_number":137,"context_line":"            return True"},{"line_number":138,"context_line":"        else:"},{"line_number":139,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_88ca556d","line":136,"in_reply_to":"fa6399be_9a42d7ac","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":20508,"name":"Mohit Motiani","email":"mohit.motiani@intel.com","username":"mohit.motiani"},"change_message_id":"30a6a497a26ee30fd107f52e409d940052b0dc70","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        if result1 is None and result2 is None:"},{"line_number":137,"context_line":"            return True"},{"line_number":138,"context_line":"        else:"},{"line_number":139,"context_line":"            return False"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"def filter_factory(global_conf, **local_conf):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_3533d9f7","line":139,"updated":"2016-10-13 20:13:19.000000000","message":"unit test cases does not cover the fail scenario of delete_cached_token with invalid entry of user.\nI am not sure if test_swadmin_fail_not_reseller_admin will cover the invalid entry of user.\nSomeone else should also verify.","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"68b98f345c122542e19d09614544f54fe45c9275","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :param env: WSGI environment dictionary"},{"line_number":78,"context_line":"        :param start_response: WSGI callable"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":81,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":82,"context_line":"            # Unauthorized, exit"},{"line_number":83,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa6399be_a0a8acdc","line":80,"updated":"2016-10-19 19:24:01.000000000","message":"need to check whether the request applies to this middleware (path \u003d\u003d \u0027/sw_admin\u0027) before invoking logic","commit_id":"8a5e3d04fc7ddcf0d71217a38da54501cf82c4b6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"ac26b4d1a5beb358acb69888a83681e78114fa11","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :param env: WSGI environment dictionary"},{"line_number":78,"context_line":"        :param start_response: WSGI callable"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":81,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":82,"context_line":"            # Unauthorized, exit"},{"line_number":83,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa6399be_460528c0","line":80,"in_reply_to":"fa6399be_a0a8acdc","updated":"2016-10-19 20:36:08.000000000","message":"Done","commit_id":"8a5e3d04fc7ddcf0d71217a38da54501cf82c4b6"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"00b2778a2f81d11412b193210af0e01837de704c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    If the path is /sw_admin, and \u0027enable_sw_admin\u0027 in the proxy-server.conf"},{"line_number":29,"context_line":"    is set to \u0027false\u0027 it will respond with 412 \"Bad URL\" as the body."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    To invalidate/delete cached auth tokens, set \u0027enable_sw_admin\u0027 to \u0027true\u0027"},{"line_number":32,"context_line":"    and use below command"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    e.g. $ curl http://127.0.0.1:8080/sw_admin -X DELETE -H \u0027X-DELETE-TOKEN: \\"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa6399be_9254befe","line":31,"updated":"2016-10-20 15:39:10.000000000","message":"Maybe remove \"enable_sw_admin\" part here and in Line 28 as well.","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"04a45864ba8a0040ec067142a782c183b7a97906","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    If the path is /sw_admin, and \u0027enable_sw_admin\u0027 in the proxy-server.conf"},{"line_number":29,"context_line":"    is set to \u0027false\u0027 it will respond with 412 \"Bad URL\" as the body."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    To invalidate/delete cached auth tokens, set \u0027enable_sw_admin\u0027 to \u0027true\u0027"},{"line_number":32,"context_line":"    and use below command"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    e.g. $ curl http://127.0.0.1:8080/sw_admin -X DELETE -H \u0027X-DELETE-TOKEN: \\"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5da102_438d297a","line":31,"in_reply_to":"fa6399be_9254befe","updated":"2016-10-31 15:47:53.000000000","message":"Done","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"00b2778a2f81d11412b193210af0e01837de704c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    tokens need to be deleted and \u0027X-AUTH-TOKEN\u0027 will have valid auth token"},{"line_number":39,"context_line":"    for the op/admin making this delete request."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    e.g. changes to proxy-server.conf to add/enable sw-admin middleware-"},{"line_number":42,"context_line":"    [pipeline:main]"},{"line_number":43,"context_line":"    pipeline \u003d catch_errors gatekeeper ...tempauth sw_admin ..."},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa6399be_e1144a45","line":41,"updated":"2016-10-20 15:39:10.000000000","message":"NIT s/sw-admin/sw_admin","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"04a45864ba8a0040ec067142a782c183b7a97906","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    tokens need to be deleted and \u0027X-AUTH-TOKEN\u0027 will have valid auth token"},{"line_number":39,"context_line":"    for the op/admin making this delete request."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    e.g. changes to proxy-server.conf to add/enable sw-admin middleware-"},{"line_number":42,"context_line":"    [pipeline:main]"},{"line_number":43,"context_line":"    pipeline \u003d catch_errors gatekeeper ...tempauth sw_admin ..."},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5da102_63ea2d11","line":41,"in_reply_to":"fa6399be_e1144a45","updated":"2016-10-31 15:47:53.000000000","message":"Done","commit_id":"78f3761ac6b9c2db2081843227ac47222f554a5a"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"52b083a67cebd6cc4e5cd8d46b415b356725f794","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if req.path !\u003d \u0027/sw_admin\u0027:"},{"line_number":82,"context_line":"            return self.app(env, start_response)"},{"line_number":83,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":84,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":85,"context_line":"            # Unauthorized, exit"},{"line_number":86,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"},{"line_number":87,"context_line":"                self.logger.error(\u0027Access was denied to this resource.\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a74a57a_67918cf0","line":84,"updated":"2016-11-23 20:02:23.000000000","message":"This approach strikes me as being very brittle. It would be nice if we had some methods within Request class to test if user is authenticated and another to test if user is member of a specific group.","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"7d9df466004c9e5919a26c7a40c4abd8f74206ae","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if req.path !\u003d \u0027/sw_admin\u0027:"},{"line_number":82,"context_line":"            return self.app(env, start_response)"},{"line_number":83,"context_line":"        if \u0027swift.authorize\u0027 in env and env.get(\u0027reseller_request\u0027):"},{"line_number":84,"context_line":"            auth_response \u003d env[\u0027swift.authorize\u0027].__name__"},{"line_number":85,"context_line":"            # Unauthorized, exit"},{"line_number":86,"context_line":"            if auth_response.strip().lower() \u003d\u003d \u0027denied_response\u0027:"},{"line_number":87,"context_line":"                self.logger.error(\u0027Access was denied to this resource.\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a71b18c_082a852c","line":84,"in_reply_to":"5a74a57a_67918cf0","updated":"2016-12-02 14:20:05.000000000","message":"agree with you on this. I am open to any suggestions for changing this check here. will update in next patch.","commit_id":"35f40a90b14d86eeb1ac88325cffad2c0f460663"}],"test/unit/common/middleware/test_sw_admin.py":[{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_9a70170d","line":1,"updated":"2016-10-14 23:20:56.000000000","message":"please change copyright to Intel","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":17361,"name":"Shashirekha Gundur","email":"shashirekha.j.gundur@intel.com","username":"shashirekha.j.gundur"},"change_message_id":"6f2c4786ae30356fd3272c8afc0393e64885362a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_ab4d53c6","line":1,"in_reply_to":"fa6399be_9a70170d","updated":"2016-10-17 20:10:02.000000000","message":"Done","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"},{"author":{"_account_id":18838,"name":"Paul Dardeau","email":"paul.dardeau@intel.com","username":"pdardeau"},"change_message_id":"6d11b33d173161fc31802ec647783a740ec50177","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            called[0] \u003d True"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        #  not_allowed_methods \u003d [\u0027PUT\u0027, \u0027HEAD\u0027, \u0027GET\u0027, \u0027POST\u0027]"},{"line_number":239,"context_line":"        method \u003d \u0027PUT\u0027"},{"line_number":240,"context_line":"        req \u003d Request.blank(\u0027/sw_admin\u0027, environ\u003d{"},{"line_number":241,"context_line":"            \u0027REQUEST_METHOD\u0027: method, \u0027swift.authorize\u0027: authorize,"},{"line_number":242,"context_line":"            \u0027reseller_request\u0027: True},"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_fadf53d3","line":239,"updated":"2016-10-14 23:20:56.000000000","message":"maybe iterate over all non-allowed methods","commit_id":"cddacbef00637fb07b80dbdaf58038f569a9b2f6"}]}
