Skip to content

Commit

Permalink
Add SameWindow() method for ARI
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed May 6, 2024
1 parent e2a2d1a commit 5a16e76
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions acme/ari.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ func (ari RenewalInfo) HasWindow() bool {
return !ari.SuggestedWindow.Start.IsZero() && !ari.SuggestedWindow.End.IsZero()
}

// SameWindow returns true if this ARI has the same window as the ARI passed in.
// Note that suggested windows can move in either direction, expand, or contract,
// so this method compares both start and end values for exact equality.
func (ari RenewalInfo) SameWindow(other RenewalInfo) bool {
return ari.SuggestedWindow.Start.Equal(other.SuggestedWindow.Start) &&
ari.SuggestedWindow.End.Equal(other.SuggestedWindow.End)
}

// GetRenewalInfo returns the ACME Renewal Information (ARI) for the certificate.
// It fills in the Retry-After value, if present, onto the returned struct so
// the caller can poll appropriately. If the ACME server does not support ARI,
Expand Down

0 comments on commit 5a16e76

Please sign in to comment.