)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":220,"name":"Haneef Ali","email":"haneef.ali@hp.com","username":"haneef"},"change_message_id":"2e817dbb93acb43b733f57958f3bf2136cdd4dd7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Disable a domain will revoke domain scoped tokens"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Disable a domain revokes project scoped tokens"},{"line_number":10,"context_line":"as well as domain scoped tokens."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I43f7624ef40b18157611d4c15f5b3c65005bd8fb"},{"line_number":13,"context_line":"Closes-Bug: #1294737"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"baada198_b2c35756","line":10,"updated":"2014-07-16 22:01:30.000000000","message":"Disable domain","commit_id":"93b33b77ab92bcf01093212dc92ec2004e0c869f"},{"author":{"_account_id":11045,"name":"Bob Thyne","email":"bob.thyne@hp.com","username":"bobt"},"change_message_id":"b86b3cdf55abb5415feb6061372cf969c22caf6f","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     chioleong \u003cchio-fai-sam.leong@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-07-21 13:54:30 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Disable a domain will revoke domain scoped tokens"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Disable a domain revokes project scoped tokens"},{"line_number":10,"context_line":"as well as revokes domain scoped tokens."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"baada198_606ea665","line":7,"updated":"2014-07-22 07:33:23.000000000","message":"For clarity, I would change the commit message to something like:\n\n\"Fix token revocation impact from disabling domain\n\nFixes a bug whereby disabling a domain only revokes project scoped tokens. Now with this fix, disabling a domain will result in both domain and project scoped tokens being disabled (if any).\n\"","commit_id":"d34f0cf09fc4a9fa944261d5ee03d931605f6737"}],"keystone/tests/test_v3_identity.py":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"0f2a1d3d5173e01d3e864fef46855092dd0ab3a7","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def test_validate_token_from_disable_domain_fails(self):"},{"line_number":385,"context_line":"        \"\"\"Test to validate a valid token previous issued from"},{"line_number":386,"context_line":"        an enable domain. And this valid token should fail to"},{"line_number":387,"context_line":"        be validated after the domain becomes disable."},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        self.domain \u003d self.new_domain_ref()"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_2b24fcc4","line":386,"updated":"2014-07-18 05:04:41.000000000","message":"Better to have a single title line, then a description, e.g.\n\n\"\"\"Test token from a disabled domain has been invalidated.\n\nTest that a token that was valid for an enabled domain becomes invalid\nonce that domain is disabled.\n\n\"\"\"\"","commit_id":"6684a9bd8dc4628bb315cc23f039dc478857bcb9"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"0f2a1d3d5173e01d3e864fef46855092dd0ab3a7","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        token_resp \u003d self.admin_request(path\u003d\u0027/v3/auth/tokens\u0027,"},{"line_number":404,"context_line":"                                        method\u003d\u0027POST\u0027,"},{"line_number":405,"context_line":"                                        body\u003dauth_body,"},{"line_number":406,"context_line":"                                        expected_status\u003d201)"},{"line_number":407,"context_line":"        subject_token \u003d token_resp.headers.get(\u0027x-subject-token\u0027)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # validates the returned token and it should be valid."}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_ee569205","line":406,"updated":"2014-07-18 05:04:41.000000000","message":"Don\u0027t need to specify the 201....this is checked by admin_request...and I think you can replace this whole call with:\n\ntoken_resp \u003d self.post(\u0027/auth/tokens\u0027, body\u003dauth_data)","commit_id":"6684a9bd8dc4628bb315cc23f039dc478857bcb9"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"0f2a1d3d5173e01d3e864fef46855092dd0ab3a7","unresolved":false,"context_lines":[{"line_number":410,"context_line":"        self.admin_request(path\u003d\u0027/v3/auth/tokens\u0027,"},{"line_number":411,"context_line":"                           headers\u003d{\u0027x-subject-token\u0027: subject_token,"},{"line_number":412,"context_line":"                                    \u0027x-auth-token\u0027: \u0027ADMIN\u0027},"},{"line_number":413,"context_line":"                           method\u003d\u0027GET\u0027, expected_status\u003d200)"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"        # now disable the domain"},{"line_number":416,"context_line":"        self.domain[\u0027enabled\u0027] \u003d False"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_6e8fe275","line":413,"updated":"2014-07-18 05:04:41.000000000","message":"...and this one by:\n\n        self.head(\u0027/auth/tokens\u0027,\n                  headers\u003d{\u0027X-Subject-Token\u0027: subject_token},\n                  expected_status\u003d200)","commit_id":"6684a9bd8dc4628bb315cc23f039dc478857bcb9"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"0f2a1d3d5173e01d3e864fef46855092dd0ab3a7","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        # now disable the domain"},{"line_number":416,"context_line":"        self.domain[\u0027enabled\u0027] \u003d False"},{"line_number":417,"context_line":"        url \u003d \"/v3/domains/%(domain_id)s\" % {\u0027domain_id\u0027: self.domain[\u0027id\u0027]}"},{"line_number":418,"context_line":"        r \u003d self.admin_request(path\u003durl, token\u003d\u0027ADMIN\u0027, method\u003d\u0027PATCH\u0027,"},{"line_number":419,"context_line":"                               body\u003d{\u0027domain\u0027: {\u0027enabled\u0027: False}},"},{"line_number":420,"context_line":"                               expected_status\u003d200)"},{"line_number":421,"context_line":"        self.assertValidDomainResponse(r, self.domain)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_0ef666f9","line":418,"updated":"2014-07-18 05:04:41.000000000","message":"as above...","commit_id":"6684a9bd8dc4628bb315cc23f039dc478857bcb9"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"0f2a1d3d5173e01d3e864fef46855092dd0ab3a7","unresolved":false,"context_lines":[{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        # validates the same token again and it should be \u0027not found\u0027"},{"line_number":424,"context_line":"        # as the domain has already been disable."},{"line_number":425,"context_line":"        self.admin_request(path\u003d\u0027/v3/auth/tokens\u0027,"},{"line_number":426,"context_line":"                           headers\u003d{\u0027x-subject-token\u0027: subject_token,"},{"line_number":427,"context_line":"                                    \u0027x-auth-token\u0027: \u0027ADMIN\u0027},"},{"line_number":428,"context_line":"                           method\u003d\u0027GET\u0027, expected_status\u003d404)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_eef21205","line":425,"updated":"2014-07-18 05:04:41.000000000","message":"as above....","commit_id":"6684a9bd8dc4628bb315cc23f039dc478857bcb9"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"0fe5227d6c1da553ac0c6f0b0f95dc5ee18709d7","unresolved":false,"context_lines":[{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        # validates the same token again and it should be \u0027not found\u0027"},{"line_number":424,"context_line":"        # as the domain has already been disable."},{"line_number":425,"context_line":"        self.admin_request(path\u003d\u0027/v3/auth/tokens\u0027,"},{"line_number":426,"context_line":"                           headers\u003d{\u0027x-subject-token\u0027: subject_token,"},{"line_number":427,"context_line":"                                    \u0027x-auth-token\u0027: \u0027ADMIN\u0027},"},{"line_number":428,"context_line":"                           method\u003d\u0027GET\u0027, expected_status\u003d404)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_1f404e34","line":425,"in_reply_to":"baada198_eef21205","updated":"2014-07-18 06:53:42.000000000","message":"Henry, these are great comments. I will fix them.","commit_id":"6684a9bd8dc4628bb315cc23f039dc478857bcb9"},{"author":{"_account_id":11045,"name":"Bob Thyne","email":"bob.thyne@hp.com","username":"bobt"},"change_message_id":"b86b3cdf55abb5415feb6061372cf969c22caf6f","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        self.delete("},{"line_number":382,"context_line":"            \u0027/domains/%(domain_id)s\u0027 % {\u0027domain_id\u0027: old_default_domain_id})"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def test_validate_token_from_disable_domain_fails(self):"},{"line_number":385,"context_line":"        \"\"\"Test token from a disabled domain has been invalidated."},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        Test that a token that was valid for an enabled domain"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_60ea26a1","line":384,"updated":"2014-07-22 07:33:23.000000000","message":"What about naming the method:\n\ntest_token_revocation_when_domain_disabled","commit_id":"d34f0cf09fc4a9fa944261d5ee03d931605f6737"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"250a965df87105d6a3a396a42fb414210afdb2a4","unresolved":false,"context_lines":[{"line_number":420,"context_line":"                   expected_status\u003d200)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        # validates the same token again and it should be \u0027not found\u0027"},{"line_number":423,"context_line":"        # as the domain has already been disable."},{"line_number":424,"context_line":"        self.head(\u0027/auth/tokens\u0027,"},{"line_number":425,"context_line":"                  headers\u003d{\u0027x-subject-token\u0027: subject_token},"},{"line_number":426,"context_line":"                  expected_status\u003d404)"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_e6488b8c","line":423,"updated":"2014-07-24 01:13:15.000000000","message":"typo, disable should be disabled","commit_id":"4b7a2d796fa5894413489d426449416a719f3290"}],"keystone/token/core.py":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"ef9de059beaf91e5f47ab0f433385419b89f5f8b","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":211,"context_line":"        # them."},{"line_number":212,"context_line":"        hints \u003d driver_hints.Hints()"},{"line_number":213,"context_line":"        hints.add_filter(\u0027domain_id\u0027, domain_id)"},{"line_number":214,"context_line":"        users \u003d self.identity_api.list_users(domain_id, hints)"},{"line_number":215,"context_line":"        for user in users:"},{"line_number":216,"context_line":"            tokens \u003d self._list_tokens(user[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_bcd6d0ef","line":213,"updated":"2014-07-16 21:57:59.000000000","message":"You don\u0027t need to put it in the hints filter, specifying domain_id should be enough (In fact the manager layer will force it into the hints filter for you)","commit_id":"93b33b77ab92bcf01093212dc92ec2004e0c869f"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"92e933b98ec8bf59ff621a3246afe936d2467fba","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":211,"context_line":"        # them."},{"line_number":212,"context_line":"        hints \u003d driver_hints.Hints()"},{"line_number":213,"context_line":"        hints.add_filter(\u0027domain_id\u0027, domain_id)"},{"line_number":214,"context_line":"        users \u003d self.identity_api.list_users(domain_id, hints)"},{"line_number":215,"context_line":"        for user in users:"},{"line_number":216,"context_line":"            tokens \u003d self._list_tokens(user[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_0ff3f9e7","line":213,"in_reply_to":"baada198_bcd6d0ef","updated":"2014-07-17 01:48:47.000000000","message":"henry-nash, thanks for the comment.\n\nI actually only passed domain_id to list_users without hints, and it returned me all the other uses who were in different domains. \n\nAnd I just tested with only passing the domain_id again, and it works. I must had done something wrong in the testing before. Thx, I will make the changes.","commit_id":"93b33b77ab92bcf01093212dc92ec2004e0c869f"},{"author":{"_account_id":220,"name":"Haneef Ali","email":"haneef.ali@hp.com","username":"haneef"},"change_message_id":"2e817dbb93acb43b733f57958f3bf2136cdd4dd7","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        hints \u003d driver_hints.Hints()"},{"line_number":213,"context_line":"        hints.add_filter(\u0027domain_id\u0027, domain_id)"},{"line_number":214,"context_line":"        users \u003d self.identity_api.list_users(domain_id, hints)"},{"line_number":215,"context_line":"        for user in users:"},{"line_number":216,"context_line":"            tokens \u003d self._list_tokens(user[\u0027id\u0027])"},{"line_number":217,"context_line":"            for token in tokens:"},{"line_number":218,"context_line":"                self.delete_token(token)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_d2b44bd6","line":215,"updated":"2014-07-16 22:01:30.000000000","message":"You are better of calling delete_tokens_for_users since it deletes trusts too","commit_id":"93b33b77ab92bcf01093212dc92ec2004e0c869f"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"92e933b98ec8bf59ff621a3246afe936d2467fba","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        hints \u003d driver_hints.Hints()"},{"line_number":213,"context_line":"        hints.add_filter(\u0027domain_id\u0027, domain_id)"},{"line_number":214,"context_line":"        users \u003d self.identity_api.list_users(domain_id, hints)"},{"line_number":215,"context_line":"        for user in users:"},{"line_number":216,"context_line":"            tokens \u003d self._list_tokens(user[\u0027id\u0027])"},{"line_number":217,"context_line":"            for token in tokens:"},{"line_number":218,"context_line":"                self.delete_token(token)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_af25ad5d","line":215,"in_reply_to":"baada198_d2b44bd6","updated":"2014-07-17 01:48:47.000000000","message":"thanks guys, thanks for the comments also, I overlooked the other APIs and I will make the changes.","commit_id":"93b33b77ab92bcf01093212dc92ec2004e0c869f"},{"author":{"_account_id":11333,"name":"David J Hu","email":"david.hu@hpe.com","username":"dhu"},"change_message_id":"b3b1f9a9528aa53806fcd09dd56bb3ed3e698a5f","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        hints.add_filter(\u0027domain_id\u0027, domain_id)"},{"line_number":214,"context_line":"        users \u003d self.identity_api.list_users(domain_id, hints)"},{"line_number":215,"context_line":"        for user in users:"},{"line_number":216,"context_line":"            tokens \u003d self._list_tokens(user[\u0027id\u0027])"},{"line_number":217,"context_line":"            for token in tokens:"},{"line_number":218,"context_line":"                self.delete_token(token)"},{"line_number":219,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_d261ab12","line":216,"updated":"2014-07-16 22:13:51.000000000","message":"Should consider calling delete_tokens_for_user().","commit_id":"93b33b77ab92bcf01093212dc92ec2004e0c869f"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"2e5f4d595d0e46b2cfffd70beefcfd3f067b2500","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            user_ids.append(user[\u0027id\u0027])"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        if user_ids:"},{"line_number":218,"context_line":"            self.delete_tokens_for_users(user_ids)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def delete_tokens_for_user(self, user_id, project_id\u003dNone):"},{"line_number":221,"context_line":"        \"\"\"Delete all tokens for a given user or user-project combination."}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_3ddcdee3","line":218,"updated":"2014-07-21 20:30:31.000000000","message":"It is safe to pass an empty list / iterator that results in no value to the delete_tokens_for_users method, suggest eliminating the extra explicit loop on line 211 (something like):\n\n    users \u003d self.identity_api.list_users(domain_id)\n    user_ids \u003d (user[\u0027id\u0027] for user in users)\n    self.delete_tokens_for_users(user_ids)\n\nThat will use a generator and save looping here just to do a similar loop at line 258.","commit_id":"edede65a4db3aff3e32a1d47b443322041d6cc8a"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"8864773918e02363b812444a499d8caaa3b3298d","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            user_ids.append(user[\u0027id\u0027])"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        if user_ids:"},{"line_number":218,"context_line":"            self.delete_tokens_for_users(user_ids)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def delete_tokens_for_user(self, user_id, project_id\u003dNone):"},{"line_number":221,"context_line":"        \"\"\"Delete all tokens for a given user or user-project combination."}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_d8993020","line":218,"in_reply_to":"baada198_3ddcdee3","updated":"2014-07-21 20:52:43.000000000","message":"that\u0027s great! It\u0027s the trick of Python, thx!","commit_id":"edede65a4db3aff3e32a1d47b443322041d6cc8a"},{"author":{"_account_id":220,"name":"Haneef Ali","email":"haneef.ali@hp.com","username":"haneef"},"change_message_id":"afeac508a392750cb06eec2f48f9e24c007099bb","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":209,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_deabc71b","line":206,"updated":"2014-07-22 05:09:58.000000000","message":"Why did you remove the comment?  Does this code remove domain scoped tokens?  I don\u0027t think so","commit_id":"d34f0cf09fc4a9fa944261d5ee03d931605f6737"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"2129a4790b022ab9b894bf02cf3ba2cf735352d0","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":209,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c89e7b69","line":206,"in_reply_to":"baada198_1e645420","updated":"2014-07-22 17:27:36.000000000","message":"henry, thanks for the detailed comment that help a lot for my understanding. I will amend the comment to make it clear to what the current patch does.","commit_id":"d34f0cf09fc4a9fa944261d5ee03d931605f6737"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"e499472790f054183f4948ded6938db5017fdfde","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":209,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_1e645420","line":206,"in_reply_to":"baada198_deabc71b","updated":"2014-07-22 07:33:36.000000000","message":"I think Haneef has valid point.  In reality there are three type of token that should be deleted/revoked by this method:\n\n- tokens scoped to projects in this domain (this is already implemented)\n- tokens scoped to this domain (this patch doesn\u0027t fully do this)\n- tokens by users of this domain on any projects/domains (this patch adds this support)\n\nIn reality the only tokens that won\u0027t be deleted after this patch are tokens scoped to this domain by users in another domain...but that is still something we should fix. \n\nWe should either fix the whole issue (which will required adding new backend helper methods I expect), or amend the comment to make the above clear, and, if there isn\u0027t a bug already, then raise one for the missing functionality.","commit_id":"d34f0cf09fc4a9fa944261d5ee03d931605f6737"},{"author":{"_account_id":11045,"name":"Bob Thyne","email":"bob.thyne@hp.com","username":"bobt"},"change_message_id":"b86b3cdf55abb5415feb6061372cf969c22caf6f","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":209,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_9ef8647d","line":206,"in_reply_to":"baada198_deabc71b","updated":"2014-07-22 07:33:23.000000000","message":"My understanding is that when a domain is disabled/deleted then this code will recover all tokens associated with the domain and delete them. Therefore, by definition, it should remove domain scoped tokens, correct? \n\nA related but separate question. Could we have achieved this via the notification framework using revocation events?","commit_id":"d34f0cf09fc4a9fa944261d5ee03d931605f6737"},{"author":{"_account_id":11333,"name":"David J Hu","email":"david.hu@hpe.com","username":"dhu"},"change_message_id":"3a1211f6e4a8b90fce0649f3c6870a993d18b3c9","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":209,"context_line":"        "},{"line_number":210,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_7b00d402","line":207,"updated":"2014-07-22 19:09:32.000000000","message":"No need of an extra line here.","commit_id":"1e6a38b913d32ba58af069c1d9a394bdaf03ddb1"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3136e66c05cef74934d1495c73d23bf749029279","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":209,"context_line":"        "},{"line_number":210,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":211,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":212,"context_line":"        # them."}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_9b4a085a","line":209,"updated":"2014-07-22 18:47:37.000000000","message":"White space. Please remove.","commit_id":"1e6a38b913d32ba58af069c1d9a394bdaf03ddb1"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"95617d4b9f3b18bac07c73862aa8e34e42151b72","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":209,"context_line":"        "},{"line_number":210,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":211,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":212,"context_line":"        # them."}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_3b1f3c72","line":209,"in_reply_to":"baada198_9b4a085a","updated":"2014-07-22 19:08:58.000000000","message":"that\u0027s easy, thx!","commit_id":"1e6a38b913d32ba58af069c1d9a394bdaf03ddb1"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"bfcbf5b219d6c34b2cbab5e3270d06a020660203","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\"Delete all tokens for a given domain.\"\"\""},{"line_number":199,"context_line":"        if not CONF.token.revoke_by_id:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        projects \u003d self.assignment_api.list_projects()"},{"line_number":202,"context_line":"        for project in projects:"},{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_7e70c240","line":201,"updated":"2014-07-22 19:24:14.000000000","message":"Don\u0027t we need api call specific to domain instead of listing all domains. e.g. self.assignment_api.list_projects_in_domain(domain_id). \n\nI am asking as change is around same functional area.","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"7eda4fd5b533b2dc47f170aa6a707121bc6469fa","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\"Delete all tokens for a given domain.\"\"\""},{"line_number":199,"context_line":"        if not CONF.token.revoke_by_id:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        projects \u003d self.assignment_api.list_projects()"},{"line_number":202,"context_line":"        for project in projects:"},{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_8a29d09d","line":201,"in_reply_to":"baada198_7e70c240","updated":"2014-07-22 21:22:44.000000000","message":"I think this is not this patch related and I would try not to make changes to this \"already working\" code.","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"1c86844bad3cff7caa3ae7bb74d5a8cf366f71d6","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\"Delete all tokens for a given domain.\"\"\""},{"line_number":199,"context_line":"        if not CONF.token.revoke_by_id:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        projects \u003d self.assignment_api.list_projects()"},{"line_number":202,"context_line":"        for project in projects:"},{"line_number":203,"context_line":"            if project[\u0027domain_id\u0027] \u003d\u003d domain_id:"},{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_c56019a7","line":201,"in_reply_to":"baada198_8a29d09d","updated":"2014-07-22 21:26:50.000000000","message":"this request is out of scope; i\u0027d also rather not add the extra complexity in the face of token revocation events solving the same problem, and doing so much more efficiently","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"bfcbf5b219d6c34b2cbab5e3270d06a020660203","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_3ef2ca9b","line":207,"updated":"2014-07-22 19:24:14.000000000","message":"Will be good to see this resolved as part of this fix or clarified in commit comments. I think henry-nash clarified about missing part in earlier version review comments.","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"7eda4fd5b533b2dc47f170aa6a707121bc6469fa","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_456249da","line":207,"in_reply_to":"baada198_3ef2ca9b","updated":"2014-07-22 21:22:44.000000000","message":"I\u0027d like to do this in a seperated patch if it\u0027s ok for everyone and that was one of the options henry-nash suggested.","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"35c7b89a2c4ce20bdc415ddd37637e9ef5ffacd3","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                for user_id in self.assignment_api.list_user_ids_for_project("},{"line_number":205,"context_line":"                        project[\u0027id\u0027]):"},{"line_number":206,"context_line":"                    self.delete_tokens_for_user(user_id, project[\u0027id\u0027])"},{"line_number":207,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_c5d5791c","line":207,"in_reply_to":"baada198_456249da","updated":"2014-07-22 21:29:29.000000000","message":"actually this TODO is what the bug is for","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"bfcbf5b219d6c34b2cbab5e3270d06a020660203","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":211,"context_line":"        # them."},{"line_number":212,"context_line":"        users \u003d self.identity_api.list_users(domain_id)"},{"line_number":213,"context_line":"        user_ids \u003d (user[\u0027id\u0027] for user in users)"},{"line_number":214,"context_line":"        self.delete_tokens_for_users(user_ids)"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_de962e3e","line":211,"updated":"2014-07-22 19:24:14.000000000","message":"Code is self-explanatory here.","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"1c86844bad3cff7caa3ae7bb74d5a8cf366f71d6","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":211,"context_line":"        # them."},{"line_number":212,"context_line":"        users \u003d self.identity_api.list_users(domain_id)"},{"line_number":213,"context_line":"        user_ids \u003d (user[\u0027id\u0027] for user in users)"},{"line_number":214,"context_line":"        self.delete_tokens_for_users(user_ids)"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_05f691f9","line":211,"in_reply_to":"baada198_655f4d10","updated":"2014-07-22 21:26:50.000000000","message":"using inline comments to explain \"why\" the code does \"what\" it does (the code already explains the \"what\")","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"7eda4fd5b533b2dc47f170aa6a707121bc6469fa","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): finds out all the users who are under the provided"},{"line_number":210,"context_line":"        # domain and find out all the tokens for each of the users and delete"},{"line_number":211,"context_line":"        # them."},{"line_number":212,"context_line":"        users \u003d self.identity_api.list_users(domain_id)"},{"line_number":213,"context_line":"        user_ids \u003d (user[\u0027id\u0027] for user in users)"},{"line_number":214,"context_line":"        self.delete_tokens_for_users(user_ids)"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_655f4d10","line":211,"in_reply_to":"baada198_de962e3e","updated":"2014-07-22 21:22:44.000000000","message":"that\u0027s right, the code clearly tells what it does. I will take out this comment.","commit_id":"1691574e84365760f7ed5e1f310fa4b2b60e3f5a"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"9bfa94a9301e93800ec99826f3e5a055ec48a5c9","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): deletes tokens for users who are under"},{"line_number":210,"context_line":"        # the domain."},{"line_number":211,"context_line":"        users \u003d self.identity_api.list_users(domain_id)"},{"line_number":212,"context_line":"        user_ids \u003d (user[\u0027id\u0027] for user in users)"},{"line_number":213,"context_line":"        self.delete_tokens_for_users(user_ids)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_d5450e70","line":210,"updated":"2014-07-23 08:37:57.000000000","message":"I don\u0027t think this needs to be a NOTE, just an inline comment.  And, to Dolphm\u0027s point, let\u0027s say why, not what, e.g.:\n\n# Any tokens issued to users that are owned by this domain should also be deleted, irrespective of what project/domain scope they have\n\nGiven that there is confusion on exactly what this method has to do, it might be good to have a doctoring intro at the start of the method, along the lines of my description in  a previous review comment.  Then a reader will clear see there are three \"tasks\" to be carried out...","commit_id":"953e586a96e00e57ce31dc948901d3ee38baee13"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"1c1807fdbbc5c68374990a1cd75d16e8aaaf8ac6","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        # TODO(morganfainberg): implement deletion of domain_scoped tokens."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # NOTE(chioleong): deletes tokens for users who are under"},{"line_number":210,"context_line":"        # the domain."},{"line_number":211,"context_line":"        users \u003d self.identity_api.list_users(domain_id)"},{"line_number":212,"context_line":"        user_ids \u003d (user[\u0027id\u0027] for user in users)"},{"line_number":213,"context_line":"        self.delete_tokens_for_users(user_ids)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_32e00b26","line":210,"in_reply_to":"baada198_d5450e70","updated":"2014-07-23 17:04:28.000000000","message":"henry-nash, this is great comment and will submit another patch for that. thx.","commit_id":"953e586a96e00e57ce31dc948901d3ee38baee13"},{"author":{"_account_id":1916,"name":"Guang Yee","email":"gyee@suse.com","username":"guang-yee"},"change_message_id":"558f391577587de1d70ed9f2dfbf3408ade8a535","unresolved":false,"context_lines":[{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        It will delete all the project_scoped tokens for a give domain"},{"line_number":201,"context_line":"        as well as any tokens issued to users that are owned by this"},{"line_number":202,"context_line":"        domain will also be deleted, irrespective of what project/domain"},{"line_number":203,"context_line":"        scope they have."},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        However, deletion of domain_scoped tokens will still need to be"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_7e97ac3a","line":202,"updated":"2014-07-23 19:09:43.000000000","message":"This sentence doesn\u0027t sound smooth. How about this?\n\nIt will delete all the project-scoped tokens for the projects that are owned by the given domain, as well as any tokens issued to users that are owned by this domain.","commit_id":"d331e552e2f3536c11e3b5ec122e5522b990eea5"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"365a00a82c5915abf0793804db34d538bf9cca7b","unresolved":false,"context_lines":[{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        It will delete all the project_scoped tokens for a give domain"},{"line_number":201,"context_line":"        as well as any tokens issued to users that are owned by this"},{"line_number":202,"context_line":"        domain will also be deleted, irrespective of what project/domain"},{"line_number":203,"context_line":"        scope they have."},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        However, deletion of domain_scoped tokens will still need to be"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_9c0c893b","line":202,"in_reply_to":"baada198_7e97ac3a","updated":"2014-07-23 19:14:42.000000000","message":"that sounds more smooth, thx!","commit_id":"d331e552e2f3536c11e3b5ec122e5522b990eea5"}]}
