refactor: rename key_id to id

buddies-main-deployment
James Prestwich 3 years ago
parent 9d2771621f
commit 9300133dd5
No known key found for this signature in database
GPG Key ID: 7CC174C250AD83AD
  1. 6
      rust/optics-base/src/settings/mod.rs

@ -36,7 +36,7 @@ pub enum SignerConf {
/// separately. /// separately.
Aws { Aws {
/// The UUID identifying the AWS KMS Key /// The UUID identifying the AWS KMS Key
key_id: String, id: String, // change to no _ so we can set by env
/// The AWS region /// The AWS region
region: String, region: String,
}, },
@ -57,7 +57,7 @@ impl SignerConf {
pub async fn try_into_signer(&self) -> Result<Signers, Report> { pub async fn try_into_signer(&self) -> Result<Signers, Report> {
match self { match self {
SignerConf::HexKey { key } => Ok(Signers::Local(key.as_ref().parse()?)), SignerConf::HexKey { key } => Ok(Signers::Local(key.as_ref().parse()?)),
SignerConf::Aws { key_id, region } => { SignerConf::Aws { id, region } => {
let client = rusoto_core::Client::new_with( let client = rusoto_core::Client::new_with(
EnvironmentProvider::default(), EnvironmentProvider::default(),
HttpClient::new().unwrap(), HttpClient::new().unwrap(),
@ -71,7 +71,7 @@ impl SignerConf {
{ {
panic!("couldn't set cell") panic!("couldn't set cell")
} }
let signer = AwsSigner::new(KMS_CLIENT.get().unwrap(), key_id, 0).await?; let signer = AwsSigner::new(KMS_CLIENT.get().unwrap(), id, 0).await?;
Ok(Signers::Aws(signer)) Ok(Signers::Aws(signer))
} }
SignerConf::Node => bail!("Node signer"), SignerConf::Node => bail!("Node signer"),

Loading…
Cancel
Save