Skip to content

feat(rest): add permission management APIs - #820

Draft
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:rest-permission-management
Draft

feat(rest): add permission management APIs#820
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:rest-permission-management

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Sep 12, 2026

Copy link
Copy Markdown
Member

Purpose

Ports the client half of the experimental REST management API added in apache/paimon#9393 (object permissions; wire contract in apache/paimon#9406) to Rust.

What it adds

GET  /v1/{prefix}/permissions?resourceType&database&table&function&view&principal&access&maxResults&pageToken
POST /v1/{prefix}/permissions/grant
POST /v1/{prefix}/permissions/revoke

api/management.rs mirrors org.apache.paimon.management (ResourceType, PermissionResource, PermissionAccess, PermissionColumns, PermissionAssignment, ListPermissionsRequest), and RESTApi gains list_permissions_paged, grant_permission and revoke_permission, with thin delegates on RESTCatalog. Wire names, query parameters and client-side validation follow Java. No new dependencies.

Notes for review

  • Responses are not validated on deserialize, only requests. This matches Java's non-validating Jackson constructor and is deliberate: a server may list a value a client could not have submitted, and one such row must not fail a whole page.
  • The management methods stay off the Catalog trait, on RESTCatalog only, as in Java — no other catalog implementation speaks this contract. They are exposed as plain methods rather than behind a permissionManagement() wrapper.
  • A grant posts PermissionAssignment directly; Java's separate GrantPermissionRequest has the identical wire shape, so a second type would carry nothing.
  • PermissionResource's locator getters are database_name(), table_name(), function_name(), view_name() — Rust cannot give a constructor and a getter the same name, and the constructors take the plain names.
  • expireTime must end in Z, matching Instant.parse on JDK 8/11. JDK 12 widened ISO_INSTANT to accept other offsets, so against a server on a newer JDK this client is the stricter of the two.

@plusplusjiajia
plusplusjiajia force-pushed the rest-permission-management branch from f2b6401 to ce3402f Compare September 12, 2026 12:10
@plusplusjiajia
plusplusjiajia force-pushed the rest-permission-management branch from ce3402f to 5a7b1f5 Compare September 12, 2026 14:27
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