fix(sse): diagnose unresolvable encrypted metadata on reads (#6784)

This commit is contained in:
唐小鸭
2026-08-28 19:49:58 +08:00
committed by GitHub
parent 64705d7589
commit eb6b617ca2
6 changed files with 432 additions and 102 deletions
+12 -1
View File
@@ -730,7 +730,18 @@ impl ReadPlan {
})
.await
.map_err(Error::other)?
.ok_or_else(|| Error::other("encrypted object metadata is incomplete"))?;
.ok_or_else(|| {
// The resolver saw no encryption it recognizes, yet the
// object's markers say it is encrypted. Keep failing closed,
// but as a typed, non-retryable error: the condition is a
// permanent property of the stored metadata, not a fault a
// retry can fix.
Error::other(EncryptionResolutionError::new(
EncryptionResolutionErrorKind::InvalidMetadata,
"object is marked encrypted, but no decryption material could be resolved from its metadata; \
the encryption metadata is incomplete or in a format this server cannot read",
))
})?;
let material = resolved;
#[cfg(feature = "rio-v2")]
let uses_legacy_encryption = matches!(material.mode, ReadEncryptionMode::Direct { .. });
+1 -1
View File
@@ -52,4 +52,4 @@ It checks that:
- KMS key ids are derived from each fixture's own `manifest.json`, so local static-KMS runs are not tied to one hard-coded key name
- SSE-C `HEAD` responses round-trip the expected customer algorithm and customer-key MD5
These tests do not yet validate full plaintext reconstruction from MinIO-written encrypted data.
These tests do not validate full plaintext reconstruction from MinIO-written encrypted data — that lives in the reader suite at `rustfs/src/storage/minio_generated_read_test.rs`, run with `--features rio-v2` over the same fixture captures.