summaryrefslogtreecommitdiff
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2018-10-06 22:40:12 -0500
committerStuart Stock <stuart@int08h.com>2018-10-07 15:48:23 -0500
commit0b924cc92418f9a210a6b78cef56e427dc9c9d1d (patch)
treea7bb33d3a344d973684e6f0de3e35f956de803db /src/config/mod.rs
parentb43bcb27ad303afd56cfe1d767e95c10cf3d1cb2 (diff)
downloadroughenough-0b924cc92418f9a210a6b78cef56e427dc9c9d1d.zip
Land KMS support, yay!
AWS KMS for now, work-in-progress
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 983338c..ac903b3 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -35,7 +35,9 @@ mod environment;
pub use self::environment::EnvironmentConfig;
+use key;
use Error;
+use KeyProtection;
/// Maximum number of requests to process in one batch and include the the Merkle tree.
pub const DEFAULT_BATCH_SIZE: u8 = 64;
@@ -85,6 +87,9 @@ pub trait ServerConfig {
/// Convenience function to create a `SocketAddr` from the provided `interface` and `port`
fn socket_addr(&self) -> Result<SocketAddr, Error>;
+
+ /// Method used to protect the long-term key pair.
+ fn key_protection(&self) -> KeyProtection;
}
///
@@ -127,14 +132,22 @@ pub fn is_valid_config(cfg: &Box<ServerConfig>) -> bool {
is_valid = false;
}
if cfg.batch_size() < 1 || cfg.batch_size() > 64 {
- error!("batch_size {} is invalid; valid range 1-64", cfg.batch_size());
+ error!(
+ "batch_size {} is invalid; valid range 1-64",
+ cfg.batch_size()
+ );
is_valid = false;
}
if is_valid {
match cfg.socket_addr() {
Err(e) => {
- error!("failed to create socket {}:{} {:?}", cfg.interface(), cfg.port(), e);
+ error!(
+ "failed to create socket {}:{} {:?}",
+ cfg.interface(),
+ cfg.port(),
+ e
+ );
is_valid = false;
}
_ => (),