Skip to content

Commit

Permalink
WFE: Gate ARI limit exemption and replacement tracking on a feature f…
Browse files Browse the repository at this point in the history
…lag (#7383)

Gate checking of replacement orders and exemption for ARI replacements
on the `TrackReplacementCertificatesARI` feature flag.
  • Loading branch information
beautifulentropy committed Mar 18, 2024
1 parent 8ac88f5 commit 5e68cbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sa/sa.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ func (ssa *SQLStorageAuthority) NewOrderAndAuthzs(ctx context.Context, req *sapb
BeganProcessing: false,
}

if features.Get().TrackReplacementCertificatesARI && req.NewOrder.ReplacesSerial != "" {
if req.NewOrder.ReplacesSerial != "" {
// Update the replacementOrders table to indicate that this order
// replaces the provided certificate serial.
err := addReplacementOrder(ctx, tx, req.NewOrder.ReplacesSerial, order.ID, order.Expires)
Expand Down
3 changes: 2 additions & 1 deletion test/config-next/wfe2.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
"Overrides": "test/config-next/wfe2-ratelimit-overrides.yml"
},
"features": {
"ServeRenewalInfo": true
"ServeRenewalInfo": true,
"TrackReplacementCertificatesARI": true
}
},
"syslog": {
Expand Down
12 changes: 8 additions & 4 deletions wfe2/wfe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2316,10 +2316,14 @@ func (wfe *WebFrontEndImpl) NewOrder(

logEvent.DNSNames = names

replaces, limitsExempt, err := wfe.validateReplacementOrder(ctx, acct, names, newOrderRequest.Replaces)
if err != nil {
wfe.sendError(response, logEvent, web.ProblemDetailsForError(err, "While validating order as a replacement an error occurred"), err)
return
var replaces string
var limitsExempt bool
if features.Get().TrackReplacementCertificatesARI {
replaces, limitsExempt, err = wfe.validateReplacementOrder(ctx, acct, names, newOrderRequest.Replaces)
if err != nil {
wfe.sendError(response, logEvent, web.ProblemDetailsForError(err, "While validating order as a replacement an error occurred"), err)
return
}
}

// TODO(#5545): Spending and Refunding can be async until these rate limits
Expand Down

0 comments on commit 5e68cbe

Please sign in to comment.