)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"fd3434c5e1fa9ca1e17513b46c51e1fdb5385dcd","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     hongxiaolong \u003chongxiaolong.info@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-13 23:48:29 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Allowed owners to delete token with v2 API"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When \"assert_admin\" only allows admin roles to delete tokens with v2 API,"},{"line_number":10,"context_line":"those member users logout from horizon always can not delete their own"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aaa499b_0453c8e2","line":7,"updated":"2015-04-13 16:49:31.000000000","message":"(nit): s/Allowed owners/Allow owners/","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"55535f1bc7fc1178c5c468e85fbf6fac3d03f6b3","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Allowed owners to delete token with v2 API"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When \"assert_admin\" only allows admin roles to delete tokens with v2 API,"},{"line_number":10,"context_line":"those member users logout from horizon always can not delete their own"},{"line_number":11,"context_line":"tokens resulting in large numbers of redundant tokens."},{"line_number":12,"context_line":"In fact, unuseful tokens should be allowed to delete by \"admin_or_owner\"."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aaa499b_64e84ce3","line":9,"updated":"2015-04-13 16:53:20.000000000","message":"As a guide, better to describe the problem slightly more generally, rather than leading off with a method that might not known to the reader","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"55535f1bc7fc1178c5c468e85fbf6fac3d03f6b3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When \"assert_admin\" only allows admin roles to delete tokens with v2 API,"},{"line_number":10,"context_line":"those member users logout from horizon always can not delete their own"},{"line_number":11,"context_line":"tokens resulting in large numbers of redundant tokens."},{"line_number":12,"context_line":"In fact, unuseful tokens should be allowed to delete by \"admin_or_owner\"."},{"line_number":13,"context_line":"Besides, the policy.json unable to properly handle \"delete_token\" because"},{"line_number":14,"context_line":"of the improper parameters pass to wrapper \"protected\" and oslo_policy."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aaa499b_a4b414f2","line":11,"updated":"2015-04-13 16:53:20.000000000","message":"good...telling us why this is a problem","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"55535f1bc7fc1178c5c468e85fbf6fac3d03f6b3","unresolved":false,"context_lines":[{"line_number":10,"context_line":"those member users logout from horizon always can not delete their own"},{"line_number":11,"context_line":"tokens resulting in large numbers of redundant tokens."},{"line_number":12,"context_line":"In fact, unuseful tokens should be allowed to delete by \"admin_or_owner\"."},{"line_number":13,"context_line":"Besides, the policy.json unable to properly handle \"delete_token\" because"},{"line_number":14,"context_line":"of the improper parameters pass to wrapper \"protected\" and oslo_policy."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I386c3e074790a4cdf4569929cc8f38560a35772a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aaa499b_64fa8cbf","line":13,"updated":"2015-04-13 16:53:20.000000000","message":"is this part of this patch?","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"}],"keystone/common/wsgi.py":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"b6fefa3109883f5c720449853d12cfdf50802700","unresolved":false,"context_lines":[{"line_number":315,"context_line":"            # Accept either is_admin or the admin role"},{"line_number":316,"context_line":"            self.policy_api.enforce(creds, \u0027admin_required\u0027, {})"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"    def assert_admin_or_owner(self, context):"},{"line_number":319,"context_line":"        if not context[\u0027is_admin\u0027]:"},{"line_number":320,"context_line":"            try:"},{"line_number":321,"context_line":"                user_token_ref \u003d token_model.KeystoneToken("}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_9f260567","line":318,"updated":"2015-04-13 17:13:34.000000000","message":"there is a lot of duplicate code here....in fact all but the last line.  I would suggest you should refactor the existing assert_admin to take a boolean parameter (e.g. \"allow_owner\"), defaulting to False, and then assert_admin_or_owner(self, context) would just do:\n\nassert_admin(contact, allow_owner\u003dTrue)","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"b6fefa3109883f5c720449853d12cfdf50802700","unresolved":false,"context_lines":[{"line_number":328,"context_line":"            validate_token_bind(context, user_token_ref)"},{"line_number":329,"context_line":"            creds \u003d copy.deepcopy(user_token_ref.metadata)"},{"line_number":330,"context_line":"                                                                                  "},{"line_number":331,"context_line":"            try:                                                                  "},{"line_number":332,"context_line":"                creds[\u0027user_id\u0027] \u003d user_token_ref.user_id                         "},{"line_number":333,"context_line":"            except exception.UnexpectedError:                                     "},{"line_number":334,"context_line":"                LOG.debug(\u0027Invalid user\u0027)                                         "}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_5f4cfd41","line":331,"updated":"2015-04-13 17:13:34.000000000","message":"whitespace issues","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"b6fefa3109883f5c720449853d12cfdf50802700","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # Accept either is_admin or the admin role                            "},{"line_number":345,"context_line":"            self.policy_api.enforce(creds,                                        "},{"line_number":346,"context_line":"                                    \u0027admin_or_owner\u0027,                             "},{"line_number":347,"context_line":"                                    {\u0027user_id\u0027: user_token_ref.user_id})"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"    def _attribute_is_empty(self, ref, attribute):"},{"line_number":350,"context_line":"        \"\"\"Returns true if the attribute in the given ref (which is a"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_7f469924","line":347,"updated":"2015-04-13 17:13:34.000000000","message":"isn\u0027t this always going to match?...don\u0027t you need to check whether the token_id passed into token_id is owned by the the same user?","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"}],"keystone/token/controllers.py":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"55535f1bc7fc1178c5c468e85fbf6fac3d03f6b3","unresolved":false,"context_lines":[{"line_number":448,"context_line":"    def delete_token(self, context, token_id):"},{"line_number":449,"context_line":"        \"\"\"Delete a token, effectively invalidating it for authz."},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"        Optionally, ensure that both admin and owner can delete token."},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"        \"\"\""},{"line_number":454,"context_line":"        # TODO(termie): this stuff should probably be moved to middleware"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_e488dc24","line":451,"updated":"2015-04-13 16:53:20.000000000","message":"I\u0027m not sure it is optional....I think you are simply \"Ensure that bother admin and owner can delete token.\"","commit_id":"fbd17fbffdba06173392b29c384da6804f7ce9b2"}]}
