Skip to content

sa: use model struct for Certificate, CertificateStatus, FQDNSet #8112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jsha opened this issue Apr 9, 2025 · 1 comment
Open

sa: use model struct for Certificate, CertificateStatus, FQDNSet #8112

jsha opened this issue Apr 9, 2025 · 1 comment
Assignees

Comments

@jsha
Copy link
Contributor

jsha commented Apr 9, 2025

In the SA, we mostly use structs internal to the SA to represent the database's storage of various objects, and translate those objects into proto messages to return from RPCs. There are three exceptions:

boulder/sa/database.go

Lines 272 to 274 in bc39780

dbMap.AddTableWithName(core.Certificate{}, "certificates").SetKeys(true, "ID")
dbMap.AddTableWithName(core.CertificateStatus{}, "certificateStatus").SetKeys(true, "ID")
dbMap.AddTableWithName(core.FQDNSet{}, "fqdnSets").SetKeys(true, "ID")

Certificate, CertificateStatus, and FQDNSet use types from the core package as models. We should switch these to SA-internal models.

@jsha jsha self-assigned this Apr 15, 2025
@jsha jsha added this to the Sprint 2025-04-15 milestone Apr 15, 2025
jsha added a commit that referenced this issue Apr 21, 2025
This follows the system we've used for other types, where the SA has a
model type that is converted to a proto message for use outside the SA.

Part of #8112.
@jsha
Copy link
Contributor Author

jsha commented May 13, 2025

The last bit of this, FQDNSet, requires some more tweaks to the expiration-mailer unittest. Rather than make those tweaks I'm going to consider this blocked on the removal of expiration-mailer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants