Repository navigation
fix: refuse setting main to a tag, and write_data cannot finish a staged create - #2233
Conversation
… data commit A commit to a staged table, which finishes a staged create, is never a data commit, so `write_data` cannot finish one and OpenFGA asks `modify`. The server asks the authorizer this one action with the commit's content, so a policy on properties, update kinds or refs decides on the commit that finishes the create. Batch-check marks a commit check on a staged table the same way and gives the server's answer. `UpdateKindsListing` is now `CommitFacts`, and the `update_kinds_listing` field of `CatalogTableAction::Commit` is now `commit_facts`: facts the server establishes about a commit, which no client can claim.
A table commit that sets `main` to a tag is refused with 400 (`SetMainToTagNotAllowed`), and the table does not change. Iceberg Java refuses it as well. Iceberg clients append to `main` and cannot write to a table whose `main` is a tag.
|
No actionable comments were generated in the recent review. WalkthroughCommit authorization now uses server-established facts to classify commits and preserve update details in staged-table checks. Commit processing also rejects attempts to set the ChangesCommit Authorization
Main Reference Validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant ManagementCheckAPI
participant CatalogTableAction
participant on_table
participant Authorizer
ManagementCheckAPI->>CatalogTableAction: Pass commit action and update details
CatalogTableAction->>on_table: Bind action to table information
on_table->>Authorizer: Pass action with commit facts
Possibly related PRs
Suggested reviewers: Merge Risk:
|
`CommitFacts` records the table a commit goes to as unresolved, live or staged, and only a commit to a live table can be a data commit. A place that authorizes a commit without `CatalogTableAction::on_table` therefore refuses `write_data` and asks for `modify`. The test authorizer can block every commit that is not a data commit, and batch-check and the server give the same answer for a data commit to a live and to a staged table. Tests outside the crate build commit facts with `CommitFacts::live_check_for_tests()`, `live_request_for_tests()` and `staged_request_for_tests()`.
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
mainto a tag is refused with 400, as Iceberg Java 1.12 does. Clients cannot append to such a table.write_dataalone cannot finish a staged create. The commit that finishes it is checked once, with its content, so policies on a commit's properties or update kinds and batch-check see the same request as the server. This replaces the extra check without content from feat(authz): write_data allows commits without updates; a commit to astaged table needs modify #2230; nothing changes for 0.14.Release notes
maincannot become a tag. Lakekeeper refuses a table commit that setsmainto a tag with 400, as Iceberg Java 1.12 does. Iceberg clients cannot write to a table whosemainis a tag.write_dataentry:write_dataalone cannot finish a staged create, such asCREATE TABLE AS SELECTin Spark.Downstream follow-up
UpdateKindsListing→CommitFacts, fieldupdate_kinds_listing→commit_facts.CommitFacts::default()is never a data commit: only a commit the server marked withon_tableas going to a live table can be one. Test helpers:every_update_for_tests()is replaced byCommitFacts::live_check_for_tests(),live_request_for_tests()andstaged_request_for_tests().Summary by CodeRabbit
mainreference to a tag is rejected with a clear error. Failed commits leave table metadata unchanged; tags can still be created under other reference names.