Skip to content

feat(encryption): [10/N] Read encrypted manifests - #4308

Merged
kevinjqliu merged 1 commit into
apache:mainfrom
xanderbailey:xb/encryption-read-manifests
Nov 9, 2026
Merged

kevinjqliu merged 1 commit into
apache:mainfrom
xanderbailey:xb/encryption-read-manifests

Conversation

@xanderbailey

Copy link
Copy Markdown
Contributor

Working towards #3222

Rationale for this change

Now that we can read encrypted manifest lists (#4159), we need to read the manifests they point to.

  • A manifest list entry's key_metadata holds the manifest's plaintext key metadata (key, AAD prefix and file length). That's safe because the manifest list holding it is itself encrypted, so reading a manifest doesn't need the EncryptionManager or the KMS.
  • ManifestFile.fetch_manifest_entry decrypts the manifest when key_metadata is set, matching iceberg-rust's ManifestReader ([8/N] feat(encryption) [8/N] Read encrypted manifest file iceberg-rust#2586). Every manifest read goes through it, so scans, inspect, validation and purge pick this up without changes.

This depends on #4296. iceberg-rust's manifest writer leaves out avro.codec, and we currently read a missing codec as gzip (#4295), so the iceberg-rust test below fails until that lands.

Are these changes tested?

Yes. An encrypted v3 manifest written by iceberg-rust is checked in under tests/table/encryption, and reading it returns its entries. There's also a round trip of an encrypted manifest, checking that a wrong key fails and that the encrypted bytes don't read as plaintext.

Are there any user-facing changes?

No. Nothing changes for unencrypted tables.

@xanderbailey
xanderbailey marked this pull request as ready for review November 8, 2026 17:35

@kevinjqliu kevinjqliu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

i also just merged #4296 so the ci should be unblocked

holding master key `master-1` = bytes `0x00` to `0x0f`. Its keys and snapshot are in the
`example_table_metadata_v3_encrypted` fixture in `tests/conftest.py`.

`manifest-v3-encrypted.avro` is a v3 data manifest with two added entries, written and encrypted by iceberg-rust's

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: might be a good idea to include how the tests/table/encryption/manifest-v3-encrypted.avro is generated. either in pr description/comment or in the readme.

for future readers 😄

A manifest list entry's key_metadata is the plaintext key metadata of its
manifest, so fetch_manifest_entry decrypts with it when it is set, as
iceberg-rust's ManifestReader does.
@kevinjqliu
kevinjqliu force-pushed the xb/encryption-read-manifests branch from c6068ad to 221519c Compare November 9, 2026 19:56
@kevinjqliu

Copy link
Copy Markdown
Contributor

rebased onto latest main to get #4296

@kevinjqliu
kevinjqliu enabled auto-merge November 9, 2026 19:57
@kevinjqliu

Copy link
Copy Markdown
Contributor

Thanks @xanderbailey

@kevinjqliu
kevinjqliu added this pull request to the merge queue Nov 9, 2026
Merged via the queue into apache:main with commit c8d6723 Nov 9, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants