From 9a99831fce2f8f72cb1124b051da99dbe133fde9 Mon Sep 17 00:00:00 2001 From: Aaron Gable Date: Fri, 21 Feb 2025 15:01:28 -0800 Subject: [PATCH] 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 --- core/types.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/types.go b/core/types.go index 175c5b1..0778195 100644 --- a/core/types.go +++ b/core/types.go @@ -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), }, } }