From 76f1455372b09271553ac5143a528702c9302c58 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sat, 11 Sep 2021 21:59:48 +0900 Subject: [PATCH] Follow addition of key fields to instances table --- plume-cli/src/instance.rs | 2 ++ plume-models/src/blogs.rs | 2 ++ plume-models/src/instance.rs | 12 ++++++++++++ plume-models/src/users.rs | 2 ++ 4 files changed, 18 insertions(+) diff --git a/plume-cli/src/instance.rs b/plume-cli/src/instance.rs index 8fa48060..df411f53 100644 --- a/plume-cli/src/instance.rs +++ b/plume-cli/src/instance.rs @@ -65,6 +65,8 @@ fn new<'a>(args: &ArgMatches<'a>, conn: &Connection) { open_registrations: open_reg, short_description_html: String::new(), long_description_html: String::new(), + private_key: None, + public_key: None, }, ) .expect("Couldn't save instance"); diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index bf2a8ad5..179cec02 100644 --- a/plume-models/src/blogs.rs +++ b/plume-models/src/blogs.rs @@ -359,6 +359,8 @@ impl FromId for Blog { open_registrations: true, short_description_html: String::new(), long_description_html: String::new(), + private_key: None, + public_key: None, }, ) })?; diff --git a/plume-models/src/instance.rs b/plume-models/src/instance.rs index 80babed5..bd4e6e05 100644 --- a/plume-models/src/instance.rs +++ b/plume-models/src/instance.rs @@ -25,6 +25,8 @@ pub struct Instance { pub default_license: String, pub long_description_html: SafeString, pub short_description_html: SafeString, + pub private_key: Option, + pub public_key: Option, } #[derive(Clone, Insertable)] @@ -39,6 +41,8 @@ pub struct NewInstance { pub default_license: String, pub long_description_html: String, pub short_description_html: String, + pub private_key: Option, + pub public_key: Option, } lazy_static! { @@ -259,6 +263,8 @@ pub(crate) mod tests { name: "My instance".to_string(), open_registrations: true, public_domain: "plu.me".to_string(), + private_key: None, + public_key: None, }, NewInstance { default_license: "WTFPL".to_string(), @@ -270,6 +276,8 @@ pub(crate) mod tests { name: "An instance".to_string(), open_registrations: true, public_domain: "1plu.me".to_string(), + private_key: None, + public_key: None, }, NewInstance { default_license: "CC-0".to_string(), @@ -281,6 +289,8 @@ pub(crate) mod tests { name: "Someone instance".to_string(), open_registrations: false, public_domain: "2plu.me".to_string(), + private_key: None, + public_key: None, }, NewInstance { default_license: "CC-0-BY-SA".to_string(), @@ -292,6 +302,8 @@ pub(crate) mod tests { name: "Nice day".to_string(), open_registrations: true, public_domain: "3plu.me".to_string(), + private_key: None, + public_key: None, }, ] .into_iter() diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 7924cfd4..6b429fd2 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -958,6 +958,8 @@ impl FromId for User { open_registrations: true, short_description_html: String::new(), long_description_html: String::new(), + private_key: None, + public_key: None, }, ) })?;