diff options
author | Stuart Stock <stuart@int08h.com> | 2018-10-11 21:27:10 -0500 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-10-11 21:27:10 -0500 |
commit | dda76cfc88d6673358c6dd21007c227c45ccb13f (patch) | |
tree | f0b62cb5a1db2c098d368831c2d8847ea1dffa77 /src/config/file.rs | |
parent | c66513b606f6aacf61bab1434c1f512c24981b2b (diff) | |
download | roughenough-dda76cfc88d6673358c6dd21007c227c45ccb13f.zip |
another wip checkpoint; server integration
Diffstat (limited to 'src/config/file.rs')
-rw-r--r-- | src/config/file.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/config/file.rs b/src/config/file.rs index a3b8b92..fd84404 100644 --- a/src/config/file.rs +++ b/src/config/file.rs @@ -86,6 +86,11 @@ impl FileConfig { let val = value.as_i64().expect("status_interval value invalid"); config.status_interval = Duration::from_secs(val as u64) } + "key_protection" => { + let val = value.as_str().unwrap().parse() + .expect(format!("invalid key_protection value: {:?}", value).as_ref()); + config.key_protection = val + } unknown => { return Err(Error::InvalidConfiguration(format!( "unknown config key: {}", @@ -108,8 +113,8 @@ impl ServerConfig for FileConfig { self.port } - fn seed(&self) -> &[u8] { - &self.seed + fn seed(&self) -> Vec<u8> { + self.seed.clone() } fn batch_size(&self) -> u8 { @@ -128,7 +133,7 @@ impl ServerConfig for FileConfig { } } - fn key_protection(&self) -> KeyProtection { - KeyProtection::Plaintext + fn key_protection(&self) -> &KeyProtection { + &self.key_protection } } |