-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(authsign): store additional metadata/fields in
certdb
(#1126)
This is a major change in that the included DB migrations *must* be run before the new version of `cfssl` is deployed. This allows for clients (i.e. https://github.com/cloudflare/certmgr) to send some additional optional fields to `/api/v1/cfssl/authsign` to be stored in `certdb`. It also starts saving SANs, common name, and NotBefore from the issued certificates so that they can be queried without having to parse the PEM.
- Loading branch information
1 parent
046b174
commit 8090bce
Showing
78 changed files
with
11,041 additions
and
705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- +goose Up | ||
-- SQL in section 'Up' is executed when this migration is applied | ||
ALTER TABLE certificates | ||
ADD COLUMN issued_at timestamp DEFAULT '0000-00-00 00:00:00', | ||
ADD COLUMN not_before timestamp DEFAULT '0000-00-00 00:00:00', | ||
ADD COLUMN metadata JSON, | ||
ADD COLUMN sans JSON, | ||
ADD COLUMN common_name TEXT; | ||
-- +goose Down | ||
-- SQL section 'Down' is executed when this migration is rolled back | ||
ALTER TABLE certificates DROP COLUMN issued_at, | ||
DROP COLUMN not_before, | ||
DROP COLUMN metadata, | ||
DROP COLUMN sans, | ||
DROP COLUMN common_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- +goose Up | ||
-- SQL in section 'Up' is executed when this migration is applied | ||
ALTER TABLE certificates | ||
ADD COLUMN issued_at timestamptz, | ||
ADD COLUMN not_before timestamptz, | ||
ADD COLUMN metadata jsonb, | ||
ADD COLUMN sans jsonb, | ||
ADD COLUMN common_name TEXT; | ||
-- +goose Down | ||
-- SQL section 'Down' is executed when this migration is rolled back | ||
ALTER TABLE certificates DROP COLUMN issued_at, | ||
DROP COLUMN not_before, | ||
DROP COLUMN metadata, | ||
DROP COLUMN sans, | ||
DROP COLUMN common_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
certdb/sqlite/migrations/002_AddMetadataToCertificates.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- +goose Up | ||
-- SQL in section 'Up' is executed when this migration is applied | ||
|
||
ALTER TABLE certificates ADD COLUMN "issued_at" timestamp; | ||
ALTER TABLE certificates ADD COLUMN "not_before" timestamp; | ||
ALTER TABLE certificates ADD COLUMN "metadata" text; | ||
ALTER TABLE certificates ADD COLUMN "sans" text; | ||
ALTER TABLE certificates ADD COLUMN "common_name" text; | ||
|
||
-- +goose Down | ||
-- SQL section 'Down' is executed when this migration is rolled back | ||
|
||
-- can't drop columns in sqlite |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.