Uh oh!
There was an error while loading. Please reload this page.
[api] Add REST permission management - #9393
Conversation
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| private final String expireTime; | ||
| @JsonCreator |
There was a problem hiding this comment.
This @JsonCreator is also the strict-validation constructor, and it deserializes ListPermissionsResponse.permissions — so anything the client doesn't recognize fails the whole page, not one row. E.g. Instant.now() is microsecond-precision on JDK 9+, so a server returning ...00.123456Z breaks every list call; such a record can't be revoked either, since RevokePermissionRequest runs the same canonicalize.
Since the server decides anyway, could we keep validation on the request path and let the response path be lenient — e.g. move @JsonCreator to a package-private unvalidated constructor?
There was a problem hiding this comment.
Fixed in 8f9b504. The public constructor remains strict for grant requests, while Jackson response deserialization now uses a package-private unvalidated constructor. Added shaded and external Jackson coverage for a microsecond-precision expireTime response, while verifying the same value is still rejected on the grant request path.
| MAX_PAGE_SIZE); | ||
| this.principal = isBlank(principal) ? null : principal; | ||
| this.access = isBlank(access) ? null : PermissionAccess.canonicalize(resource, access); | ||
| this.pageToken = isBlank(pageToken) ? null : pageToken; |
There was a problem hiding this comment.
When a server emits a nonempty whitespace-only continuation token, withPageToken routes it through this constructor and converts it to null; the next GET then omits pageToken and fetches the first page again, and PagedList.listAllFromPagedApi can loop indefinitely if that page keeps returning the token. Page tokens are
opaque and the paging API uses null as the first-page marker, so retain the returned token unchanged.
There was a problem hiding this comment.
Fixed in 8f9b504. ListPermissionsRequest now preserves pageToken verbatim, including nonempty whitespace-only opaque tokens. Added a regression assertion through withPageToken.
plusplusjiajia
commented
Aug 26, 2026
Overall shape looks right — filling the management-plane gap next to the existing authTableQuery enforcement path, and staying on the existing conventions. Left two questions inline above. |
plusplusjiajia
commented
Aug 26, 2026
LGTM +1 |
Uh oh!
There was an error while loading. Please reload this page.
Purpose
Introduce experimental Java and REST client contracts for managing catalog permissions.
Changes
RESTCatalog.Scope
This is part 1 of a planned split. Data policy management, the management OpenAPI/documentation, and Spark SQL procedures will follow in separate PRs.
Tests
mvn -pl paimon-api -DskipITs -Dfast -Dtest=PermissionManagementJsonTest,RESTPermissionManagementTest,RequestJacksonCompatibilityTest testmvn -pl paimon-core -am -DskipITs -Dfast -Dtest=ResourcePathsTest -Dsurefire.failIfNoSpecifiedTests=false test