Skip to content

Commit c366b21

Browse files
committed
improve variable name
1 parent daa1b21 commit c366b21

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

fluss-flink/fluss-flink-common/src/main/java/com/alibaba/fluss/flink/procedure/AclProcedure.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public String identifier() {
4848
* through the Flink SQL procedure interface. It delegates execution to the internalCall method.
4949
*
5050
* @param context The procedure context used for execution environment and resource access.
51-
* @param aclType Type of ACL operation to perform. Valid values are:
51+
* @param action Actoion of ACL operation to perform. Valid values are:
5252
* <ul>
5353
* <li>{@code ADD}: Adds an ACL entry.
5454
* <li>{@code DROP}: Removes an ACL entry.
@@ -62,7 +62,7 @@ public String identifier() {
6262
* <li>{@code fluss-cluster.db_name.table_name} - table level
6363
* </ul>
6464
*
65-
* @param permissionType Permission type to grant or revoke. Common values include in {@link
65+
* @param permission Permission type to grant or revoke. Common values include in {@link
6666
* PermissionType}.
6767
* @param principal Principal (user or role) to apply the ACL to. Accepts:
6868
* <ul>
@@ -85,23 +85,23 @@ public String identifier() {
8585
*/
8686
public String[] call(
8787
ProcedureContext context,
88-
String aclType,
88+
String action,
8989
String resource,
90-
String permissionType,
90+
String permission,
9191
String principal,
9292
String operation)
9393
throws ExecutionException, InterruptedException {
94-
return internalCall(aclType, resource, permissionType, principal, operation);
94+
return internalCall(action, resource, permission, principal, operation);
9595
}
9696

9797
private String[] internalCall(
98-
String aclType,
98+
String action,
9999
String resource,
100100
String permissionType,
101101
String principal,
102102
String operation)
103103
throws ExecutionException, InterruptedException {
104-
AclType type = AclType.valueOf(aclType);
104+
Action type = Action.valueOf(action);
105105
PermissionType permission = PermissionType.valueOf(permissionType);
106106
FlussPrincipal flussPrincipal = parsePrincipal(principal);
107107
OperationType operationType = OperationType.valueOf(operation);
@@ -222,7 +222,7 @@ private Resource parseResource(String resourceStr) {
222222
return resource;
223223
}
224224

225-
private enum AclType {
225+
private enum Action {
226226
ADD,
227227
LIST,
228228
DROP

fluss-flink/fluss-flink-common/src/test/java/com/alibaba/fluss/flink/security/acl/FlinkAuthorizationITCase.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,10 @@ List<String> listAcl(Resource resource, OperationType operationType) {
414414
TableResult tableResult =
415415
tEnv.executeSql(
416416
String.format(
417-
"CALL %s.sys.acl('LIST', '%s', 'ALLOW', '%s', '%s')",
417+
"CALL %s.sys.acl( action => 'LIST', resource => '%s', permission => 'ALLOW', principal => '%s', operation => '%s')",
418418
ADMIN_CATALOG_NAME,
419419
getProcedureResourceString(resource),
420-
ResourceType.ANY == resource.getType()
421-
? "ANY"
422-
: String.format("%s:%s", guest.getType(), guest.getName()),
420+
String.format("%s:%s", guest.getType(), guest.getName()),
423421
operationType.name()));
424422
List<Row> rows = CollectionUtil.iteratorToList(tableResult.collect());
425423
return rows.stream().map(Row::toString).collect(Collectors.toList());
@@ -432,9 +430,7 @@ void dropAcl(Resource resource, OperationType operationType)
432430
"CALL %s.sys.acl('DROP', '%s', 'ANY', '%s', '%s')",
433431
ADMIN_CATALOG_NAME,
434432
getProcedureResourceString(resource),
435-
ResourceType.ANY == resource.getType()
436-
? "ANY"
437-
: String.format("%s:%s", guest.getType(), guest.getName()),
433+
String.format("%s:%s", guest.getType(), guest.getName()),
438434
operationType.name()))
439435
.await();
440436
}

0 commit comments

Comments
 (0)