Repository navigation
[flink] Support grant, revoke and list_permissions procedures - #10437
Stephen0421 wants to merge 1 commit into
Conversation
|
[P2] Preserve column identity before granting permissions
I reproduced this through actual Flink 1.20 SQL and the REST catalog test server: CREATE TABLE mydb.space_columns (`secret` STRING, ` secret ` STRING)
WITH ('query-auth.enabled' = 'true');
CALL sys.grant_permission(
resource_type => 'COLUMN', access => 'SELECT', principal => 'analyst',
`database` => 'mydb', `table` => 'space_columns',
excluded_column_names => ' secret '
);
Please use an input representation that preserves exact names, or reject inputs that cannot be represented without changing their identity before making the grant. Documenting only the comma limitation does not cover this silent rewrite. Validation: the seven existing permission procedure integration cases pass with standard JDK 8 Maven checks. An additional real SQL identity assertion fails ( |
Expose the existing REST permission APIs through Flink SQL, matching the Spark procedures.
1389fe0 to
e610abf
Compare
Column names are now a single JSON array of exact strings, for example Flink procedure arguments have to be literals, so these parameters stay STRING instead of ARRAY. An ARRAY argument fails while parsing the call. The value must be one complete JSON array: parsing uses FAIL_ON_TRAILING_TOKENS, so
|
Purpose
Add the Flink procedures
sys.grant_permission,sys.revoke_permission, andsys.list_permissions, matching the existing Spark procedures.They call
RESTCatalog.permissionManagement()and do not change the REST API or theCataloginterface. A filesystem catalog fails withCatalog does not support permission management.These procedures require Flink 1.19 or later. Column ranges are passed as comma-separated names, for example
column_names => 'order_id,region'.list_permissionsstill returnscolumn_namesandexcluded_column_namesasARRAY<STRING>. A column name that itself contains a comma cannot be represented.Test
PermissionProcedureITCase: grant, replace, list, and idempotent revoke; pagination;CATALOG_ALLandDATABASE_ALL; column allowlist and denylist; positional 8-argument and 10-argument callsresource_type, emptyprincipal, both column lists, and column names on a non-COLUMNresource are rejectedPermissionProcedureUnsupportedCatalogITCase: a filesystem catalog is rejected