Truncate ARI timestamps to 1-second resolution (#7784)

There's no reason for us to be providing nanosecond precision on ARI
timestamps, and apparently it messes up some JSON date-parsing
libraries.

Fixes https://github.com/letsencrypt/boulder/issues/7779
This commit is contained in:
Aaron Gable 2024-11-05 10:04:27 -08:00 committed by GitHub
parent 46fc4c25ab
commit 84b15eb911
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -489,8 +489,8 @@ func RenewalInfoSimple(issued time.Time, expires time.Time) RenewalInfo {
idealRenewal := expires.Add(-renewalOffset)
return RenewalInfo{
SuggestedWindow: SuggestedWindow{
Start: idealRenewal.Add(-24 * time.Hour),
End: idealRenewal.Add(24 * time.Hour),
Start: idealRenewal.Add(-24 * time.Hour).Truncate(time.Second),
End: idealRenewal.Add(24 * time.Hour).Truncate(time.Second),
},
}
}
@ -505,8 +505,8 @@ func RenewalInfoImmediate(now time.Time, explanationURL string) RenewalInfo {
oneHourAgo := now.Add(-1 * time.Hour)
return RenewalInfo{
SuggestedWindow: SuggestedWindow{
Start: oneHourAgo,
End: oneHourAgo.Add(time.Minute * 30),
Start: oneHourAgo.Truncate(time.Second),
End: oneHourAgo.Add(time.Minute * 30).Truncate(time.Second),
},
ExplanationURL: explanationURL,
}