fix(storage): harden local SSE-S3 fallback (#3564)

* fix: harden local SSE-S3 fallback

* test: update managed SSE-S3 assumptions

* chore: keep issue plan local only

* test(ci): seed local SSE key for s3-tests
This commit is contained in:
houseme
2026-06-18 15:29:52 +08:00
committed by GitHub
parent c76e4dc6bc
commit fc93a27974
4 changed files with 386 additions and 245 deletions
+3 -3
View File
@@ -2220,11 +2220,11 @@ mod tests {
}
#[tokio::test]
async fn test_get_object_reader_uses_local_managed_fallback_without_env() {
async fn test_get_object_reader_uses_local_managed_fallback_with_explicit_sse_s3_key() {
async_with_vars(
[
("__RUSTFS_SSE_SIMPLE_CMK", None::<String>),
("RUSTFS_SSE_S3_MASTER_KEY", None::<String>),
("RUSTFS_SSE_S3_MASTER_KEY", Some(BASE64_STANDARD.encode([0u8; 32]))),
],
async {
let plaintext = b"managed-local-fallback".to_vec();
@@ -2288,7 +2288,7 @@ mod tests {
&HeaderMap::new(),
)
.await
.expect("managed encrypted reads should fall back to the local SSE-S3 key");
.expect("managed encrypted reads should use the configured local SSE-S3 key");
let mut actual = Vec::new();
reader.read_to_end(&mut actual).await.expect("read managed plaintext");