[api] Add REST policy management - #9400
Conversation
| boolean ignoreIfNotExists) { | ||
| checkNotNull(resource, "resource cannot be null").validatePolicyAttachment(); | ||
| try { | ||
| client.delete( |
There was a problem hiding this comment.
The six existing client.delete call sites pass a path that identifies the object; here the path is the collection (.../tables/{t}/policies) and the body picks one policy. A body that doesn't survive the hop leaves a well-formed, wider request rather than a malformed one — RFC 9110 §9.3.5: DELETE content "cannot alter the meaning or target of the request". (Fail-closed under DLF auth, which signs the body; not under bearer.)
#9393 hit this for revoke and used POST /permissions/revoke — would POST .../policies/drop work here too?
There was a problem hiding this comment.
Fixed in 2694ee84a7. Policy removal now uses POST .../policies/drop with DropPolicyRequest in the body; the collection endpoint is no longer targeted by a body-bearing DELETE. I also updated the HTTP behavior and resource-path regression tests while preserving the existing 404/ignoreIfNotExists handling.
|
LGTM +1 |
Purpose
Add experimental Java and REST client contracts for managing table row-filter and column-masking policies. This is the second change in the split series following #9393.
Changes
DataPolicy,RowFilter,ColumnMask,PolicyType, and policy list filtersRESTCatalog.policyManagement()PolicyAlreadyExistExceptionwhile preserving non-policy REST conflictsPOST .../policies/drop, and preserve pagination tokens as opaque valuesScope
This PR intentionally contains only the PolicyManagement Java contract and REST client integration. The management OpenAPI/documentation and Spark SQL integration will follow in separate PRs.
Tests
mvn -pl paimon-api -DskipITs testmvn -pl paimon-api -Pflink1,spark3 -DskipITs -DwildcardSuites=none -Dtest=PolicyManagementJsonTest,RESTPolicyManagementTest clean testmvn -pl paimon-core -am -DskipITs -DwildcardSuites=none -Dtest=ResourcePathsTest -DfailIfNoTests=false test