fix(server): reinitialize the progress to set up graph auth friendly by Z-HUANT · Pull Request #2411 · apache/hugegraph

Purpose of the PR

修复需要重新初始化数据库才能设置 auth 的问题
fixed #125 (comment)

Main Changes

Switch to auth-mode without removing graph data (不需要重新初始化数据库就可以设置 auth)

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:

自己测试流程如下

  1. 使用非 auth init-store 初始化图,此时无 admin 账号
  2. 使用非 auth 启动 HugeGraph,正常添加和查询数据(模拟用户操作)
  3. 使用 auth init-store 初始化图,创建 admin 账号,模拟用户运行一段时间后,数据库内有数据了后,想增加 auth
  4. 使用 auth 启动 HugeGraph,可以正常启动,权限校验正常,此时访问接口都需要账号密码
  5. 使用非 auth 启动 HugeGraph,模拟用户不想要 auth 了,此时可以正常启动,访问接口不需要账号密码

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

影响 init-store

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

Doc:apache/hugegraph-doc#320