Skip to content

Commit

Permalink
feat(certificates): assign unique IDs (UUIDv7) to private keys
Browse files Browse the repository at this point in the history
  • Loading branch information
azasypkin committed Oct 20, 2023
1 parent c379980 commit 43bda11
Show file tree
Hide file tree
Showing 19 changed files with 598 additions and 204 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[target.'cfg(all())']
rustflags = ["--cfg", "uuid_unstable"]

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tokio-cron-scheduler = "0.9.4"
trust-dns-resolver = "0.23.1"
url = "2.4.1"
urlencoding = "2.1.3"
uuid = "1.4.1"
uuid = "1.5.0"
webauthn-rs = "0.4.8"
zip = "0.6.6"

Expand Down Expand Up @@ -102,6 +102,7 @@ default = [
"tokio/rt-multi-thread",
"tokio/macros",
"url/serde",
"uuid/v7",
"webauthn-rs/danger-allow-state-serialisation"
]

Expand Down
3 changes: 2 additions & 1 deletion migrations/20231019195044_certificates_private_keys.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ WHERE
-- Create table to store private keys.
CREATE TABLE IF NOT EXISTS user_data_certificates_private_keys
(
id BLOB PRIMARY KEY,
name TEXT NOT NULL COLLATE NOCASE,
alg BLOB NOT NULL,
pkcs8 BLOB NOT NULL,
encrypted INTEGER NOT NULL,
created_at INTEGER NOT NULL,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
PRIMARY KEY (name, user_id)
UNIQUE (name, user_id)
) STRICT;
4 changes: 2 additions & 2 deletions src/utils/api_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ mod tests {
},
Util {
id: 11,
handle: "certificates__templates",
name: "Templates",
handle: "certificates__certificate_templates",
name: "Certificate templates",
keywords: Some(
"digital certificates x509 X.509 ssl tls openssl public private key encryption self-signed pki templates",
),
Expand Down
Loading

0 comments on commit 43bda11

Please sign in to comment.