Skip to content

feat(encryption): [15/N] Reject writes to encrypted tables - #4478

Open
xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/encryption-block-writes
Open

xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/encryption-block-writes

Conversation

@xanderbailey

@xanderbailey xanderbailey commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Working towards #3222

Rationale for this change

Writes to a table with encryption.key-id now raise NotImplementedError until encrypted manifests and manifest lists are wired into commits. Otherwise, once v3 manifest writing (#3624) lands, a commit would write plaintext manifests, holding the data file keys, to an encrypted table.

The check is in the snapshot producer, which writes the manifests, so it runs before any are written. Metadata-only updates are still allowed.

This will allow us to hookup the KMS service through the catalog without worry of people writing unencrypted files to an encrypted table.

Are these changes tested?

Yes, append, overwrite and delete raise on an encrypted table without writing any files, and a property update still works.

Are there any user-facing changes?

Writes to encrypted tables raise NotImplementedError.

Snapshot producers raise for tables with encryption.key-id, so nothing commits
plaintext manifests to an encrypted table before encrypted manifest and
manifest list writes are wired up. Metadata-only updates are still allowed.
Comment on lines +167 to +169
from pyiceberg.encryption.manager import _reject_encrypted_writes

_reject_encrypted_writes(transaction.table_metadata)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this spot makes the most sense to block this, everything in the library goes through here today and hopefully we won't have to block this for long!

@xanderbailey
xanderbailey marked this pull request as ready for review November 24, 2026 18:00

This branch has not been deployed

No deployments
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.

1 participant