imbajin commented on code in PR #3334:
URL: https://github.com/apache/hugegraph/pull/3334#discussion_r4265742376


##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/core/GraphManager.java:
##########
@@ -1877,13 +1878,15 @@ private void checkBackendVersionOrExit(HugeConfig 
config) {
             if (!hugegraph.backendStoreFeatures().supportsPersistence()) {
                 hugegraph.initBackend();
                 if (this.requireAuthentication()) {
-                    String adminPassword = config.get(ServerOptions.ADMIN_PA);
+                    // Outside the try so a bad password file names itself
+                    String adminPassword =
+                            StandardAuthenticator.initialAdminPassword(config);

Review Comment:
   ⚠️ Important. Blocking: no. Summary: This reads `auth.admin_pa_file` 
whenever a non-persistent backend requires authentication, including when 
`auth.remote_url` switches `StandardAuthenticator` to a remote `AuthManager`. 
`requireInitAdminUser()` then returns false, so no local admin is created, but 
this file read happens before `initAdminUser()` can no-op; a missing or 
unreadable, otherwise unused path therefore aborts server startup. Evidence: 
`StandardAuthenticator.setup()` switches to the remote manager and 
`requireInitAdminUser()` checks `StandardAuthManager.isLocal()`; 
`GraphManager.loadMetaFromPD()` already guards password resolution with 
`shouldBootstrapAdmin()`. Please skip this lookup for remote-auth 
configurations (using the same local-bootstrap condition) and add a regression 
case with remote auth and a missing file.



-- 
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