Skip to content

Conversation

@MatthewHelmer
Copy link

@MatthewHelmer MatthewHelmer commented Feb 23, 2023

Closes #66
GCloudAuthorizedUser::from_string defaults the token's expiry_time to None, which causes Token::has_expired to always return false. This results in AuthenticationManager::get_token never refreshing a token that was retrieved via a GCloudAuthorizedUser. I have refactored InnerToken to store expiry time as an OffsetDateTime instead of an Option<OffsetDateTime>, and that will default to 1 hour in the future (3600 seconds).

@MatthewHelmer MatthewHelmer changed the title Default token expiry #66 Default token expiry Feb 23, 2023
@MatthewHelmer MatthewHelmer requested a review from djc March 5, 2023 13:54
Copy link
Owner

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry -- a few more nits, I'm pretty sure this is the last round!

Copy link
Owner

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for persisting through this review cycle!

@djc djc merged commit 4f03eeb into djc:master Mar 14, 2023
@MatthewHelmer
Copy link
Author

@djc It's no trouble at all - thank you for the rigorous review! I appreciate the commitment to quality. This is the first time I've submitted to an open-source project, so I'm excited to have done it :)

@MatthewHelmer MatthewHelmer deleted the default-token-expiry branch March 14, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tokens fetched via a GCloudAuthorizedUser do not refresh

2 participants