Skip to content

feat(openfga): rename the write privilege to write_data - #2228

Merged
c-thiel merged 2 commits into
mainfrom
christian/openfga-write-data
Nov 3, 2026
Merged

c-thiel merged 2 commits into
mainfrom
christian/openfga-write-data

Conversation

@c-thiel

@c-thiel c-thiel commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

The OpenFGA privilege for changing a table's data without changing its structure (#2115, not yet released) is now called write_data. write suggested any change to a table.

  • Model v4.15 replaces the unreleased v4.14. Stores provisioned with v4.14 from a main build migrate to v4.15; grant write again as write_data there.
  • Management API: assignment type write → write_data, actions grant_write → grant_write_data.
  • The privilege description now says that write_data can set branch and tag retention, which snapshot expiry follows.

Downstream follow-up

  • lakekeeper-authz-openfga: enum variants Write, CanGrantWrite, CanRevokeWrite, GrantWrite → WriteData, CanGrantWriteData, CanRevokeWriteData, GrantWriteData; OpenAPI schemas *AssignmentWrite → *AssignmentWriteData.

Summary by CodeRabbit

  • Authorization Changes
    • The write privilege is now named write_data. It grants data-changing access without allowing structural changes; modify continues to include effective data-writing access.
    • write_data can be granted and delegated across projects, warehouses, namespaces, and tables. Views do not support this privilege.
  • Breaking Changes
    • Existing write grants do not carry over during migration to the new authorization model. Regrant access using write_data.
  • Documentation
    • Updated authorization guides and API descriptions to reflect the renamed privilege and its scope.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The OpenFGA data-writing privilege is renamed from write to write_data across authorization models, Rust mappings, API schemas, tests, and documentation. The current model version advances to v4.15. Updated tests and guides retain the described data-access scope and structural-operation restrictions.

Changes

Write Data Authorization

Layer / File(s) Summary
OpenFGA privilege relations
authz/openfga/v4.15/components/*, authz/openfga/v4.15/schema.json, authz/openfga/v4.14/schema.json
Resource models replace write relations with write_data relations and rename related grant/revoke actions. The v4.14 schema is removed.
Rust authorization mappings and model version
crates/authz-openfga/src/relations.rs, crates/authz-openfga/src/migration.rs, crates/authz-openfga/src/grant.rs
Assignment, relation, and action mappings use the new names. The current model version and schema reference change to v4.15.
Fixtures and authorization tests
authz/openfga/v4.15/store.fga.yaml, crates/authz-openfga/src/authorizer.rs, crates/lakekeeper-integration-tests/tests/*, authz/opa-bridge/tests/trino/write_test.rego
Fixtures and test references use write_data. Assertions continue to cover data access, delegation, and restrictions on structural operations.
API schemas and documentation
docs/docs/api/management-open-api.yaml, docs/docs/authorization-openfga.md, docs/docs/opa.md, docs/docs/concepts.md, authz/openfga/README.md
API names and documentation use write_data. The changelog describes the v4.15 migration and notes that prior write grants do not carry over.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

  • lakekeeper/lakekeeper#2115: Introduced the write privilege and its data-only commit behavior, which this change renames.
  • lakekeeper/lakekeeper#2215: Changes the Trino authorization path for the write-only behavior; this change updates related test terminology.
  • lakekeeper/lakekeeper#2214: Validates OpenFGA model versions and relation names at startup; this change updates the active model and relation names.

Suggested reviewers: brgr-s

Merge Risk: Minimal · up to 91de9

No material merge-blocking risk is established. The remaining wording change is optional editorial cleanup.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(openfga): rename the write privilege to write_data" matches the main change in the changeset. The PR renames the OpenFGA table-data privilege from write to write_data across the v4…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(openfga): rename the write privilege to write_data" matches the main change in the changeset. The PR renames the OpenFGA table-data privilege from write to write_data across the v4.15 authorization models, the Rust enum variants in crates/authz-openfga, the Management API schemas, the tests, and the docs. The title names the scope (openfga) and the action (rename). It is concise and specific, and it does not use vague terms. It does not mention the v4.14 to v4.15 model bump or the migration impact, but the title does not need to cover every detail.

Full details: Docstring Coverage

Explanation

Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 45 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the grants at dawn
write_data hops where write was drawn
The models turn to four-fifteen
The tests keep boundaries clear and clean
One carrot for each renamed relation
Then off to burrowed documentation

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@coderabbitai coderabbitai Bot 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread authz/openfga/README.md Resolved
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR match the correct format. Thank you!

@coderabbitai coderabbitai Bot 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.

Additional comments: 1
authz/openfga/README.md-32-32: 1

32-32: Minor · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Use afterward in the American-English changelog.

Line 32 uses afterwards. Replace it with afterward to clear the LanguageTool locale violation.

Proposed wording
-... directly afterwards, ...
+... directly afterward, ...

Source: Linters/SAST tools

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ad876ac-dfe5-4cff-809d-04bc6158bcad
Commits

Reviewing files that changed from the base of the PR and between 5e4ff6b and 91de92e.

Files selected for processing: 1
  • authz/openfga/README.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@c-thiel
c-thiel enabled auto-merge (squash) November 3, 2026 17:35
@c-thiel
c-thiel merged commit 19d3d35 into main Nov 3, 2026
76 of 77 checks passed
@c-thiel
c-thiel deleted the christian/openfga-write-data branch November 3, 2026 18:37
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