)]}'
{"keystone/token/providers/fernet/core.py":[{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"a3d36fd740cadea0efcf39f58cb469e63d888ad3","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        :param token_ref: reference describing the token to validate"},{"line_number":144,"context_line":"        :returns: the token data"},{"line_number":145,"context_line":"        :raises keystone.exception.Unauthorized: if v3 token is used"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        \"\"\""},{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            (user_id, methods,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_e0f3ef9d","line":146,"updated":"2015-07-26 12:52:58.000000000","message":"update the docstring to raise TokenNotFound instead of Unauthorized.","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"},{"author":{"_account_id":11708,"name":"Atsuko Ito","email":"me@yottatsa.name","username":"yottatsa"},"change_message_id":"b8dd1e5d2f5f13c5f3139be178a92d4133452a85","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        :param token_ref: reference describing the token to validate"},{"line_number":144,"context_line":"        :returns: the token data"},{"line_number":145,"context_line":"        :raises keystone.exception.Unauthorized: if v3 token is used"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        \"\"\""},{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            (user_id, methods,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_611cb013","line":146,"in_reply_to":"3a50d1a3_e0f3ef9d","updated":"2015-07-27 09:49:55.000000000","message":"Done","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"a3d36fd740cadea0efcf39f58cb469e63d888ad3","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        :param token: a string describing the token to validate"},{"line_number":178,"context_line":"        :returns: the token data"},{"line_number":179,"context_line":"        :raises keystone.exception.Unauthorized: if token format version isn\u0027t"},{"line_number":180,"context_line":"                                                 supported"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_c0f8337f","line":180,"updated":"2015-07-26 12:52:58.000000000","message":"Need to update the docstring to raise \u0027TokenNotFound\u0027 instead of \u0027Unauthorized\u0027.","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"},{"author":{"_account_id":11708,"name":"Atsuko Ito","email":"me@yottatsa.name","username":"yottatsa"},"change_message_id":"b8dd1e5d2f5f13c5f3139be178a92d4133452a85","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        :param token: a string describing the token to validate"},{"line_number":178,"context_line":"        :returns: the token data"},{"line_number":179,"context_line":"        :raises keystone.exception.Unauthorized: if token format version isn\u0027t"},{"line_number":180,"context_line":"                                                 supported"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_2116a8f1","line":180,"in_reply_to":"3a50d1a3_c0f8337f","updated":"2015-07-27 09:49:55.000000000","message":"Done","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"}],"keystone/token/providers/fernet/token_formatters.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"851816aee109f14c04e70f237ee500a990a3cacb","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            return self.crypto.decrypt(token)"},{"line_number":78,"context_line":"        except fernet.InvalidToken:"},{"line_number":79,"context_line":"            raise exception.ValidationError("},{"line_number":80,"context_line":"                _(\u0027This is not a recognized Fernet payload\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    @classmethod"},{"line_number":83,"context_line":"    def creation_time(cls, fernet_token):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_32ef0ab2","line":80,"updated":"2015-07-24 16:16:00.000000000","message":"The \"payload\" actually refers to the message part of the fernet token. self.crypto.decrypt() verifies the fernet token HMAC, decrypts the message/payload, and returns the integrity-verified payload. All that to say that the proposed validation error message is slightly misleading: it\u0027s not a valid fernet token for some reason (we haven\u0027t tried to recognize the payload itself yet): it might not be a fernet token at all, it might be encrypted with a key that we don\u0027t trust, the HMAC integrity verification might have failed, etc.\n\ntl;dr I think if you change the word \"payload\" to \"token,\" then it\u0027ll be perfectly accurate.","commit_id":"ca72c853a857aaea0f7a7604c979227bd43376fa"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"a3d36fd740cadea0efcf39f58cb469e63d888ad3","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            return self.crypto.decrypt(token)"},{"line_number":78,"context_line":"        except fernet.InvalidToken:"},{"line_number":79,"context_line":"            raise exception.ValidationError("},{"line_number":80,"context_line":"                _(\u0027This is not a recognized Fernet token\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    @classmethod"},{"line_number":83,"context_line":"    def creation_time(cls, fernet_token):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_a0ede7b8","line":80,"updated":"2015-07-26 12:52:58.000000000","message":"It\u0027s the token not correct, right? so why we need change the Unauthorized exception to ValidationError? token, Unauthorized, 401 looks more accurate, anything I didn\u0027t catch?","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"},{"author":{"_account_id":11708,"name":"Atsuko Ito","email":"me@yottatsa.name","username":"yottatsa"},"change_message_id":"b8dd1e5d2f5f13c5f3139be178a92d4133452a85","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            return self.crypto.decrypt(token)"},{"line_number":78,"context_line":"        except fernet.InvalidToken:"},{"line_number":79,"context_line":"            raise exception.ValidationError("},{"line_number":80,"context_line":"                _(\u0027This is not a recognized Fernet token\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    @classmethod"},{"line_number":83,"context_line":"    def creation_time(cls, fernet_token):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_a1295839","line":80,"in_reply_to":"3a50d1a3_a0ede7b8","updated":"2015-07-27 09:49:55.000000000","message":"Token is invalid at first. Then we\u0027re catching this exception just like it was done with UUID https://github.com/openstack/keystone/blob/master/keystone/token/providers/common.py#L677","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"a3d36fd740cadea0efcf39f58cb469e63d888ad3","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                FederatedPayload.disassemble(payload))"},{"line_number":200,"context_line":"        else:"},{"line_number":201,"context_line":"            # If the token_format is not recognized, raise ValidationError."},{"line_number":202,"context_line":"            raise exception.ValidationError(_("},{"line_number":203,"context_line":"                \u0027This is not a recognized Fernet payload version: %s\u0027) %"},{"line_number":204,"context_line":"                version)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_80db0b1b","line":202,"updated":"2015-07-26 12:52:58.000000000","message":"same here, I don\u0027t understand why we need to do this change.","commit_id":"b9eae39ab9e9f4e3ce54a98ef7c0cc2ecae759bd"}]}
