-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: replace pure SQL strings with SQLair #122
Conversation
84c87b0
to
3c23458
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the word CSR
to mean two different things here, I made a couple of suggestions to decouple CertificateRequest
from CSR
, where CSR
is the X.509 document and a CertificateRequest
is a Notary object that contains a CSR, a Certificate and a Status.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good.
I added a few minor comments, and I agree with Guillaume that it makes it easier to read if the Request object and the CSR string have different names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sqlair changes look pretty good! Why include Notary HTTP API changes in this PR though? I don't necessarily disagree with those but they don't match the PR description and unnecessarily complexify the PR, and the review process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, given this comment gets resolved.
Description
This change addresses the final points and closes #84, which modifies the database to have explicit ID's, adds a new status column and associated SQL checks, and utilizes SQLair to simplify database SQL calls.
It also changes the API of the database to fit the new way of using the status column. We now have functions that are abstracted from the direct SQL calls, like
UpdateCSR
->AddCertificateToCSR
. This is to simplify future development and help avoid getting the database into inconsistent states.Another change that SQLair brings is the fact that it no longer returns the Result and LastID values that we used to pass along to the HTTP server. This means that successful API calls only receive a JSON message indicating success instead.
Checklist: