Skip to content

Commit

Permalink
sa: get order names from authorizations (letsencrypt#7435)
Browse files Browse the repository at this point in the history
This removes the only place we query the requestedNames table, which
allows us to get rid of it in a subsequent PR (once this one is merged
and deployed).

Part of letsencrypt#7432
  • Loading branch information
jsha authored and alina.dmitrieva committed Jul 29, 2024
1 parent 13d5573 commit 393417e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion sa/sa.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,24 @@ func (ssa *SQLStorageAuthority) NewOrderAndAuthzs(ctx context.Context, req *sapb
return nil, err
}

// Fourth, insert the FQDNSet entry for the order.
// Fourth, insert all of the requestedNames.
// TODO(#7432): Remove this
inserter, err = db.NewMultiInserter("requestedNames", []string{"orderID", "reversedName"}, "")
if err != nil {
return nil, err
}
for _, name := range req.NewOrder.Names {
err := inserter.Add([]interface{}{orderID, ReverseName(name)})
if err != nil {
return nil, err
}
}
_, err = inserter.Insert(ctx, tx)
if err != nil {
return nil, err
}

// Fifth, insert the FQDNSet entry for the order.
err = addOrderFQDNSet(ctx, tx, req.NewOrder.Names, orderID, req.NewOrder.RegistrationID, req.NewOrder.Expires.AsTime())
if err != nil {
return nil, err
Expand Down

0 comments on commit 393417e

Please sign in to comment.