SA: Use IgnoreAccountContacts flag to shortcut UpdateRegistrationContact (#8208)
If the IgnoreAccountContacts flag is set, don't bother writing the new contacts to the database and instead just return the account object as it stands. This does not require any test changes because https://github.com/letsencrypt/boulder/pull/8198 already changed registrationModelToPb to omit whatever contacts were retrieved from the database before responding to the RA. Part of https://github.com/letsencrypt/boulder/issues/8176
This commit is contained in:
parent
930e69b8f5
commit
8a7c3193a9
5
sa/sa.go
5
sa/sa.go
|
@ -21,6 +21,7 @@ import (
|
|||
corepb "github.com/letsencrypt/boulder/core/proto"
|
||||
"github.com/letsencrypt/boulder/db"
|
||||
berrors "github.com/letsencrypt/boulder/errors"
|
||||
"github.com/letsencrypt/boulder/features"
|
||||
bgrpc "github.com/letsencrypt/boulder/grpc"
|
||||
"github.com/letsencrypt/boulder/identifier"
|
||||
blog "github.com/letsencrypt/boulder/log"
|
||||
|
@ -132,6 +133,10 @@ func (ssa *SQLStorageAuthority) UpdateRegistrationContact(ctx context.Context, r
|
|||
return nil, errIncompleteRequest
|
||||
}
|
||||
|
||||
if features.Get().IgnoreAccountContacts {
|
||||
return ssa.GetRegistration(ctx, &sapb.RegistrationID{Id: req.RegistrationID})
|
||||
}
|
||||
|
||||
// We don't want to write literal JSON "null" strings into the database if the
|
||||
// list of contact addresses is empty. Replace any possibly-`nil` slice with
|
||||
// an empty JSON array.
|
||||
|
|
Loading…
Reference in New Issue