Skip to content

Commit 922cd9f

Browse files
beautifulentropynatalia.astashenko
authored andcommitted
sfe: Keep loading intervals in sync with promise, fix wording (letsencrypt#8500)
Small comments to keep these three areas of our code in sync. Small fix to wording; not all of our limits are for a 1 week period.
1 parent 4e0dce3 commit 922cd9f

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

cmd/boulder-ra/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ func main() {
274274
txnBuilder, err = ratelimits.NewTransactionBuilderFromFiles(c.RA.Limiter.Defaults, c.RA.Limiter.Overrides, scope, logger)
275275
}
276276
cmd.FailOnError(err, "Failed to create rate limits transaction builder")
277+
278+
// The 30 minute period here must be kept in sync with the promise
279+
// (successCommentBody) made to requesters in sfe/overridesimporter.go
277280
overrideRefresherShutdown := txnBuilder.NewRefresher(30 * time.Minute)
278281
defer overrideRefresherShutdown()
279282
}

cmd/boulder-wfe2/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ func main() {
348348
txnBuilder, err = ratelimits.NewTransactionBuilderFromFiles(c.WFE.Limiter.Defaults, c.WFE.Limiter.Overrides, stats, logger)
349349
}
350350
cmd.FailOnError(err, "Failed to create rate limits transaction builder")
351+
352+
// The 30 minute period here must be kept in sync with the promise
353+
// (successCommentBody) made to requesters in sfe/overridesimporter.go
351354
overridesRefresherShutdown = txnBuilder.NewRefresher(30 * time.Minute)
352355
}
353356

sfe/overridesimporter.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,14 @@ func (im *OverridesImporter) processTicket(ctx context.Context, ticketID int64,
261261
return fmt.Errorf("override for rate limit %s and account/domain/IP: %s is administratively disabled", rateLimit, accountDomainOrIP)
262262
}
263263

264+
// The "30 minutes" promised in the comment below must be kept in sync with
265+
// the override reloading interval values (overrideRefresherShutdown) in:
266+
// - cmd/boulder-ra/main.go and
267+
// - cmd/boulder-wfe/main.go
264268
successCommentBody := fmt.Sprintf(
265269
"Your override request for rate limit %s and account/domain/IP: %s "+
266-
"has been approved. Your new limit is %d per week. Please allow up to 30 minutes for this change to take effect.",
270+
"has been approved. Your new limit is %d per period (see: https://letsencrypt.org/docs/rate-limits for the period). "+
271+
"Please allow up to 30 minutes for this change to take effect.",
267272
rateLimit, accountDomainOrIP, req.Count,
268273
)
269274

sfe/overridesimporter_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func TestOverridesImporterProcessTicketHappyPath(t *testing.T) {
158158
expectCount: 1000,
159159
expectPeriod: 7 * 24 * time.Hour,
160160
expectOrgComment: "Acme Corp",
161-
expectLastCommentSubstring: "has been approved. Your new limit is 1000 per week",
161+
expectLastCommentSubstring: "has been approved. Your new limit is 1000 per period",
162162
},
163163
{
164164
name: "CertificatesPerDomain with valid Registered Domain",
@@ -175,7 +175,7 @@ func TestOverridesImporterProcessTicketHappyPath(t *testing.T) {
175175
expectCount: 300,
176176
expectPeriod: 7 * 24 * time.Hour,
177177
expectOrgComment: "Acme Corp",
178-
expectLastCommentSubstring: "has been approved. Your new limit is 300 per week",
178+
expectLastCommentSubstring: "has been approved. Your new limit is 300 per period",
179179
},
180180
{
181181
name: "CertificatesPerDomain with valid IPv4 Address",
@@ -192,7 +192,7 @@ func TestOverridesImporterProcessTicketHappyPath(t *testing.T) {
192192
expectCount: 300,
193193
expectPeriod: 7 * 24 * time.Hour,
194194
expectOrgComment: "Acme Corp",
195-
expectLastCommentSubstring: "has been approved. Your new limit is 300 per week",
195+
expectLastCommentSubstring: "has been approved. Your new limit is 300 per period",
196196
},
197197
{
198198
name: "CertificatesPerDomain with valid IPv6",
@@ -207,7 +207,7 @@ func TestOverridesImporterProcessTicketHappyPath(t *testing.T) {
207207
expectTier: 300, expectBurst: 300, expectCount: 300,
208208
expectPeriod: 7 * 24 * time.Hour,
209209
expectOrgComment: "Acme Corp",
210-
expectLastCommentSubstring: "has been approved. Your new limit is 300 per week",
210+
expectLastCommentSubstring: "has been approved. Your new limit is 300 per period",
211211
},
212212
{
213213
name: "CertificatesPerDomainPerAccount with valid Account URI",
@@ -224,7 +224,7 @@ func TestOverridesImporterProcessTicketHappyPath(t *testing.T) {
224224
expectCount: 300,
225225
expectPeriod: 7 * 24 * time.Hour,
226226
expectOrgComment: "Acme Corp",
227-
expectLastCommentSubstring: "has been approved. Your new limit is 300 per week",
227+
expectLastCommentSubstring: "has been approved. Your new limit is 300 per period",
228228
},
229229
}
230230

0 commit comments

Comments
 (0)