Copilot commented on code in PR #444: URL: https://github.com/apache/incubator-hugegraph-doc/pull/444#discussion_r2711365600
########## content/en/docs/clients/restful-api/graphs.md: ########## @@ -166,11 +166,21 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph2 ##### Request Body -Create a non-auth graph (set `Content-Type: application/json`) +Create a graph (set `Content-Type: application/json`) + +**`gremlin.graph` Configuration:** +- Auth mode: `"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"` (Recommended) +- Non-auth mode: `"gremlin.graph": "org.apache.hugegraph.HugeFactory"` + +**Note**!! +1. In version 1.7.0, dynamic graph creation would cause a NPE. This issue has been fixed in [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912). The current master version and versions after 1.7.0 do not have this problem. +2. For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in the request body. Also ensure HugeGraph-Server is properly configured with PD, see [HStore Configuration](/docs/quickstart/hugegraph/hugegraph-server/#511-distributed-storage-hstore). Review Comment: The note mentions "For version 1.7.0 and earlier" but point 1 states that the NPE issue exists in version 1.7.0 and that "versions after 1.7.0 do not have this problem." This creates confusion about whether versions before 1.7.0 also need the workaround. If only 1.7.0 has the issue, then this should say "For version 1.7.0" not "For version 1.7.0 and earlier". ########## content/cn/docs/quickstart/hugegraph/hugegraph-server.md: ########## @@ -200,10 +200,29 @@ task.scheduler_type=distributed pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 ``` +```properties +# 简单示例(带鉴权) +gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy + +# 指定存储 hstore(必须) +backend=hstore +serializer=binary +store=hugegraph + +# 指定任务调度器(1.7.0及之前必须) +task.scheduler_type=distributed + +# pd config +pd.peers=127.0.0.1:8686 +``` + 2. 修改 HugeGraph-Server 的 `rest-server.properties` 配置: ```properties usePD=true + +# 若需要 auth Review Comment: The comment says "若需要 auth" (if auth is needed) but should be more specific. The English version says "If auth is needed" which is also vague. Both should clarify when authentication is actually needed or recommended, matching the context from the examples which use auth mode by default. ```suggestion # 在生产环境或需要访问控制/多租户隔离时,建议启用鉴权功能,可取消注释并配置如下: ``` ########## content/cn/docs/clients/restful-api/graphs.md: ########## @@ -166,11 +166,21 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx ##### Request Body -创建一个非鉴权模式的图(设置 `Content-Type: application/json`) +创建一个图(设置 `Content-Type: application/json`) + +**`gremlin.graph` 配置说明:** +- 鉴权模式:`"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"`(推荐) +- 非鉴权模式:`"gremlin.graph": "org.apache.hugegraph.HugeFactory"` + +**注意**!! +1. 在 1.7.0 版本中,动态创建图会导致 NPE 错误。该问题已在 [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912) 中修复。当前 master 版本和 1.7.0 之前的版本不受此问题影响。 +2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。 Review Comment: The note mentions "1.7.0 及之前版本" (version 1.7.0 and earlier) but the first point says "在 1.7.0 版本中" (in version 1.7.0) the issue exists and "1.7.0 之前的版本不受此问题影响" (versions before 1.7.0 are not affected). This creates confusion about whether version 1.7.0 itself has the issue. If only 1.7.0 has the issue, then point 2 should say "1.7.0 版本" not "1.7.0 及之前版本". -- 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]
