Skip to content

Commit b2eba4c

Browse files
committed
Add feature flag
1 parent 5f4da4b commit b2eba4c

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

features/features.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ type Config struct {
5151
// for the cert URL to appear.
5252
AsyncFinalize bool
5353

54+
// CAARechecksFailOrder causes the RA to set an order to "invalid" if its CAA
55+
// rechecks fail.
56+
CAARechecksFailOrder bool
57+
5458
// CheckIdentifiersPaused checks if any of the identifiers in the order are
5559
// currently paused at NewOrder time. If any are paused, an error is
5660
// returned to the Subscriber indicating that the order cannot be processed

ra/ra.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,15 @@ func (ra *RegistrationAuthorityImpl) checkOrderAuthorizations(
714714
return nil, berrors.UnauthorizedError("incorrect number of identifiers requested for finalization")
715715
}
716716

717+
if !features.Get().CAARechecksFailOrder {
718+
// Check that the authzs either don't need CAA rechecking, or do the
719+
// necessary CAA rechecks right now.
720+
err = ra.checkAuthorizationsCAA(ctx, int64(acctID), authzs, now)
721+
if err != nil {
722+
return nil, err
723+
}
724+
}
725+
717726
return authzs, nil
718727
}
719728

@@ -932,11 +941,10 @@ func (ra *RegistrationAuthorityImpl) FinalizeOrder(ctx context.Context, req *rap
932941
return nil, errIncompleteGRPCRequest
933942
}
934943

935-
requester := req.Order.RegistrationID
936944
logEvent := certificateRequestEvent{
937945
ID: core.NewToken(),
938946
OrderID: req.Order.Id,
939-
Requester: requester,
947+
Requester: req.Order.RegistrationID,
940948
RequestTime: ra.clk.Now(),
941949
UserAgent: web.UserAgent(ctx),
942950
}
@@ -1292,11 +1300,13 @@ func (ra *RegistrationAuthorityImpl) issueCertificateInner(
12921300
return fmt.Errorf("%s: %s", prefix, e)
12931301
}
12941302

1295-
// Check that the authzs either don't need CAA rechecking, or do the
1296-
// necessary CAA rechecks right now.
1297-
err := ra.checkAuthorizationsCAA(ctx, int64(acctID), authzs, ra.clk.Now())
1298-
if err != nil {
1299-
return nil, err
1303+
if features.Get().CAARechecksFailOrder {
1304+
// Check that the authzs either don't need CAA rechecking, or do the
1305+
// necessary CAA rechecks right now.
1306+
err := ra.checkAuthorizationsCAA(ctx, int64(acctID), authzs, ra.clk.Now())
1307+
if err != nil {
1308+
return nil, err
1309+
}
13001310
}
13011311

13021312
issueReq := &capb.IssueCertificateRequest{

test/config-next/ra.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
]
161161
},
162162
"features": {
163-
"AsyncFinalize": true,
163+
"CAARechecksFailOrder": true,
164164
"AutomaticallyPauseZombieClients": true,
165165
"DNSAccount01Enabled": true,
166166
"NoPendingAuthzReuse": true

0 commit comments

Comments
 (0)