Truncate ARI timestamps to millisecond resolution (#485)

It's not useful, and somewhat surprising, for ARI timestamps to have
nanosecond precision. Truncate them to millisecond precision to make
life easier on clients, and to do something different from Boulder
(which truncates to whole-second precision).

Fixes https://github.com/letsencrypt/pebble/issues/483
This commit is contained in:
Aaron Gable 2025-02-21 15:01:28 -08:00 committed by GitHub
parent bc21177aca
commit 9a99831fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -285,8 +285,8 @@ func RenewalInfoSimple(issued time.Time, expires time.Time, now time.Time) *Rene
return &RenewalInfo{
SuggestedWindow: SuggestedWindow{
Start: windowStart,
End: windowEnd,
Start: windowStart.Truncate(time.Millisecond),
End: windowEnd.Truncate(time.Millisecond),
},
}
}
@ -300,8 +300,8 @@ func RenewalInfoImmediate(now time.Time) *RenewalInfo {
oneHourAgo := now.Add(-1 * time.Hour)
return &RenewalInfo{
SuggestedWindow: SuggestedWindow{
Start: oneHourAgo,
End: oneHourAgo.Add(1 * time.Second),
Start: oneHourAgo.Truncate(time.Millisecond),
End: oneHourAgo.Add(1 * time.Second).Truncate(time.Millisecond),
},
}
}