mbutrovich commented on code in PR #2586:
URL: https://github.com/apache/iceberg-rust/pull/2586#discussion_r3501322510
##########
crates/iceberg/src/spec/manifest_list/manifest_file.rs:
##########
@@ -178,7 +179,14 @@ impl ManifestFile {
///
/// This method will also initialize inherited values of
[`ManifestEntry`](crate::spec::ManifestEntry), such as `sequence_number`.
pub async fn load_manifest(&self, file_io: &FileIO) -> Result<Manifest> {
- let avro = file_io.new_input(&self.manifest_path)?.read().await?;
+ let input = file_io.new_input(&self.manifest_path)?;
+ let avro = match &self.key_metadata {
+ Some(key_metadata_bytes) => {
+ let key_metadata =
StandardKeyMetadata::decode(key_metadata_bytes)?;
Review Comment:
Same hardcoded-decode point as #2584 (so I won't re-litigate it here) -
flagging only that if the `FileKeyResolver` lands, this path needs to be
included, and there's a threading wrinkle: `load_manifest(&self, file_io:
&FileIO)` has no parameter to receive a resolver today. Whoever lands the seam
will need to thread it (or an `EncryptionManager`) into `load_manifest`.
##########
crates/iceberg/src/spec/manifest_list/manifest_file.rs:
##########
@@ -228,4 +245,84 @@ mod test {
fn test_manifest_content_type_default_value() {
assert_eq!(ManifestContentType::default() as i32, 0);
}
+
+ #[tokio::test]
+ async fn test_load_manifest_decrypts_when_key_metadata_present() {
Review Comment:
The roundtrip test is good. For parity with the data-file tests in #2584
(which cover missing-key and wrong-key), consider a wrong-key (or wrong-AAD)
case asserting `load_manifest` fails cleanly, so a future change that silently
mis-resolves the key is caught.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]