Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Delete bad API token files #54325
What does this PR do?
#54324 to 2019.2.1 - Deletes eauth token files if they're empty (or otherwise fail to be read)
What issues does this PR fix or reference?
If the token file was empty or we otherwise failed to deserialize the token it would cause an exception. This was a regression.
If the token file is empty or we otherwise fail to deserialize the token we delete the invalid token file.
Yes - not just ones to cover this regression, but also added a couple more to cover this whole function.
Commits signed with GPG?
I have one question about this, though - right now I'm capturing
Under the following conditions and API token should be considered invalid: - The file is empty. - We cannot deserialize the token from the file. - The token exists but has no expiration date. - The token exists but has expired. All of these conditions necessitate deleting the token file. Otherwise we should simply return an empty token.