|
70 | 70 | rejectExtensions = flag.String("reject_extension", "", "A list of X.509 extension OIDs, in dotted string form (e.g. '2.3.4.5') which, if present, should cause submissions to be rejected.") |
71 | 71 | acceptSHA1 = flag.Bool("accept_sha1_signing_algorithms", true, "If true, accept chains that use SHA-1 based signing algorithms. This flag will eventually be removed, and such algorithms will be rejected.") |
72 | 72 | enablePublicationAwaiter = flag.Bool("enable_publication_awaiter", true, "If true then the certificate is integrated into log before returning the response.") |
73 | | - limitOldCerts = flag.String("limit_old_submissions", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.") |
| 73 | + notBeforeRL = flag.String("rate_limit_old_not_before", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.") |
74 | 74 |
|
75 | 75 | // Performance flags |
76 | 76 | httpDeadline = flag.Duration("http_deadline", time.Second*10, "Deadline for HTTP requests.") |
@@ -140,8 +140,8 @@ eventually go away. See /internal/lax509/README.md for more information.`) |
140 | 140 | } |
141 | 141 |
|
142 | 142 | hOpts := tesseract.LogHandlerOpts{ |
143 | | - OldSubmissionLimit: rateLimitFromFlags(), |
144 | | - DedupRL: dedupRL, |
| 143 | + NotBeforeRL: notBeforeRLFromFlags(), |
| 144 | + DedupRL: dedupRL, |
145 | 145 | } |
146 | 146 | logHandler, err := tesseract.NewLogHandler(ctx, *origin, signer, chainValidationConfig, newAWSStorage, *httpDeadline, *maskInternalErrors, *pathPrefix, hOpts) |
147 | 147 | if err != nil { |
@@ -362,21 +362,21 @@ func antispamMySQLConfig() *mysql.Config { |
362 | 362 | } |
363 | 363 | } |
364 | 364 |
|
365 | | -func rateLimitFromFlags() *tesseract.OldSubmissionLimit { |
366 | | - if *limitOldCerts == "" { |
| 365 | +func notBeforeRLFromFlags() *tesseract.NotBeforeRL { |
| 366 | + if *notBeforeRL == "" { |
367 | 367 | return nil |
368 | 368 | } |
369 | | - bits := strings.Split(*limitOldCerts, ":") |
| 369 | + bits := strings.Split(*notBeforeRL, ":") |
370 | 370 | if len(bits) != 2 { |
371 | | - klog.Exitf("Invalid format for --limit_old_submissions flag") |
| 371 | + klog.Exitf("Invalid format for --rate_limit_old_not_before flag") |
372 | 372 | } |
373 | 373 | a, err := time.ParseDuration(bits[0]) |
374 | 374 | if err != nil { |
375 | | - klog.Exitf("Invalid age passed to --limit_old_submissions flag %q: %v", bits[0], err) |
| 375 | + klog.Exitf("Invalid age passed to --rate_limit_old_not_before flag %q: %v", bits[0], err) |
376 | 376 | } |
377 | 377 | l, err := strconv.ParseFloat(bits[1], 64) |
378 | 378 | if err != nil { |
379 | | - klog.Exitf("Invalid rate limit passed to --limit_old_submissions %q: %v", bits[1], err) |
| 379 | + klog.Exitf("Invalid rate limit passed to --rate_limit_old_not_before %q: %v", bits[1], err) |
380 | 380 | } |
381 | | - return &tesseract.OldSubmissionLimit{AgeThreshold: a, RateLimit: l} |
| 381 | + return &tesseract.NotBeforeRL{AgeThreshold: a, RateLimit: l} |
382 | 382 | } |
0 commit comments