)]}'
{"keystone/models/revoke_model.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"b4deb01a5d770b7ce838ab9dddf5db960c212f51","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            token_values[\u0027trust_id\u0027],):"},{"line_number":201,"context_line":"        return False"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    if event.access_token_id is not None and event.access_token_id not in ("},{"line_number":204,"context_line":"            token_values[\u0027access_token_id\u0027],):"},{"line_number":205,"context_line":"        return False"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    if event.audit_id is not None and event.audit_id not in ("},{"line_number":208,"context_line":"            token_values[\u0027audit_id\u0027],):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a629dbe_09f43ef0","line":205,"range":{"start_line":203,"start_character":0,"end_line":205,"end_character":20},"updated":"2016-11-08 22:16:25.000000000","message":"will we do the same for access_token_id?","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"}],"keystone/oauth1/core.py":[{"author":{"_account_id":17860,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@gmail.com","username":"samueldmq"},"change_message_id":"ef24d89d978470200fa6b0a7af8a4035f745967b","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def delete_consumer(self, consumer_id, initiator\u003dNone):"},{"line_number":157,"context_line":"        ret \u003d self.driver.delete_consumer(consumer_id)"},{"line_number":158,"context_line":"        notifications.Audit.deleted(self._CONSUMER, consumer_id, initiator)"},{"line_number":159,"context_line":"        return ret"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def create_access_token(self, request_id, access_token_duration,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_0fca9d1a","side":"PARENT","line":158,"range":{"start_line":158,"start_character":8,"end_line":158,"end_character":75},"updated":"2016-12-20 02:38:22.000000000","message":"doesn\u0027t this send an external notification that can be used for audit ? I believe we could keep sending the notification, just do not add a callback to it","commit_id":"e28dddda024f898eece83c67374cafd742a9e309"}],"keystone/tests/unit/test_v3_oauth1.py":[{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"4ddd3a321eaa6cbccf0a09c245f6ab01249848ce","unresolved":false,"context_lines":[{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    def test_deleting_consumer_also_deletes_tokens(self):"},{"line_number":428,"context_line":"        self.test_oauth_flow()"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        # Delete consumer"},{"line_number":431,"context_line":"        consumer_id \u003d self.consumer[\u0027key\u0027]"},{"line_number":432,"context_line":"        resp \u003d self.delete(\u0027/OS-OAUTH1/consumers/%(consumer_id)s\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_22b77887","side":"PARENT","line":429,"updated":"2016-11-08 13:10:39.000000000","message":"unrelated","commit_id":"e28dddda024f898eece83c67374cafd742a9e309"},{"author":{"_account_id":18464,"name":"Richard Avelar","email":"csravelar@gmail.com","username":"razone"},"change_message_id":"94c6a1d0cbe5595107b60114a4a909fa6f5362e1","unresolved":false,"context_lines":[{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    def test_deleting_consumer_also_deletes_tokens(self):"},{"line_number":428,"context_line":"        self.test_oauth_flow()"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        # Delete consumer"},{"line_number":431,"context_line":"        consumer_id \u003d self.consumer[\u0027key\u0027]"},{"line_number":432,"context_line":"        resp \u003d self.delete(\u0027/OS-OAUTH1/consumers/%(consumer_id)s\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_d9eeabb3","side":"PARENT","line":429,"in_reply_to":"9a629dbe_22b77887","updated":"2016-11-08 15:12:25.000000000","message":"whoops!","commit_id":"e28dddda024f898eece83c67374cafd742a9e309"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"4ddd3a321eaa6cbccf0a09c245f6ab01249848ce","unresolved":false,"context_lines":[{"line_number":949,"context_line":"        consumer_ref \u003d self._create_single_consumer()"},{"line_number":950,"context_line":"        self.oauth_api.delete_consumer(consumer_ref[\u0027id\u0027])"},{"line_number":951,"context_line":""},{"line_number":952,"context_line":"        # We do not want to create a notif/revocation when deleting conusmer"},{"line_number":953,"context_line":"        # make sure notification is not sent but the conusmer is still"},{"line_number":954,"context_line":"        # deleted."},{"line_number":955,"context_line":"        self._assert_notify_not_sent(consumer_ref[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_c2a6bc52","line":952,"range":{"start_line":952,"start_character":68,"end_line":952,"end_character":76},"updated":"2016-11-08 13:10:39.000000000","message":"consumer","commit_id":"56c5282eb2881e35c2928dd0224cee0c247379a1"},{"author":{"_account_id":18464,"name":"Richard Avelar","email":"csravelar@gmail.com","username":"razone"},"change_message_id":"94c6a1d0cbe5595107b60114a4a909fa6f5362e1","unresolved":false,"context_lines":[{"line_number":949,"context_line":"        consumer_ref \u003d self._create_single_consumer()"},{"line_number":950,"context_line":"        self.oauth_api.delete_consumer(consumer_ref[\u0027id\u0027])"},{"line_number":951,"context_line":""},{"line_number":952,"context_line":"        # We do not want to create a notif/revocation when deleting conusmer"},{"line_number":953,"context_line":"        # make sure notification is not sent but the conusmer is still"},{"line_number":954,"context_line":"        # deleted."},{"line_number":955,"context_line":"        self._assert_notify_not_sent(consumer_ref[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_192f43f7","line":952,"range":{"start_line":952,"start_character":68,"end_line":952,"end_character":76},"in_reply_to":"9a629dbe_c2a6bc52","updated":"2016-11-08 15:12:25.000000000","message":"Done","commit_id":"56c5282eb2881e35c2928dd0224cee0c247379a1"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"4ddd3a321eaa6cbccf0a09c245f6ab01249848ce","unresolved":false,"context_lines":[{"line_number":950,"context_line":"        self.oauth_api.delete_consumer(consumer_ref[\u0027id\u0027])"},{"line_number":951,"context_line":""},{"line_number":952,"context_line":"        # We do not want to create a notif/revocation when deleting conusmer"},{"line_number":953,"context_line":"        # make sure notification is not sent but the conusmer is still"},{"line_number":954,"context_line":"        # deleted."},{"line_number":955,"context_line":"        self._assert_notify_not_sent(consumer_ref[\u0027id\u0027],"},{"line_number":956,"context_line":"                                     test_notifications.DELETED_OPERATION,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_e263c018","line":953,"range":{"start_line":953,"start_character":53,"end_line":953,"end_character":61},"updated":"2016-11-08 13:10:39.000000000","message":"consumer","commit_id":"56c5282eb2881e35c2928dd0224cee0c247379a1"},{"author":{"_account_id":18464,"name":"Richard Avelar","email":"csravelar@gmail.com","username":"razone"},"change_message_id":"94c6a1d0cbe5595107b60114a4a909fa6f5362e1","unresolved":false,"context_lines":[{"line_number":950,"context_line":"        self.oauth_api.delete_consumer(consumer_ref[\u0027id\u0027])"},{"line_number":951,"context_line":""},{"line_number":952,"context_line":"        # We do not want to create a notif/revocation when deleting conusmer"},{"line_number":953,"context_line":"        # make sure notification is not sent but the conusmer is still"},{"line_number":954,"context_line":"        # deleted."},{"line_number":955,"context_line":"        self._assert_notify_not_sent(consumer_ref[\u0027id\u0027],"},{"line_number":956,"context_line":"                                     test_notifications.DELETED_OPERATION,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_5939bb40","line":953,"range":{"start_line":953,"start_character":53,"end_line":953,"end_character":61},"in_reply_to":"9a629dbe_e263c018","updated":"2016-11-08 15:12:25.000000000","message":"Done","commit_id":"56c5282eb2881e35c2928dd0224cee0c247379a1"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"22ffb3c5a034ec60f58eca5fbbb8229f3a0af828","unresolved":false,"context_lines":[{"line_number":952,"context_line":""},{"line_number":953,"context_line":"        # We do not want to create a notif/revocation when deleting consumer"},{"line_number":954,"context_line":"        # make sure notification is not sent but the consumer is still"},{"line_number":955,"context_line":"        # deleted."},{"line_number":956,"context_line":"        self._assert_notify_not_sent(consumer_ref[\u0027id\u0027],"},{"line_number":957,"context_line":"                                     test_notifications.DELETED_OPERATION,"},{"line_number":958,"context_line":"                                     \u0027OS-OAUTH1:consumer\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a71b18c_924b292b","line":955,"updated":"2016-12-08 19:24:39.000000000","message":"This reads like two separate sentences.","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"}],"keystone/tests/unit/test_v3_os_revoke.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"b4deb01a5d770b7ce838ab9dddf5db960c212f51","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            self.assertTimestampEqual(utils.isotime(revoked_at),"},{"line_number":154,"context_line":"                                      events[0][\u0027revoked_at\u0027])"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    # deleting consumer should no longer cause a revocation event to occur"},{"line_number":157,"context_line":"    # therefore there should be no events returned from delete_consumer"},{"line_number":158,"context_line":"    def test_access_token_id_not_in_event(self):"},{"line_number":159,"context_line":"        ref \u003d {\u0027description\u0027: uuid.uuid4().hex}"},{"line_number":160,"context_line":"        resp \u003d self.post(\u0027/OS-OAUTH1/consumers\u0027, body\u003d{\u0027consumer\u0027: ref})"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a629dbe_89ba0e22","line":157,"range":{"start_line":156,"start_character":0,"end_line":157,"end_character":71},"updated":"2016-11-08 22:16:25.000000000","message":"nit pick: these should be in the test case\n\nalso, explain why we are no long creating revocations events upon deletion, and what we are doing instead (checking the token)","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"22ffb3c5a034ec60f58eca5fbbb8229f3a0af828","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                                      events[0][\u0027revoked_at\u0027])"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    # deleting consumer should no longer cause a revocation event to occur"},{"line_number":157,"context_line":"    # therefore there should be no events returned from delete_consumer"},{"line_number":158,"context_line":"    def test_access_token_id_not_in_event(self):"},{"line_number":159,"context_line":"        ref \u003d {\u0027description\u0027: uuid.uuid4().hex}"},{"line_number":160,"context_line":"        resp \u003d self.post(\u0027/OS-OAUTH1/consumers\u0027, body\u003d{\u0027consumer\u0027: ref})"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a71b18c_725bedf6","line":157,"in_reply_to":"9a629dbe_76b46534","updated":"2016-12-08 19:24:39.000000000","message":"++ agreed!","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"2a559f5db87aab40568c4415cb9418a31ec9528a","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            self.assertTimestampEqual(utils.isotime(revoked_at),"},{"line_number":154,"context_line":"                                      events[0][\u0027revoked_at\u0027])"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    # deleting consumer should no longer cause a revocation event to occur"},{"line_number":157,"context_line":"    # therefore there should be no events returned from delete_consumer"},{"line_number":158,"context_line":"    def test_access_token_id_not_in_event(self):"},{"line_number":159,"context_line":"        ref \u003d {\u0027description\u0027: uuid.uuid4().hex}"},{"line_number":160,"context_line":"        resp \u003d self.post(\u0027/OS-OAUTH1/consumers\u0027, body\u003d{\u0027consumer\u0027: ref})"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a629dbe_76b46534","line":157,"range":{"start_line":156,"start_character":0,"end_line":157,"end_character":71},"in_reply_to":"9a629dbe_89ba0e22","updated":"2016-11-10 13:04:24.000000000","message":"++\n\nmaybe as a docstring in the test","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"}],"keystone/token/provider.py":[{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"4ddd3a321eaa6cbccf0a09c245f6ab01249848ce","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _validate_consumer(self, token):"},{"line_number":134,"context_line":"        # Check consumer_id is valid if it is in the token"},{"line_number":135,"context_line":"        if token[\u0027consumer_id\u0027]:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                self.oauth_api.get_consumer(token[\u0027consumer_id\u0027])"},{"line_number":138,"context_line":"            except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_c254fc22","line":135,"range":{"start_line":135,"start_character":11,"end_line":135,"end_character":31},"updated":"2016-11-08 13:10:39.000000000","message":"at this point, this key is always set, right?","commit_id":"56c5282eb2881e35c2928dd0224cee0c247379a1"},{"author":{"_account_id":18464,"name":"Richard Avelar","email":"csravelar@gmail.com","username":"razone"},"change_message_id":"94c6a1d0cbe5595107b60114a4a909fa6f5362e1","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _validate_consumer(self, token):"},{"line_number":134,"context_line":"        # Check consumer_id is valid if it is in the token"},{"line_number":135,"context_line":"        if token[\u0027consumer_id\u0027]:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                self.oauth_api.get_consumer(token[\u0027consumer_id\u0027])"},{"line_number":138,"context_line":"            except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a629dbe_54b8a2e5","line":135,"range":{"start_line":135,"start_character":11,"end_line":135,"end_character":31},"in_reply_to":"9a629dbe_c254fc22","updated":"2016-11-08 15:12:25.000000000","message":"consumer_id in token will always be set, but this checks if it is set to None, or set to an actual consumer_id since it can usually be None as is the case with other token fields. Unfortunately, my comment is pretty vague by saying \"if it is in the token\" ill reword this :)","commit_id":"56c5282eb2881e35c2928dd0224cee0c247379a1"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"b4deb01a5d770b7ce838ab9dddf5db960c212f51","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _validate_consumer(self, token):"},{"line_number":134,"context_line":"        # Check consumer_id is not None to validate against table"},{"line_number":135,"context_line":"        if token[\u0027consumer_id\u0027]:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                self.oauth_api.get_consumer(token[\u0027consumer_id\u0027])"},{"line_number":138,"context_line":"            except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a629dbe_6e08602e","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":32},"updated":"2016-11-08 22:16:25.000000000","message":"should this be:\n\n  if \u0027consumer_id\u0027 in token and token[\u0027consumer_id\u0027]:\n\n?","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"2a559f5db87aab40568c4415cb9418a31ec9528a","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _validate_consumer(self, token):"},{"line_number":134,"context_line":"        # Check consumer_id is not None to validate against table"},{"line_number":135,"context_line":"        if token[\u0027consumer_id\u0027]:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                self.oauth_api.get_consumer(token[\u0027consumer_id\u0027])"},{"line_number":138,"context_line":"            except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a629dbe_76e2a530","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":32},"in_reply_to":"9a629dbe_6e08602e","updated":"2016-11-10 13:04:24.000000000","message":"had the same doubt, but looks like it is set.","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"22ffb3c5a034ec60f58eca5fbbb8229f3a0af828","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _validate_consumer(self, token):"},{"line_number":134,"context_line":"        # Check consumer_id is not None to validate against table"},{"line_number":135,"context_line":"        if token[\u0027consumer_id\u0027]:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                self.oauth_api.get_consumer(token[\u0027consumer_id\u0027])"},{"line_number":138,"context_line":"            except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a71b18c_32a415b8","line":135,"in_reply_to":"9a629dbe_76e2a530","updated":"2016-12-08 19:24:39.000000000","message":"This will fail if consumer_id is not a key in token. I would suggest trying Steve\u0027s approach. That looks to be the safest.","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"b4deb01a5d770b7ce838ab9dddf5db960c212f51","unresolved":false,"context_lines":[{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        token_values \u003d self.revoke_api.model.build_token_values_v2("},{"line_number":149,"context_line":"            token_data, CONF.identity.default_domain_id)"},{"line_number":150,"context_line":"        self._validate_consumer(token_values)"},{"line_number":151,"context_line":"        self.revoke_api.check_token(token_values)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def check_revocation_v3(self, token):"},{"line_number":154,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a629dbe_295bc22f","line":151,"range":{"start_line":150,"start_character":0,"end_line":151,"end_character":49},"updated":"2016-11-08 22:16:25.000000000","message":"a random observation, maybe we should create a method called \n\n  _check_revocation_common(token)\n\nwhere we do common things, cause 150-151 and 159-160 are the same","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"22ffb3c5a034ec60f58eca5fbbb8229f3a0af828","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        token_values \u003d self.revoke_api.model.build_token_values_v2("},{"line_number":149,"context_line":"            token_data, CONF.identity.default_domain_id)"},{"line_number":150,"context_line":"        self._validate_consumer(token_values)"},{"line_number":151,"context_line":"        self.revoke_api.check_token(token_values)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def check_revocation_v3(self, token):"},{"line_number":154,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a71b18c_d21a0117","line":151,"in_reply_to":"9a629dbe_295bc22f","updated":"2016-12-08 19:24:39.000000000","message":"++ that wouldn\u0027t be a bad idea... the less duplicate paths we have here the better.","commit_id":"9ea29374c12580a7d1c611a1bf69a7f5629726e4"}]}
