vaijosh commented on code in PR #3273:
URL: https://github.com/apache/hugegraph/pull/3273#discussion_r4559831418


##########
hugegraph-server/hugegraph-ranger-plugin/src/main/java/org/apache/hugegraph/ranger/RangerAuthManager.java:
##########
@@ -0,0 +1,809 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hugegraph.ranger;
+
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import java.util.function.LongSupplier;
+
+import javax.security.sasl.AuthenticationException;
+
+import org.apache.hugegraph.auth.AuthManager;
+import org.apache.hugegraph.auth.HugeAccess;
+import org.apache.hugegraph.auth.HugeAuthenticator;
+import org.apache.hugegraph.auth.HugeBelong;
+import org.apache.hugegraph.auth.HugeDefaultRole;
+import org.apache.hugegraph.auth.HugeGroup;
+import org.apache.hugegraph.auth.HugePermission;
+import org.apache.hugegraph.auth.HugeProject;
+import org.apache.hugegraph.auth.HugeTarget;
+import org.apache.hugegraph.auth.HugeUser;
+import org.apache.hugegraph.auth.ResourceType;
+import org.apache.hugegraph.auth.RolePermission;
+import org.apache.hugegraph.auth.SchemaDefine.AuthElement;
+import org.apache.hugegraph.auth.UserWithRole;
+import org.apache.hugegraph.id.Id;
+import org.apache.hugegraph.util.JsonUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * AuthManager implementation that:
+ * <ul>
+ *   <li>Delegates all identity-management operations (users, groups, tokens) 
to
+ *       the underlying {@link AuthManager} (StandardAuthManager /
+ *       StandardAuthManagerV2).</li>
+ *   <li>Intercepts {@link #validateUser} / {@link #rolePermission} to merge
+ *       Ranger policy decisions into the returned {@link RolePermission}.</li>
+ * </ul>
+ *
+ * <h3>Ranger → RolePermission mapping</h3>
+ * <pre>
+ *   Ranger access type  │  HugePermission
+ *   ────────────────────┼────────────────
+ *   read                │  READ
+ *   write               │  WRITE
+ *   delete              │  DELETE
+ *   execute             │  EXECUTE
+ *   admin               │  ADMIN
+ * </pre>
+ */
+public class RangerAuthManager implements AuthManager {

Review Comment:
   Addressed in recent commit



##########
docker/hgRangerIntegration/docker-compose.yml:
##########
@@ -0,0 +1,101 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+services:
+
+  ranger-solr:
+    image: solr:8.11
+    container_name: ranger-solr
+    ports:
+      - "8983:8983"
+    environment:
+      SOLR_JAVA_MEM: "-Xms512m -Xmx512m"
+    volumes:
+      - ./solr-init.sh:/solr-init.sh:ro
+      - ./ranger-audits-conf:/ranger-audits-conf:ro
+    entrypoint: ["/solr-init.sh"]
+    healthcheck:
+      test: ["CMD-SHELL", "curl -s 
'http://localhost:8983/solr/admin/cores?action=STATUS&core=ranger_audits&wt=json'
 | grep -q '\"status\":0' || exit 1"]
+      interval: 10s
+      start_period: 60s
+      retries: 10
+
+  ranger-db:
+    image: postgres:14
+    container_name: ranger-db
+    environment:
+      POSTGRES_DB: ranger
+      POSTGRES_USER: postgres
+      POSTGRES_PASSWORD: rangeradmin
+      POSTGRES_HOST_AUTH_METHOD: trust
+    ports:
+      - "5432:5432"

Review Comment:
   Addressed in recent commit



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to