Skip to content

Commit 5496e2b

Browse files
feat: also use the fips aws endpoints for key decryption
1 parent f1d7c93 commit 5496e2b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

bottlecap/src/secrets/decrypt.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ async fn request(
217217
Ok(v)
218218
}
219219

220+
#[cfg(not(feature = "fips"))]
221+
fn compute_host(service: &String, region: &String, domain: &str) -> String {
222+
format!("{service}.{region}.{domain}")
223+
}
224+
225+
#[cfg(feature = "fips")]
226+
fn compute_host(service: &String, region: &String, domain: &str) -> String {
227+
format!("{service}-fips.{region}.{domain}")
228+
}
229+
220230
fn build_get_secret_signed_headers(
221231
aws_config: &AwsConfig,
222232
region: String,
@@ -231,7 +241,7 @@ fn build_get_secret_signed_headers(
231241
"amazonaws.com"
232242
};
233243

234-
let host = format!("{}.{}.{}", header_values.service, region, domain);
244+
let host = compute_host(&header_values.service, &region, domain);
235245

236246
let canonical_uri = "/";
237247
let canonical_querystring = "";

0 commit comments

Comments
 (0)