tisonkun commented on code in PR #634:
URL: https://github.com/apache/opendal-reqsign/pull/634#discussion_r2377743052
##########
services/azure-storage/src/provide_credential/azure_cli.rs:
##########
@@ -96,12 +96,12 @@ impl ProvideCredential for AzureCliCredentialProvider {
// Calculate expiration time
let expires_on = if let Some(timestamp) = token.expires_on_timestamp {
- Some(chrono::DateTime::from_timestamp(timestamp, 0).unwrap())
+ Some(jiff::Timestamp::new(timestamp, 0).unwrap())
} else if let Some(expires_str) = token.expires_on {
// Parse the string format "2023-10-31 21:59:10.000000"
- chrono::NaiveDateTime::parse_from_str(&expires_str, "%Y-%m-%d
%H:%M:%S%.f")
+ jiff::civil::DateTime::strptime("%Y-%m-%d %H:%M:%S%.f",
&expires_str)
+ .and_then(|dt| jiff::tz::TimeZone::UTC.to_timestamp(dt))
Review Comment:
cc @Xuanwo is this an issue from Azure Storage that they explicitly declare
the expires_on string is of UTC but returned without a timezone?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]