Skip to content

feat: AuthZ Server and Project Ops - #1471

Merged
c-thiel merged 4 commits into
mainfrom
ct/authz-server-project-ops
Oct 29, 2025
Merged

c-thiel merged 4 commits into
mainfrom
ct/authz-server-project-ops

Conversation

@c-thiel

@c-thiel c-thiel commented Oct 28, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Refactor

    • Reworked authorization interfaces and error types for consistent permission checks.
    • Split server- and project-level authorization into dedicated modules with clearer public APIs.
  • New Features

    • Added explicit server and project action types and conversion paths.
    • Introduced AuthZServerOps and AuthZProjectOps with require/check semantics and admin bypass.
    • Made project identifier conversion function publicly available.
  • Bug Fixes

    • Corrected server-listing permission mapping.
    • Adjusted forbidden error message formatting for clearer output.

@coderabbitai

coderabbitai Bot commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Refactors authorization surface: adds associated action types to Authorizer; splits server/project ops into server and project modules with admin-bypass traits; changes _impl methods to return Result<_, AuthorizationBackendUnavailable>; makes OpenFGA relations public and maps catalog actions; and promotes ProjectId::from_db_unchecked to pub.

Changes

Cohort / File(s) Summary
AuthZ core & traits
crates/lakekeeper/src/service/authz/mod.rs
Added associated types ServerAction and ProjectAction to Authorizer; removed old wrapper helpers; changed _impl method signatures to return Result<_, AuthorizationBackendUnavailable>; added server and project re-exports.
Project auth module
crates/lakekeeper/src/service/authz/project.rs
New module: defines ProjectAction, ListProjectsResponse, AuthZProjectActionForbidden, RequireProjectActionError, and AuthZProjectOps with admin-bypass defaults and conversions to error models.
Server auth module
crates/lakekeeper/src/service/authz/server.rs
New module: defines ServerAction, AuthZServerActionForbidden, RequireServerActionError, and AuthZServerOps with admin-bypass defaults and conversions to error models.
OpenFGA authorizer
crates/authz-openfga/src/authorizer.rs
Impl for OpenFGAAuthorizer now sets type ServerAction = ServerRelation and type ProjectAction = ProjectRelation; updated _impl method signatures to accept associated action types and return Result<_, AuthorizationBackendUnavailable>; adjusted internal helper return/error types and mappings; removed ParseOpenFgaEntity from public exports.
OpenFGA relations
crates/authz-openfga/src/relations.rs
Made ServerRelation and ProjectRelation pub; added impl ServerAction for ServerRelation and impl ProjectAction for ProjectRelation; added From<Catalog*> conversions; fixed mapping for CatalogServerAction::CanListUsers.
Allow-all authorizer
crates/lakekeeper/src/service/authz/implementations/allow_all.rs
Added associated types ServerAction = CatalogServerAction and ProjectAction = CatalogProjectAction; updated _impl methods to return Result<_, AuthorizationBackendUnavailable>.
API import updates
crates/lakekeeper/src/api/management/v1/project.rs, .../role.rs, .../user.rs, .../warehouse/mod.rs, crates/lakekeeper/src/server/config.rs
Added imports for AuthZProjectOps and/or AuthZServerOps where needed; no behavioral changes.
Namespace error formatting
crates/lakekeeper/src/service/authz/namespace.rs
Removed backticks around actor placeholder in AuthZNamespaceActionForbidden message formatting.
Project identifier visibility
crates/lakekeeper/src/service/identifier/project.rs
Removed #[cfg(feature = "sqlx")] and changed from_db_unchecked from pub(crate) to pub (kept #[must_use]).
Tests / scaffolding
crates/lakekeeper/src/service/authz/...
Updated test scaffolding and HidingAuthorizer to declare associated types and match new _impl signatures and error/result types.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant AuthZServerOps
    participant Authorizer
    participant Backend

    Note over Client,Backend: Server action — admin-bypass then backend check

    Client->>API: Request(metadata, action)
    API->>AuthZServerOps: require_server_action(metadata, action)
    alt metadata.is_admin()
        AuthZServerOps-->>API: Ok(())
    else
        AuthZServerOps->>Authorizer: is_allowed_server_action_impl(metadata, action: Self::ServerAction)
        Authorizer->>Backend: backend check
        Backend-->>Authorizer: Result<bool, Error>
        alt Ok(true)
            Authorizer-->>AuthZServerOps: Ok(true)
            AuthZServerOps-->>API: Ok(())
        else Ok(false)
            AuthZServerOps-->>API: Err(AuthZServerActionForbidden)
        else Err(_)
            AuthZServerOps-->>API: Err(AuthorizationBackendUnavailable)
        end
    end
Loading
sequenceDiagram
    participant Client
    participant API
    participant AuthZProjectOps
    participant Authorizer
    participant Backend

    Note over Client,Backend: Project action — admin-bypass then backend check

    Client->>API: Request(metadata, project_id, action)
    API->>AuthZProjectOps: require_project_action(metadata, project_id, action)
    alt metadata.is_admin()
        AuthZProjectOps-->>API: Ok(())
    else
        AuthZProjectOps->>Authorizer: is_allowed_project_action_impl(metadata, project_id, action: Self::ProjectAction)
        Authorizer->>Backend: backend check
        Backend-->>Authorizer: Result<bool, Error>
        alt Ok(true)
            AuthZProjectOps-->>API: Ok(())
        else Ok(false)
            AuthZProjectOps-->>API: Err(AuthZProjectActionForbidden)
        else Err(_)
            AuthZProjectOps-->>API: Err(AuthorizationBackendUnavailable)
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Files needing extra attention:
    • crates/lakekeeper/src/service/authz/mod.rs — trait changes, associated-type bounds, and removed wrappers.
    • crates/authz-openfga/src/authorizer.rs & relations.rs — mapping changes, visibility, and error conversion (Into::into) usage.
    • New modules project.rs and server.rs — error-to-API conversions and blanket impl correctness.
    • crates/lakekeeper/src/service/identifier/project.rs — widened visibility implications.

Possibly related PRs

Poem

🐰 I hopped through traits and types today,
Server and Project actions paved the way,
Admins skip checks with a courteous nod,
Relations mapped, errors trod —
A little rabbit cheers this authz play! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.89% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: AuthZ Server and Project Ops" directly refers to the primary features introduced in this pull request: two new authorization trait implementations, AuthZServerOps (in a new server.rs module) and AuthZProjectOps (in a new project.rs module). These traits provide structured operations for server-level and project-level authorization checks. The title is clear, specific, and concise—using the conventional "feat:" prefix to indicate a new feature. A developer scanning the git history would immediately understand that this PR adds new authorization infrastructure for these two operational domains, without relying on vague language or extraneous details.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ct/authz-server-project-ops

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e847f71 and d07d10b.

📒 Files selected for processing (3)
  • crates/authz-openfga/src/authorizer.rs (7 hunks)
  • crates/authz-openfga/src/relations.rs (7 hunks)
  • crates/lakekeeper/src/service/authz/project.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/lakekeeper/src/service/authz/project.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: check-generated-openapi-matches
  • GitHub Check: test
  • GitHub Check: clippy
  • GitHub Check: sqlx-check
🔇 Additional comments (7)
crates/authz-openfga/src/relations.rs (3)

279-283: Bug fix confirmed: CanListUsers now maps correctly.

The From implementation looks good, and the critical bug at Line 381 has been fixed. CatalogServerAction::CanListUsers now correctly maps to ServerRelation::CanListUsers instead of the previously incorrect ServerRelation::CanListAllProjects.

Also applies to: 381-381


442-446: LGTM: Consistent conversion implementation.

The From implementation for CatalogProjectAction follows the same pattern as CatalogServerAction, delegating to the existing to_openfga() method.


1020-1021: LGTM: Correct grant permission mappings.

The mappings for Create → CanGrantCreate and Modify → CanGrantModify are semantically correct and consistent with other GrantableRelation implementations in the file.

crates/authz-openfga/src/authorizer.rs (4)

72-73: LGTM: Associated types correctly defined.

The associated types link the Authorizer implementation to the newly public ServerRelation and ProjectRelation types, providing type safety for authorization actions.


185-190: LGTM: Method signatures refined with associated types and specific error types.

The signature changes across list_projects_impl, is_allowed_server_action_impl, and is_allowed_project_action_impl improve type safety by using associated types for actions and provide more specific error semantics with AuthorizationBackendUnavailable.

Also applies to: 263-275, 277-290


743-751: LGTM: Resilient error handling for project ID parsing.

The filter_map with inspect_err provides good resilience—failed project ID parses are logged and filtered out rather than failing the entire listing operation. This is appropriate for production robustness, ensuring one corrupted ID doesn't break the entire user experience.


1074-1086: LGTM: Error type refinement is consistent.

The return type change to OpenFGABackendUnavailable aligns with the broader error type refactoring across the authorization layer.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Actionable comments posted: 2

🧹 Nitpick comments (7)
crates/lakekeeper/src/service/authz/namespace.rs (1)

100-101: Unify placeholder quoting in the error message

Actor is now unquoted while other placeholders are backticked. For consistency, either quote all or none. Low-priority style nit.

crates/lakekeeper/src/service/identifier/project.rs (1)

73-75: Document invariants for new public unchecked ctor

This bypasses validation and is now public. Add explicit docs stating it must only be used with trusted DB-validated input; prefer try_new for untrusted input.

Apply docs:

 impl ProjectId {
-    #[must_use]
-    pub fn from_db_unchecked(id: String) -> Self {
+    /// Create a ProjectId from a database value without validating the format.
+    ///
+    /// Invariants:
+    /// - `id` MUST originate from trusted storage (e.g., DB with constraints) or prior validation.
+    /// - Do not use for user-provided input. Prefer [`ProjectId::try_new`].
+    #[must_use]
+    pub fn from_db_unchecked(id: String) -> Self {
         Self(id)
     }
 }
crates/lakekeeper/src/server/config.rs (1)

88-114: Ambiguous warehouse arg handling could return a clearer 400

If the arg is foo/bar and foo isn’t a UUID, it’s treated as the full warehouse name (including /). Given “Warehouse names cannot include /”, consider returning a Bad Request instead of letting this flow to a later not-found.

crates/authz-openfga/src/authorizer.rs (1)

743-746: Defensive parse of project IDs from OpenFGA

from_db_unchecked trusts the backend. Guard against accidentally prefixed values (e.g., "project:...") to avoid storing typed strings as raw IDs.

Consider:

-            .into_iter()
-            .map(ProjectId::from_db_unchecked)
-            .collect::<HashSet<ProjectId>>();
+            .into_iter()
+            // list_objects should return bare IDs; filter out anything unexpected
+            .filter(|id| !id.contains(':'))
+            .map(ProjectId::from_db_unchecked)
+            .collect::<HashSet<_>>();

Alternatively, introduce ProjectId::try_from_db(String) -> Result<ProjectId, _> and collect into Result<HashSet<_>, _> with an error on malformed IDs.

crates/lakekeeper/src/service/authz/project.rs (2)

13-17: ProjectAction bounds: consider dropping Copy

Requiring Copy may constrain future action types (e.g., string-backed). Suggest Display + Send + Sync + From<CatalogProjectAction> + PartialEq without Copy unless there's a hard requirement.


115-137: Admin bypass and error shaping are clear

Wrapper uses admin short‑circuit and returns a precise forbidden error with conversions to IcebergErrorResponse. Minor: CI flagged a formatting warning; please run cargo fmt.

crates/lakekeeper/src/service/authz/mod.rs (1)

211-213: Associated action types on Authorizer = breaking change

Public surface changes likely require a release note and downstream updates (impls must define these types).

I can draft a brief migration guide for implementors.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9c4b5e and 003cd27.

📒 Files selected for processing (13)
  • crates/authz-openfga/src/authorizer.rs (8 hunks)
  • crates/authz-openfga/src/relations.rs (5 hunks)
  • crates/lakekeeper/src/api/management/v1/project.rs (1 hunks)
  • crates/lakekeeper/src/api/management/v1/role.rs (1 hunks)
  • crates/lakekeeper/src/api/management/v1/user.rs (1 hunks)
  • crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (1 hunks)
  • crates/lakekeeper/src/server/config.rs (1 hunks)
  • crates/lakekeeper/src/service/authz/implementations/allow_all.rs (4 hunks)
  • crates/lakekeeper/src/service/authz/mod.rs (9 hunks)
  • crates/lakekeeper/src/service/authz/namespace.rs (1 hunks)
  • crates/lakekeeper/src/service/authz/project.rs (1 hunks)
  • crates/lakekeeper/src/service/authz/server.rs (1 hunks)
  • crates/lakekeeper/src/service/identifier/project.rs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
crates/lakekeeper/src/service/authz/project.rs (5)
crates/lakekeeper/src/service/identifier/project.rs (2)
  • fmt (88-90)
  • new (29-31)
crates/lakekeeper/src/request_metadata.rs (1)
  • actor (190-195)
crates/authz-openfga/src/relations.rs (11)
  • from (82-84)
  • from (88-90)
  • from (280-282)
  • from (443-445)
  • from (693-695)
  • from (964-966)
  • from (970-972)
  • from (1194-1196)
  • from (1200-1202)
  • from (1411-1413)
  • from (1417-1419)
crates/iceberg-ext/src/catalog/rest/error.rs (1)
  • forbidden (211-217)
crates/lakekeeper/src/api/management/v1/project.rs (1)
  • list_projects (208-235)
crates/lakekeeper/src/service/authz/server.rs (5)
crates/authz-openfga/src/authorizer.rs (2)
  • new (56-66)
  • server_id (83-85)
crates/lakekeeper/src/service/authz/mod.rs (4)
  • new (701-707)
  • server_id (222-222)
  • server_id (765-767)
  • from (179-181)
crates/lakekeeper/src/request_metadata.rs (1)
  • actor (190-195)
crates/authz-openfga/src/relations.rs (11)
  • from (82-84)
  • from (88-90)
  • from (280-282)
  • from (443-445)
  • from (693-695)
  • from (964-966)
  • from (970-972)
  • from (1194-1196)
  • from (1200-1202)
  • from (1411-1413)
  • from (1417-1419)
crates/iceberg-ext/src/catalog/rest/error.rs (1)
  • forbidden (211-217)
crates/lakekeeper/src/service/authz/mod.rs (2)
crates/authz-openfga/src/authorizer.rs (2)
  • list_projects_impl (185-191)
  • is_allowed_project_action_impl (277-290)
crates/lakekeeper/src/service/authz/implementations/allow_all.rs (2)
  • list_projects_impl (92-97)
  • is_allowed_project_action_impl (129-136)
crates/authz-openfga/src/authorizer.rs (3)
crates/lakekeeper/src/request_metadata.rs (1)
  • actor (190-195)
crates/lakekeeper/src/service/identifier/project.rs (1)
  • from_db_unchecked (74-76)
crates/authz-openfga/src/relations.rs (8)
  • relation (26-26)
  • relation (194-199)
  • relation (333-338)
  • relation (545-556)
  • relation (790-800)
  • relation (1067-1077)
  • relation (1286-1295)
  • relation (1495-1503)
🪛 GitHub Check: check-format
crates/lakekeeper/src/service/authz/project.rs

[warning] 125-125:
Diff in /home/runner/work/lakekeeper/lakekeeper/crates/lakekeeper/src/service/authz/project.rs

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: test
  • GitHub Check: sqlx-check
  • GitHub Check: check-generated-openapi-matches
  • GitHub Check: clippy
🔇 Additional comments (24)
crates/authz-openfga/src/relations.rs (5)

6-7: Imports look good

Bringing ServerAction/ProjectAction into scope is appropriate for the new impls.


258-274: Public API surface widened (ServerRelation now pub)

This enum is now public. Ensure this is intentional and accounted for in semver/docs.


275-276: LGTM: ServerRelation implements ServerAction

Makes it usable as the associated action type. All good.


405-437: Public API surface widened (ProjectRelation now pub)

Same note as for ServerRelation: confirm intended exposure and update docs/changelog.


439-446: LGTM: ProjectRelation implements ProjectAction and From

This aligns the associated action pattern. Looks good.

crates/lakekeeper/src/server/config.rs (1)

14-17: LGTM: Added AuthZProjectOps/CatalogProjectAction imports

Matches usage in get_config with require_project_action.

crates/lakekeeper/src/api/management/v1/user.rs (1)

13-15: LGTM: Import AuthZServerOps

Aligns with existing calls to server-scoped authz methods.

crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (1)

32-35: AuthZ trait imports correctly bring extension methods into scope.

These imports are required for calls like require_project_action and are_allowed_tabular_actions_vec to resolve on Authorizer. Looks good.

crates/lakekeeper/src/api/management/v1/role.rs (1)

13-13: LGTM on AuthZ import.

AuthZProjectOps is needed for require_project_action; import is correct and minimal.

crates/lakekeeper/src/api/management/v1/project.rs (1)

18-21: Import set aligns with new server/project AuthZ ops.

Bringing AuthZServerOps/AuthZProjectOps into scope enables require_server_action and list_projects; aliasing ListProjectsResponse avoids confusion. All good.

crates/lakekeeper/src/service/authz/implementations/allow_all.rs (3)

56-58: Associated action types wired correctly.

Declaring ServerAction/ProjectAction as Catalog*Action matches the updated Authorizer API.


121-127: is_allowed_{server,project}_action_impl now propagate backend availability.

Both methods correctly return std::result::Result<bool, AuthorizationBackendUnavailable> and default to Ok(true) for AllowAll.

Also applies to: 129-136


92-97: Return type is correctly implemented and consistent with trait.

Verified that list_projects_impl in AllowAllAuthorizer correctly returns std::result::Result<ListProjectsResponse, AuthorizationBackendUnavailable>, matching the trait definition and surfacing the backend error type as expected.

crates/lakekeeper/src/service/authz/server.rs (2)

78-93: Admin short‑circuit and MustUse wrapper are clean.

is_allowed_server_action correctly bypasses backend for admins and wraps the result in MustUse.


94-113: require_server_action control flow is correct.

Denies map to AuthZServerActionForbidden with server_id/action; ok.

crates/authz-openfga/src/authorizer.rs (5)

72-74: Associated action types: good upgrade path

Using Self::ServerAction/Self::ProjectAction improves decoupling and implementation flexibility.


188-191: list_projects_impl: consistent error mapping

Returning Result<_, AuthorizationBackendUnavailable> and mapping via Into is clean.


266-275: Server action check uses associated type

Signature and error type look correct and consistent across the interface.


281-290: Project action check uses associated type

Signature/error align with the new ProjectAction abstraction.


1073-1079: list_objects: unified OpenFGA error type

Returning Result<Vec, OpenFGABackendUnavailable> with Into mapping keeps error propagation consistent.

crates/lakekeeper/src/service/authz/project.rs (1)

21-27: ListProjectsResponse API looks good

Clear semantics (All vs. explicit set) and PartialEq derivation enable straightforward testing.

crates/lakekeeper/src/service/authz/mod.rs (3)

29-32: Module wiring

project/server modules exported — good separation of concerns for ops‑level helpers.


241-246: list_projects_impl: result shape unified

Aligns with new AuthorizationBackendUnavailable across the stack.


309-314: Server/Project action impl signatures updated

Consistent use of associated types and unified error type. Tests (HidingAuthorizer) reflect the change.

Also applies to: 317-323

Comment thread crates/authz-openfga/src/relations.rs Resolved
@c-thiel

c-thiel commented Oct 28, 2025

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Oct 28, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
crates/authz-openfga/src/relations.rs (2)

1013-1022: Critical: GrantableRelation mapping for Namespace uses non-Grant actions.

Create/Modify should require grant permissions (CanGrantCreate/CanGrantModify), not resource operations (CanCreateNamespace/CanUpdateProperties). Current mapping enables privilege escalation.

 impl GrantableRelation for APINamespaceRelation {
     fn grant_relation(&self) -> NamespaceRelation {
         match self {
             APINamespaceRelation::Ownership => NamespaceRelation::CanChangeOwnership,
             APINamespaceRelation::PassGrants => NamespaceRelation::CanGrantPassGrants,
             APINamespaceRelation::ManageGrants => NamespaceRelation::CanGrantManageGrants,
             APINamespaceRelation::Describe => NamespaceRelation::CanGrantDescribe,
             APINamespaceRelation::Select => NamespaceRelation::CanGrantSelect,
-            APINamespaceRelation::Create => NamespaceRelation::CanCreateNamespace,
-            APINamespaceRelation::Modify => NamespaceRelation::CanUpdateProperties,
+            APINamespaceRelation::Create => NamespaceRelation::CanGrantCreate,
+            APINamespaceRelation::Modify => NamespaceRelation::CanGrantModify,
         }
     }
 }

Please add tests mirroring Warehouse/Table/View grantability to prevent regressions.


345-360: Let me directly examine the file content to verify the current state of the code:

Based on my verification using the first script execution, I have confirmed the current state of the codebase:

  1. The initial script search for APIServerAction::GrantOperator|CanGrantOperator returned only results for ServerRelation and APIServerRelation, with no matches for APIServerAction::GrantOperator. This confirms that the GrantOperator variant is currently missing from the APIServerAction enum.

  2. The codebase already has:

    • CanGrantOperator in ServerRelation (line 273)
    • A mapping in APIServerRelation for Operator => ServerRelation::CanGrantOperator (line 308)
  3. The review comment correctly identifies a parity gap: there's a CanGrantOperator relation but no corresponding APIServerAction::GrantOperator variant.

  4. Due to Rust's exhaustive pattern matching requirement, any new enum variant must have a corresponding match arm in the to_openfga implementation.

The review comment's suggestion is accurate and follows proper Rust patterns. The diff is correct and complete.

Expose GrantOperator in APIServerAction for consistency.

There's a CanGrantOperator relation but no APIServerAction variant for it. Add GrantOperator to match the pattern used by GrantAdmin and support capability introspection. The suggested diff correctly adds both the enum variant with documentation and the corresponding match arm in the to_openfga implementation.

♻️ Duplicate comments (1)
crates/authz-openfga/src/relations.rs (1)

381-381: Fix for CanListUsers mapping looks right; please add a regression test.

This resolves the previously reported mis-map to CanListAllProjects. Add a unit test to lock this in.

@@
 #[cfg(test)]
 pub(crate) mod test {
     use super::*;
+    use lakekeeper::service::authz::CatalogServerAction;
+
+    #[test]
+    fn catalog_server_action_can_list_users_maps_correctly() {
+        let rel: ServerRelation = CatalogServerAction::CanListUsers.into();
+        assert_eq!(rel, ServerRelation::CanListUsers);
+    }
 }
🧹 Nitpick comments (4)
crates/authz-openfga/src/relations.rs (4)

258-274: Making ServerRelation public: confirm API-surface intent and semver.

This broadens the public API. If the crate is versioned semantically, bump minor (or major if stability was promised) and document the new surface. Consider re-exporting via a prelude if you want a narrower user-facing API.


279-283: From bridge is fine; consider also supporting refs.

Add a borrowed conversion for ergonomics and parity with other types that implement both by-value and by-ref conversions.

+impl From<&CatalogServerAction> for ServerRelation {
+    fn from(action: &CatalogServerAction) -> Self {
+        action.to_openfga()
+    }
+}

405-437: Making ProjectRelation public: confirm exposure and docs.

Same note as for ServerRelation: ensure intended public exposure and update changelog/release notes.


442-446: From bridge: add borrowed variant for parity.

+impl From<&CatalogProjectAction> for ProjectRelation {
+    fn from(action: &CatalogProjectAction) -> Self {
+        action.to_openfga()
+    }
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 003cd27 and e847f71.

📒 Files selected for processing (2)
  • crates/authz-openfga/src/relations.rs (6 hunks)
  • crates/lakekeeper/src/service/authz/project.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/lakekeeper/src/service/authz/project.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: sqlx-check
  • GitHub Check: clippy
  • GitHub Check: check-generated-openapi-matches
  • GitHub Check: check-format
  • GitHub Check: test
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: openfga
🔇 Additional comments (3)
crates/authz-openfga/src/relations.rs (3)

6-6: Imports align with new associated-action impls.

Good addition; resolves orphan-rule constraints for impls below.


275-275: ServerAction impl for ServerRelation looks correct.

Matches the new Authorizer associated type usage.


439-439: ProjectAction impl for ProjectRelation looks good.

@c-thiel

c-thiel commented Oct 28, 2025

Copy link
Copy Markdown
Member Author

@CodeRabbit review. Approve if all resolved.

@coderabbitai

coderabbitai Bot commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

@c-thiel, I'll review the changes and approve if all issues are resolved.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

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

@coderabbitai

coderabbitai Bot commented Oct 29, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Comments resolved and changes approved.

@c-thiel
c-thiel merged commit 9ef02d1 into main Oct 29, 2025
@c-thiel
c-thiel deleted the ct/authz-server-project-ops branch October 29, 2025 07:06
mrjoe7 added a commit to mrjoe7/lakekeeper that referenced this pull request Oct 30, 2025
* feat: Publish images to Dockerhub (lakekeeper#1274)

* feat: Update UI to 0.9.0 with multi-project support (lakekeeper#1275)

* chore: release 0.9.4

Release-As: 0.9.4

* chore: release main (lakekeeper#1262)

* chore(ci): Fix Dockerhub login

* chore(docs): Improve developer guide (lakekeeper#1265)

* chore(docs): add info regarding `view_version`'s internal representation (lakekeeper#1261)

* chore(docs): Architecture clarify Secret Store (lakekeeper#1284)

* fix: Update Limes to 0.2.2 - Fixes compilation issue due to breaking `jwks_client_rs` change (lakekeeper#1282)

* fix: Update Limes to 0.2.2

* increase min rust version

* chore: release 0.9.5

Release-As: 0.9.5

* chore: release main (lakekeeper#1286)

* chore: enable changelog sections for release-please (lakekeeper#1264)

k

* fix(deps): update rust crate rand to v0.9.2 (lakekeeper#1252)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-channel to v2.5.0 (lakekeeper#1225)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency mkdocs-material to v9.6.17 (lakekeeper#1289)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate anyhow to v1.0.99 (lakekeeper#1290)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: Remove bitnami images (lakekeeper#1288)

* feat!: Move to Lakekeeper IO based on hyperscaler SDKs (lakekeeper#1285)

* chore(deps): update rust crate reqwest to v0.12.23 (lakekeeper#1294)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(docs): Improve Cloud storage test docs

* fix: accept "disable" as PG sslmode as documented (lakekeeper#1303)

* feat: Simplify task interface, re-exports, enable delete-after-commit (lakekeeper#1302)

* feat: Introduce `RequestMetadata` for Internal Principals which bypass AuthZ (lakekeeper#1306)

* chore(deps): update azure/setup-helm action to v4.3.1 (lakekeeper#1299)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(test): use nextest filterset instead of needs_env_var (lakekeeper#1304)

* chore(deps): update rust crate openssl-src to v300.5.2 (lakekeeper#1292)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-compression to v0.4.28 (lakekeeper#1311)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate thiserror to v2.0.16 (lakekeeper#1296)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Provide `ApiContext` to externally registered tasks (lakekeeper#1307)

* feat!: Simplify Task interface, extend SpecializedTask interface (lakekeeper#1310)

* feat: Improve authorizer `are_allowed_*` batch check signature (lakekeeper#1315)

* chore(authz): Enforce use of AuthZ decisions with #[must_use] (lakekeeper#1317)

* feat: Task Management APIs (lakekeeper#1316)

* chore(deps): update rust crate tracing-subscriber to v0.3.20 [security] (lakekeeper#1318)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Add `RunNow` and `RunAt` to Controls for Tasks (lakekeeper#1322)

* chore(deps): update rust crate tokio-util to v0.7.16 (lakekeeper#1313)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(docs): Improve Entra ID docs (lakekeeper#1325)

* chore(docs): Improve Upgrades & Migration docs (lakekeeper#1326)

* feat: Add tasks heartbeat with Catalog state (lakekeeper#1324)

* ci: add configuration for CodeRabbit reviews (lakekeeper#1327)

* feat: Add optional STS session-tags in S3 STS requests for ABAC authorization (lakekeeper#1230)

* feat: Random Server IDs (lakekeeper#1328)

* chore(deps): update rust crate percent-encoding to v2.3.2 (lakekeeper#1312)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(authz): Deprecate Permission Endpoints for Tables without WarehouseIDs (lakekeeper#1334)

* fix: Tasks endpoints in router (lakekeeper#1335)

* feat(ci): add nextest profile ci_no_secrets for external PRs (lakekeeper#1333)

* chore(deps): update rust crate chrono to v0.4.42 (lakekeeper#1331)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: Pin examples duckdb version to 1.3 (lakekeeper#1343)

* feat!: Require warehouse_id when checking permissions on views or tables via ID (lakekeeper#1340)

* fix: migrate away from bitnami in unittest.yml (lakekeeper#1344)

* chore: Remove coderabitt config

* fix(docs): Fix inconsistent URL format in README (lakekeeper#1345)

Co-authored-by: Christian <[email protected]>

* feat: Remove serde_yaml & serde_yml (lakekeeper#1341)

* feat!: add `warehouse_id` to PKs of all `table_*` and `view_*` tables (lakekeeper#1254)

* feat: Minor namespace join performance improvements

* fix: Warehouse permissions are directly used for task retrieval & control (lakekeeper#1347)

* fix: Potential Race Condition when undropping Tabulars (lakekeeper#1342)

* fix: table rename authz and error handling (lakekeeper#1346)

Co-authored-by: Andre Luis Anastacio <[email protected]>

* chore(deps): update rust crate google-cloud-auth to v1.1.2 (lakekeeper#1337)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update rust crate time to v0.3.44 (lakekeeper#1349)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency mkdocs-material to v9.6.20 (lakekeeper#1309)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* feat: Set ServerID during migration (lakekeeper#1348)

* chore(deps): Remove utoipa fork (lakekeeper#1352)

* chore(deps): update rust crate serde_with to v3.14.1 (lakekeeper#1351)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate url to v2.5.7 (lakekeeper#1354)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-compression to v0.4.30 (lakekeeper#1323)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update rust crate serde_json to v1.0.145 (lakekeeper#1250)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update strum monorepo to v0.27.2 (lakekeeper#1251)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update serde monorepo to v1.0.226 (lakekeeper#1355)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update rust crate clap to v4.5.48 (lakekeeper#1356)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Add Entity Names to Tasks (lakekeeper#1353)

* fix: case insensitivity of catalog endpoints (lakekeeper#1338)

* fix: Improve delete_warehouse error message for active tasks

* chore(deps): update rust crate tempfile to v3.22.0 (lakekeeper#1359)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update rust crate axum-prometheus to 0.9.0 (lakekeeper#1358)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: PgSslMode not supported error string

* feat(authz)!: add OpenFGA schema v4 and v3->v4 migration (lakekeeper#1314)

Co-authored-by: Christian <[email protected]>
Co-authored-by: Christian Thiel <[email protected]>

* chore(deps): update rust crate uuid to v1.18.1 (lakekeeper#1362)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency markdown-grid-tables to v0.6.0 (lakekeeper#1357)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate anyhow to v1.0.100 (lakekeeper#1350)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: clippy

* chore(deps): update rust crate moka to v0.12.11 (lakekeeper#1365)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate tempfile to v3.23.0 (lakekeeper#1367)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-nats to 0.43.0 (lakekeeper#1366)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-node action to v5 (lakekeeper#1371)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/checkout action to v5 (lakekeeper#1369)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-python action to v6 (lakekeeper#1372)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: V3 support (lakekeeper#1364)

* chore: Set Get Task Permission to "CanGetMetadata" (lakekeeper#1376)

* chore(deps): update dependency node to v22 (lakekeeper#1373)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(authz)!: extend OpenFGA tabular entities with WarehouseId (lakekeeper#1329)


---------

Co-authored-by: Christian <[email protected]>
Co-authored-by: Christian Thiel <[email protected]>

* feat: Add support for tasks affecting views (lakekeeper#1378)

* feat(authz): Add specific Task Actions (lakekeeper#1379)

* chore(tests): Test with Iceberg 1.9.2 & 1.10.0 (lakekeeper#1267)

* feat: Enrich task metadata with concrete tabular type (lakekeeper#1383)

* feat: Add loadTable Snapshots filter (lakekeeper#1385)

* feat: add endpoint for fuzzy search of tabulars (lakekeeper#1387)

* feat: Update UI to 0.10.0 (lakekeeper#1390)

* feat(ui): Update UI to 0.10.1

* chore: Use lakekeeper re-exports in bin (lakekeeper#1391)

* fix(tabular-search): distance and docs for `searchterm is uuid` (lakekeeper#1393)

* chore(examples): Idempotent bucket creation in minimal example (lakekeeper#1386)

In the case where you already have a bucket created, like the "examples" bucket, I ran into an issue where the createbuckets service fails, and this prevents lakekeeper from starting back up.

This fix adds a simple minio flag to ignore buckets that already exist, making things even more user friendly

* feat: Make number of workers spawned for Expiration & Purge configurable (lakekeeper#1395)

* chore: release main (lakekeeper#1295)

* chore: added gif to readme (lakekeeper#1396)

* chore: remove unneded `#[allow(dead_code)]` (lakekeeper#1399)

* fix: Use FnOnce for queue & service registration

* Revert "fix: Use FnOnce for queue & service registration"

This reverts commit 47b03a0.

* chore(docs): Add 0.10 docs

* perf(db): remove `join namespace` from `active_tabulars` view (lakekeeper#1401)

* doc(db): how to connect to db and inspect schema (lakekeeper#1402)

* feat: implement `OpenFgaEntity` for `ServerId` (lakekeeper#1394)

* impl OpenFgaEntity
* Use the implementation

* fix: Use FnOnce for queue & service registration (lakekeeper#1404)

* chore(deps): update dependency mkdocs-material to v9.6.21 (lakekeeper#1406)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Expose client-managed X-Iceberg-Access-Delegation (lakekeeper#1407)

* fix: Use higher consistency for some OpenFGA queries (lakekeeper#1408)

* feat: Improve Kubernetes Auth docs (lakekeeper#1415)

* chore: release 0.10.1

Release-As: 0.10.1

* fix: Endpoint stats for Project Endpoints (lakekeeper#1412)

* feat: Add create table guard to cleanup location on Failure (lakekeeper#1418)

* chore: Generate ID types with Macro (lakekeeper#1419)

* chore: Re-Export Tokio from lakekeeper-io create (lakekeeper#1420)

* fix: Add support for `write.metadata.metrics.` Table Properties (lakekeeper#1422)

* fix: Update UI to 0.10.2 (lakekeeper#1423)

* chore: release main (lakekeeper#1403)

* fix: Parse empty ProjectID headers as None (lakekeeper#1424)

* chore: release 0.10.2

Release-As: 0.10.2

* chore: release main (lakekeeper#1425)

* feat: Add `debug_migrate_before_serve` env var (lakekeeper#1426)

* feat: Move OpenFGA Authorizer to separate crate (lakekeeper#1421)

* chore(renovate): Group dependencies

* chore(renovate): ignore additional deps

* chore: Rename src/service -> src/server, trait Catalog -> CatalogStore (lakekeeper#1428)

* feat(examples): add k8s iceberg sink connector (avro) (lakekeeper#1336)


---------

Co-authored-by: Christian <[email protected]>

* chore(ci): Fix release please (lakekeeper#1433)

* feat: Expose License Information via API (lakekeeper#1432)

* fix(deps): update all non-major dependencies (lakekeeper#1429)

* chore(ci): Remove mgmt API version update via release-please

* chore: Restructure catalog_store into multiple modules (lakekeeper#1434)

* feat: Validate Downscoping works on Warehouse creation (lakekeeper#1437)

* chore(ci): Fix release please

* docs: Add info about installing sqlx to developer-guide.md (lakekeeper#1438)

* docs: Update developer-guide.md (lakekeeper#1439)

* chore(deps): update all non-major dependencies (lakekeeper#1436)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: Better normalization for ARNs in S3 Profile (lakekeeper#1441)

* chore(deps): update all non-major dependencies (lakekeeper#1442)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(main): release 0.10.3 (lakekeeper#1427)

* fix: Release Please CI outputs

* fix(ci): Revert 0.10.3 release

* chore(main): release 0.10.3 (lakekeeper#1446)

* feat: Introduce CatalogWarehouseOps & CatalogNamespaceOps abstractions (lakekeeper#1440)

* feat: Allow x-user-agent header (lakekeeper#1453)

* feat: Table & View Ops Abstractions, Improved Error Handling (lakekeeper#1454)

* fix: CORS allow access delegation & etag headers (lakekeeper#1455)

* fix: Headers should be lowercase (lakekeeper#1457)

* chore(tests): Add trino information_schema.tables test (lakekeeper#1456)

* chore: Introduce open-api feature to gate utoipa and swagger (lakekeeper#1458)

* chore: Release As 0.11

* fix: Debug assertion table identifier mismatch for signer (lakekeeper#1460)

* feat: Caching Short-Term-Credentials (STC) (lakekeeper#1459)

* feat: Warehouse Cache (lakekeeper#1462)

* chore(deps): update actions/setup-node action to v6 (lakekeeper#1443)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Version based Warehouse Cache (lakekeeper#1465)

* feat: AuthZ Server and Project Ops (lakekeeper#1471)

* chore(deps): update github artifact actions (lakekeeper#1461)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: Rename release branch pattern to rel-*

* feat: Catalog returns full Namespace Hierarchy for nested Namespaces (lakekeeper#1472)

---------

Co-authored-by: Christian <[email protected]>
Co-authored-by: Christian Thiel <[email protected]>
Co-authored-by: Dao Thanh Tung <[email protected]>
Co-authored-by: Moritz Zielke <[email protected]>
Co-authored-by: Baptiste Gouhoury <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dolan Antenucci <[email protected]>
Co-authored-by: Anatoly Popov <[email protected]>
Co-authored-by: Andre Luis Anastacio <[email protected]>
Co-authored-by: Scott Haines <[email protected]>
Co-authored-by: Viktor Kessler <[email protected]>
Co-authored-by: Yohan Valencia <[email protected]>
Co-authored-by: Paul Roman <[email protected]>
@c-thiel c-thiel added this to the Release 0.11.0 milestone Nov 4, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Feb 4, 2026
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