Skip to content

Commit

Permalink
refactor: address requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chethan-rao committed Oct 28, 2023
1 parent 00bf1ae commit 39b53c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ impl AppState {
async fn new(config: config::Config) -> error_stack::Result<Self, error::ConfigurationError> {
#[cfg(feature = "kms")]
{
let kms_client = kms::get_kms_client(&config.kms).await;

let master_key_kms_input: KmsData<Base64Encoded> = KmsData {
data: String::from_utf8(config.secrets.master_key.clone())
.expect("Failed while converting bytes to String"),
decode_op: PhantomData,
};

#[allow(clippy::expect_used)]
let kms_decrypted_master_key: KmsData<Raw> = kms::get_kms_client(&config.kms)
.await
let kms_decrypted_master_key: KmsData<Raw> = kms_client
.decrypt(master_key_kms_input)
.await
.expect("Failed while performing KMS decryption");
Expand Down

0 comments on commit 39b53c6

Please sign in to comment.