Convert TmchCrl and ServerSecret to cleaner tm() impls (#1068)

* Convert TmchCrl and ServerSecret to cleaner tm() impls

When I implemented this originally I knew a lot less than I know now
about how we'll be storing and retrieving these singletons from SQL. The
optimal way here is to use the single SINGLETON_ID as the primary key,
that way we always know how to create the key that we can use in the
tm() retrieval.

This allows us to use generic tm() methods and to remove the handcrafted
SQL queries.
This commit is contained in:
gbrodman 2021-04-13 20:50:07 -04:00 committed by GitHub
parent 7918d7cd46
commit c81cbcc1bb
11 changed files with 285 additions and 343 deletions

View file

@ -665,8 +665,9 @@
);
create table "ServerSecret" (
secret uuid not null,
primary key (secret)
id int8 not null,
secret uuid,
primary key (id)
);
create table "SignedMarkRevocationEntry" (
@ -742,10 +743,11 @@
);
create table "TmchCrl" (
certificate_revocations text not null,
id int8 not null,
certificate_revocations text not null,
update_timestamp timestamptz not null,
url text not null,
primary key (certificate_revocations, update_timestamp, url)
primary key (id)
);
create table "Transaction" (