Skip to content

Commit

Permalink
chore(): Use the config region in key-manager (#870)
Browse files Browse the repository at this point in the history
* chore(): Use the config region in key-manager

* fmt
  • Loading branch information
wojciechsromek authored Jan 2, 2025
1 parent cc40ade commit d364891
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion iris-mpc-common/src/helpers/key_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ impl Drop for SharesEncryptionKeyPairs {

impl SharesEncryptionKeyPairs {
pub async fn from_storage(config: Config) -> Result<Self, SharesDecodingError> {
let region_provider = Region::new(REGION);
// use the configured region, fallback to the hardcoded value
let region = config
.aws
.and_then(|aws| aws.region)
.unwrap_or_else(|| REGION.to_owned());
let region_provider = Region::new(region);
let shared_config = aws_config::from_env().region(region_provider).load().await;
let client = SecretsManagerClient::new(&shared_config);

Expand Down

0 comments on commit d364891

Please sign in to comment.