From 9c2c3b01cf63117e7190f98a369a59b64ef49619 Mon Sep 17 00:00:00 2001 From: zo-el Date: Tue, 4 Jun 2024 16:30:18 -0500 Subject: [PATCH] Config: new value initial_host_pub_key --- core/src/config.rs | 19 +++---------------- core/tests/configuration.rs | 1 + 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/core/src/config.rs b/core/src/config.rs index d7ac83b..b88c42f 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -89,6 +89,8 @@ pub enum Config { revocation_pub_key: PublicKey, // /1 derivation path of the device bundle base36 encoded holoport_id: String, + // This is a HoloHash version of the holoport_id + initial_host_pub_key: String, /// Holo registration code is used to identify and authenticate its users registration_code: String, /// The pub-key in settings is the holoport key that is used for verifying login signatures @@ -118,6 +120,7 @@ impl Config { device_derivation_path, revocation_pub_key, holoport_id, + initial_host_pub_key: public_key::to_holochain_encoded_agent_key(&device_pub_key), registration_code, settings: Settings { admin: admin }, }, @@ -134,22 +137,6 @@ impl Config { } } -// fn generate_keypair( -// email: String, -// password: String, -// maybe_seed: Option, -// ) -> Result<(Seed, Keypair, PublicKey), Error> { -// let master_seed = match maybe_seed { -// None => OsRng::new()?.gen::(), -// Some(s) => s, -// }; -// let master_secret_key = SecretKey::from_bytes(&master_seed)?; -// let master_public_key = PublicKey::from(&master_secret_key); - -// let admin_keypair = admin_keypair_from(master_public_key, &email, &password)?; -// Ok((master_seed, admin_keypair, master_public_key)) -// } - pub fn admin_keypair_from( holochain_public_key: PublicKey, email: &str, diff --git a/core/tests/configuration.rs b/core/tests/configuration.rs index b9cd003..cf7587a 100644 --- a/core/tests/configuration.rs +++ b/core/tests/configuration.rs @@ -58,6 +58,7 @@ mod tests { device_derivation_path, revocation_pub_key, holoport_id, + initial_host_pub_key: _, registration_code, settings, } = hpos_config.0