Skip to content

Commit 5a16e76

Browse files
committed
Add SameWindow() method for ARI
1 parent e2a2d1a commit 5a16e76

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

acme/ari.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ func (ari RenewalInfo) HasWindow() bool {
110110
return !ari.SuggestedWindow.Start.IsZero() && !ari.SuggestedWindow.End.IsZero()
111111
}
112112

113+
// SameWindow returns true if this ARI has the same window as the ARI passed in.
114+
// Note that suggested windows can move in either direction, expand, or contract,
115+
// so this method compares both start and end values for exact equality.
116+
func (ari RenewalInfo) SameWindow(other RenewalInfo) bool {
117+
return ari.SuggestedWindow.Start.Equal(other.SuggestedWindow.Start) &&
118+
ari.SuggestedWindow.End.Equal(other.SuggestedWindow.End)
119+
}
120+
113121
// GetRenewalInfo returns the ACME Renewal Information (ARI) for the certificate.
114122
// It fills in the Retry-After value, if present, onto the returned struct so
115123
// the caller can poll appropriately. If the ACME server does not support ARI,

0 commit comments

Comments
 (0)