djc / gcp_auth

Minimal authentication library for Google Cloud Platform (GCP)
Other
63 stars 38 forks source link

Default token expiry #67

Closed MatthewHelmer closed 1 year ago

MatthewHelmer commented 1 year ago

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 commented 1 year ago

@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 :)