)]}'
{"keystone/models/revoke_model.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"05843f7872044837ef5e1cd331801979611a8ec7","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                              key, revoke_event_data)"},{"line_number":401,"context_line":"                    continue"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"            revoke_event \u003d RevokeEvent(**filtered_data)"},{"line_number":404,"context_line":"        except Exception:"},{"line_number":405,"context_line":"            LOG.debug(\"Failed to deserialize RevokeEvent. Data is %r\","},{"line_number":406,"context_line":"                      revoke_event_data)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_10c0a529","line":403,"updated":"2016-08-22 21:52:17.000000000","message":"This doesn\u0027t seem safe because we could get an invalid RevokeEvent (one created with no arguments, for example).","commit_id":"6e9a6453fdf6a919295dc289166e4b40e23e37f4"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"e0696f543c2156ac7558224a383e1ed40372b9fd","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                              key, revoke_event_data)"},{"line_number":401,"context_line":"                    continue"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"            revoke_event \u003d RevokeEvent(**filtered_data)"},{"line_number":404,"context_line":"        except Exception:"},{"line_number":405,"context_line":"            LOG.debug(\"Failed to deserialize RevokeEvent. Data is %r\","},{"line_number":406,"context_line":"                      revoke_event_data)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_01685986","line":403,"in_reply_to":"1ac06dbe_10c0a529","updated":"2016-08-22 23:13:00.000000000","message":"We should raise an exception from RevokeEvent init in that case and/or we should confirm that those types of events would match nothing, which would be \"ok\" to have.","commit_id":"6e9a6453fdf6a919295dc289166e4b40e23e37f4"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3a38fe02a593a173bc87714722644ed23bdc181e","unresolved":false,"context_lines":[{"line_number":402,"context_line":""},{"line_number":403,"context_line":"            revoke_event \u003d RevokeEvent(**filtered_data)"},{"line_number":404,"context_line":"        except Exception:"},{"line_number":405,"context_line":"            LOG.debug(\"Failed to deserialize RevokeEvent. Data is %r\","},{"line_number":406,"context_line":"                      revoke_event_data)"},{"line_number":407,"context_line":"            raise"},{"line_number":408,"context_line":"        return revoke_event"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_01ffb9aa","line":405,"updated":"2016-08-22 23:13:59.000000000","message":"A failure here should probably just go to the backend and try that data first.","commit_id":"6e9a6453fdf6a919295dc289166e4b40e23e37f4"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0221bb1308a31f977f73d869ae8260d2dcaaaca1","unresolved":false,"context_lines":[{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def deserialize(self, data):"},{"line_number":371,"context_line":"        revoke_event_data \u003d msgpackutils.loads(data, registry\u003dself._registry)"},{"line_number":372,"context_line":"        filtered_data \u003d {}"},{"line_number":373,"context_line":"        try:"},{"line_number":374,"context_line":"            for key, value in revoke_event_data.items():"},{"line_number":375,"context_line":"                # NOTE(notmorgan): This loop is designed to ensure we"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_89eeabb2","line":372,"updated":"2016-08-24 16:31:32.000000000","message":"this could be moved into the try since it\u0027s only used there.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"1c483eacd2c08d4295df163170d5776ba0fe6620","unresolved":false,"context_lines":[{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def deserialize(self, data):"},{"line_number":371,"context_line":"        revoke_event_data \u003d msgpackutils.loads(data, registry\u003dself._registry)"},{"line_number":372,"context_line":"        filtered_data \u003d {}"},{"line_number":373,"context_line":"        try:"},{"line_number":374,"context_line":"            for key, value in revoke_event_data.items():"},{"line_number":375,"context_line":"                # NOTE(notmorgan): This loop is designed to ensure we"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_f3761705","line":372,"in_reply_to":"1ac06dbe_89eeabb2","updated":"2016-08-24 22:02:47.000000000","message":"No reason to add more to a try block than is required. My philosophy is keep the try block very narrow so extraneous things aren\u0027t happening in it including binding a name to the empty dict initialization.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"1195922f48a1e6909b6105fa02df0fcb5fe5a458","unresolved":false,"context_lines":[{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def deserialize(self, data):"},{"line_number":371,"context_line":"        revoke_event_data \u003d msgpackutils.loads(data, registry\u003dself._registry)"},{"line_number":372,"context_line":"        filtered_data \u003d {}"},{"line_number":373,"context_line":"        try:"},{"line_number":374,"context_line":"            for key, value in revoke_event_data.items():"},{"line_number":375,"context_line":"                # NOTE(notmorgan): This loop is designed to ensure we"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_00825200","line":372,"in_reply_to":"1ac06dbe_f3761705","updated":"2016-08-25 11:45:22.000000000","message":"++ for kipping the try block slim","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"834f1ad23ad97aa421e0a6c17710c9842366a4e0","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        revoke_event_data \u003d msgpackutils.loads(data, registry\u003dself._registry)"},{"line_number":372,"context_line":"        filtered_data \u003d {}"},{"line_number":373,"context_line":"        try:"},{"line_number":374,"context_line":"            for key, value in revoke_event_data.items():"},{"line_number":375,"context_line":"                # NOTE(notmorgan): This loop is designed to ensure we"},{"line_number":376,"context_line":"                # do not somehow deserialize the RevokeEvent in a bizzare"},{"line_number":377,"context_line":"                # way resulting in the wrong kind(s) of data. It explicitly"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_01d72f24","line":374,"updated":"2016-08-24 17:48:47.000000000","message":"Instead of doing all of this, would it be possible to just only serialize the correct keys to begin with?","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"1c483eacd2c08d4295df163170d5776ba0fe6620","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        revoke_event_data \u003d msgpackutils.loads(data, registry\u003dself._registry)"},{"line_number":372,"context_line":"        filtered_data \u003d {}"},{"line_number":373,"context_line":"        try:"},{"line_number":374,"context_line":"            for key, value in revoke_event_data.items():"},{"line_number":375,"context_line":"                # NOTE(notmorgan): This loop is designed to ensure we"},{"line_number":376,"context_line":"                # do not somehow deserialize the RevokeEvent in a bizzare"},{"line_number":377,"context_line":"                # way resulting in the wrong kind(s) of data. It explicitly"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_33c6ef16","line":374,"in_reply_to":"1ac06dbe_01d72f24","updated":"2016-08-24 22:02:47.000000000","message":"I\u0027m more interested in squashing the de-serialize being weird than making serialize more sane in this case.\n\nWe can do both, but this is far more important at the moment as even serializing the keys as you describe could result in an error\u0027d case here.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"49ae120cbae35e802d133cde1b4842548c53954e","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        revoke_event_data \u003d msgpackutils.loads(data, registry\u003dself._registry)"},{"line_number":372,"context_line":"        filtered_data \u003d {}"},{"line_number":373,"context_line":"        try:"},{"line_number":374,"context_line":"            for key, value in revoke_event_data.items():"},{"line_number":375,"context_line":"                # NOTE(notmorgan): This loop is designed to ensure we"},{"line_number":376,"context_line":"                # do not somehow deserialize the RevokeEvent in a bizzare"},{"line_number":377,"context_line":"                # way resulting in the wrong kind(s) of data. It explicitly"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_aded3cb9","line":374,"in_reply_to":"1ac06dbe_33c6ef16","updated":"2016-08-25 11:26:04.000000000","message":"Do we know what is actually causing this? We should probably have a test with an example that would cause the breakage.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"834f1ad23ad97aa421e0a6c17710c9842366a4e0","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                # the RevokeEvent."},{"line_number":383,"context_line":"                if isinstance(key, (str, bytes)):"},{"line_number":384,"context_line":"                    if key not in REVOKE_KEYS:"},{"line_number":385,"context_line":"                        LOG.debug(\u0027Unknown key `%r` found in deserialized data\u0027"},{"line_number":386,"context_line":"                                  \u0027 `%r`\u0027, key, revoke_event_data)"},{"line_number":387,"context_line":"                        continue"},{"line_number":388,"context_line":"                    if isinstance(key, six.binary_type):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_61dc2347","line":385,"updated":"2016-08-24 17:48:47.000000000","message":"++","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0221bb1308a31f977f73d869ae8260d2dcaaaca1","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                # the RevokeEvent."},{"line_number":383,"context_line":"                if isinstance(key, (str, bytes)):"},{"line_number":384,"context_line":"                    if key not in REVOKE_KEYS:"},{"line_number":385,"context_line":"                        LOG.debug(\u0027Unknown key `%r` found in deserialized data\u0027"},{"line_number":386,"context_line":"                                  \u0027 `%r`\u0027, key, revoke_event_data)"},{"line_number":387,"context_line":"                        continue"},{"line_number":388,"context_line":"                    if isinstance(key, six.binary_type):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_a9e447ac","line":385,"range":{"start_line":385,"start_character":47,"end_line":385,"end_character":51},"updated":"2016-08-24 16:31:32.000000000","message":"using %r already puts strings and bytes in \u0027, so no need for extra `s.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"1c483eacd2c08d4295df163170d5776ba0fe6620","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                # the RevokeEvent."},{"line_number":383,"context_line":"                if isinstance(key, (str, bytes)):"},{"line_number":384,"context_line":"                    if key not in REVOKE_KEYS:"},{"line_number":385,"context_line":"                        LOG.debug(\u0027Unknown key `%r` found in deserialized data\u0027"},{"line_number":386,"context_line":"                                  \u0027 `%r`\u0027, key, revoke_event_data)"},{"line_number":387,"context_line":"                        continue"},{"line_number":388,"context_line":"                    if isinstance(key, six.binary_type):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_13cbf31f","line":385,"range":{"start_line":385,"start_character":47,"end_line":385,"end_character":51},"in_reply_to":"1ac06dbe_a9e447ac","updated":"2016-08-24 22:02:47.000000000","message":"Fixed in next.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0221bb1308a31f977f73d869ae8260d2dcaaaca1","unresolved":false,"context_lines":[{"line_number":391,"context_line":"                else:"},{"line_number":392,"context_line":"                    # NOTE(notmorgan): It is possible we should error"},{"line_number":393,"context_line":"                    # here, however for sanity because the revoke event is"},{"line_number":394,"context_line":"                    # unlikely to match anyway, we are not erroring out."},{"line_number":395,"context_line":"                    LOG.error(_LE(\u0027Received non-string key value when \u0027"},{"line_number":396,"context_line":"                                  \u0027deserializing RevokeEvent. This is a bug \u0027"},{"line_number":397,"context_line":"                                  \u0027and should be reported relatred to bug \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_c9bf035f","line":394,"range":{"start_line":394,"start_character":22,"end_line":394,"end_character":46},"updated":"2016-08-24 16:31:32.000000000","message":"The comment should say what happens if it does match anyway. We shouldn\u0027t be relying on luck for keystone to work.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"bf22a7d1e5dd30efdd0fad91554ba40c27f8f57f","unresolved":false,"context_lines":[{"line_number":391,"context_line":"                else:"},{"line_number":392,"context_line":"                    # NOTE(notmorgan): It is possible we should error"},{"line_number":393,"context_line":"                    # here, however for sanity because the revoke event is"},{"line_number":394,"context_line":"                    # unlikely to match anyway, we are not erroring out."},{"line_number":395,"context_line":"                    LOG.error(_LE(\u0027Received non-string key value when \u0027"},{"line_number":396,"context_line":"                                  \u0027deserializing RevokeEvent. This is a bug \u0027"},{"line_number":397,"context_line":"                                  \u0027and should be reported relatred to bug \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_4672cbae","line":394,"range":{"start_line":394,"start_character":22,"end_line":394,"end_character":46},"in_reply_to":"1ac06dbe_733a27e9","updated":"2016-08-24 22:05:35.000000000","message":"I\u0027m fine with logging and throwing out the key.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"1c483eacd2c08d4295df163170d5776ba0fe6620","unresolved":false,"context_lines":[{"line_number":391,"context_line":"                else:"},{"line_number":392,"context_line":"                    # NOTE(notmorgan): It is possible we should error"},{"line_number":393,"context_line":"                    # here, however for sanity because the revoke event is"},{"line_number":394,"context_line":"                    # unlikely to match anyway, we are not erroring out."},{"line_number":395,"context_line":"                    LOG.error(_LE(\u0027Received non-string key value when \u0027"},{"line_number":396,"context_line":"                                  \u0027deserializing RevokeEvent. This is a bug \u0027"},{"line_number":397,"context_line":"                                  \u0027and should be reported relatred to bug \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_733a27e9","line":394,"range":{"start_line":394,"start_character":22,"end_line":394,"end_character":46},"in_reply_to":"1ac06dbe_c9bf035f","updated":"2016-08-24 22:02:47.000000000","message":"So 3 options here:\n\n 1. Throw out the event, it\u0027s a bad revoke event (and log)\n\n 2. Log and throw out the key.\n\n 3. Raise an exception and prevent login.\n\nWhich way should we approach this, I\u0027ll update the comment to mirror the effect and what happens in a more generous match case.\n\nI am inclined to say Log and throw out the key, a more generous match is more secure (it rejects more tokens, but \"new\" tokens after the event\u0027s  issued at time.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0221bb1308a31f977f73d869ae8260d2dcaaaca1","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                    # unlikely to match anyway, we are not erroring out."},{"line_number":395,"context_line":"                    LOG.error(_LE(\u0027Received non-string key value when \u0027"},{"line_number":396,"context_line":"                                  \u0027deserializing RevokeEvent. This is a bug \u0027"},{"line_number":397,"context_line":"                                  \u0027and should be reported relatred to bug \u0027"},{"line_number":398,"context_line":"                                  \u0027#1609566 with: invalid key `%{key}r` \u0027"},{"line_number":399,"context_line":"                                  \u0027deserialized data: `%{data}r`\u0027),"},{"line_number":400,"context_line":"                              key, revoke_event_data)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_c9bd43d9","line":397,"range":{"start_line":397,"start_character":58,"end_line":397,"end_character":66},"updated":"2016-08-24 16:31:32.000000000","message":"related","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"1c483eacd2c08d4295df163170d5776ba0fe6620","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                    # unlikely to match anyway, we are not erroring out."},{"line_number":395,"context_line":"                    LOG.error(_LE(\u0027Received non-string key value when \u0027"},{"line_number":396,"context_line":"                                  \u0027deserializing RevokeEvent. This is a bug \u0027"},{"line_number":397,"context_line":"                                  \u0027and should be reported relatred to bug \u0027"},{"line_number":398,"context_line":"                                  \u0027#1609566 with: invalid key `%{key}r` \u0027"},{"line_number":399,"context_line":"                                  \u0027deserialized data: `%{data}r`\u0027),"},{"line_number":400,"context_line":"                              key, revoke_event_data)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_b3249fc6","line":397,"range":{"start_line":397,"start_character":58,"end_line":397,"end_character":66},"in_reply_to":"1ac06dbe_c9bd43d9","updated":"2016-08-24 22:02:47.000000000","message":"fixed in next.","commit_id":"c61a9fc0680a2d24f58493ac9ab0f3682bf2e6ec"}]}
