Skip to content

Commit

Permalink
Truncate ARI timestamps to 1-second resolution (letsencrypt#7784)
Browse files Browse the repository at this point in the history
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 letsencrypt#7779
  • Loading branch information
aarongable authored and jefferyq2 committed Nov 5, 2024
1 parent 8b12b12 commit 83cc692
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
}
}
Expand All @@ -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,
}
Expand Down

0 comments on commit 83cc692

Please sign in to comment.