From d12c88f66c2d6d96490709fc7523dac857cdac2a Mon Sep 17 00:00:00 2001 From: yangyx <360508847@qq.com> Date: Fri, 20 Sep 2024 17:07:43 +0800 Subject: [PATCH 1/2] fix(authorization-ranger):the descr field of ranger table x_group is not null --- .../authorization/ranger/RangerAuthorizationPlugin.java | 2 +- .../gravitino/authorization/ranger/reference/VXGroup.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java index 3b503a3f91c..593a46f2fb7 100644 --- a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java +++ b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java @@ -383,7 +383,7 @@ public Boolean onUserAcquired(User user) throws RuntimeException { @Override public Boolean onGroupAdded(Group group) throws RuntimeException { - return rangerClient.createGroup(VXGroup.builder().withName(group.name()).build()); + return rangerClient.createGroup(VXGroup.builder().withName(group.name()).withDescription(group.name()).build()); } @Override diff --git a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java index f409cdeb045..3a58f5c95a0 100644 --- a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java +++ b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java @@ -91,6 +91,11 @@ public Builder withName(String name) { return this; } + public Builder withDescription(String description) { + vxGroup.description = description; + return this; + } + public VXGroup build() { return vxGroup; } From fcfbb810afc863bb1e6aec685761651d63197a87 Mon Sep 17 00:00:00 2001 From: yangyuxia <13853186257@139.com> Date: Fri, 27 Sep 2024 14:55:53 +0800 Subject: [PATCH 2/2] fix(authorization-ranger):Spotless apply, to fix CI failed --- .../authorization/ranger/RangerAuthorizationPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java index 593a46f2fb7..021fca2a996 100644 --- a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java +++ b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java @@ -383,7 +383,8 @@ public Boolean onUserAcquired(User user) throws RuntimeException { @Override public Boolean onGroupAdded(Group group) throws RuntimeException { - return rangerClient.createGroup(VXGroup.builder().withName(group.name()).withDescription(group.name()).build()); + return rangerClient.createGroup( + VXGroup.builder().withName(group.name()).withDescription(group.name()).build()); } @Override