Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docker/configs/server1-conf/rest-server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ arthas.ip=127.0.0.1
arthas.disabled_commands=jad

# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or
# 'org.apache.hugegraph.auth.ConfigAuthenticator'
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa

# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
Expand Down
5 changes: 3 additions & 2 deletions docker/configs/server2-conf/rest-server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ arthas.ip=127.0.0.1
arthas.disabled_commands=jad

# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or
# 'org.apache.hugegraph.auth.ConfigAuthenticator'
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa

# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
Expand Down
5 changes: 3 additions & 2 deletions docker/configs/server3-conf/rest-server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ arthas.ip=127.0.0.1
arthas.disabled_commands=jad

# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or
# 'org.apache.hugegraph.auth.ConfigAuthenticator'
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa

# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,16 @@ arthas.ip=127.0.0.1
arthas.disabled_commands=jad

# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or
# 'org.apache.hugegraph.auth.ConfigAuthenticator'
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa

# for StandardAuthenticator mode
#auth.graph_store=hugegraph
# auth client config
#auth.remote_url=127.0.0.1:8899,127.0.0.1:8898,127.0.0.1:8897

# for ConfigAuthenticator mode
#auth.admin_token=
#auth.user_tokens=[]

# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
rpc.server_port=$RPC_PORT$
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ private static void registerPrivateActions() {
Reflection.registerFieldsToFilter(StandardAuthenticator.class, "graph");
Reflection.registerMethodsToFilter(StandardAuthenticator.class, "initAdminUser",
"inputPassword", "graph");
Reflection.registerFieldsToFilter(ConfigAuthenticator.class, "tokens");
Reflection.registerFieldsToFilter(HugeFactoryAuthProxy.class, "PROTECT_METHODS");
Reflection.registerMethodsToFilter(HugeFactoryAuthProxy.class, "genRegisterPrivateActions",
"registerClass", "registerPrivateActions",
Expand Down Expand Up @@ -508,7 +507,6 @@ private static void genRegisterPrivateActions() {
registerPrivateActions(InheritableThreadLocal.class);

registerPrivateActions(StandardAuthenticator.class);
registerPrivateActions(ConfigAuthenticator.class);
registerPrivateActions(HugeFactoryAuthProxy.class);
registerPrivateActions(HugeAuthenticator.User.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,40 +462,20 @@ public class ServerOptions extends OptionHolder {
new ConfigOption<>(
"auth.authenticator",
"The class path of authenticator implementation. " +
"e.g., org.apache.hugegraph.auth.StandardAuthenticator, " +
"or org.apache.hugegraph.auth.ConfigAuthenticator.",
"e.g., org.apache.hugegraph.auth.StandardAuthenticator.",
null,
""
);

public static final ConfigOption<String> ADMIN_PA =
new ConfigOption<>(
"auth.admin_pa",
"The class path of authenticator implementation. " +
"e.g., org.apache.hugegraph.auth.StandardAuthenticator, " +
"or org.apache.hugegraph.auth.ConfigAuthenticator.",
"The default password for built-in admin account, " +
"takes effect on first startup.",
null,
"pa"
);

public static final ConfigOption<String> AUTH_ADMIN_TOKEN =
new ConfigOption<>(
"auth.admin_token",
"Token for administrator operations, " +
"only for org.apache.hugegraph.auth.ConfigAuthenticator.",
disallowEmpty(),
"162f7848-0b6d-4faf-b557-3a0797869c55"
);

public static final ConfigListOption<String> AUTH_USER_TOKENS =
new ConfigListOption<>(
"auth.user_tokens",
"The map of user tokens with name and password, " +
"only for org.apache.hugegraph.auth.ConfigAuthenticator.",
disallowEmpty(),
"hugegraph:9fd95c9c-711b-415b-b85f-d4df46ba5c31"
);

public static final ConfigOption<String> SSL_KEYSTORE_FILE =
new ConfigOption<>(
"ssl.keystore_file",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1611,9 +1611,9 @@ private void checkBackendVersionOrExit(HugeConfig config) {
if (!hugegraph.backendStoreFeatures().supportsPersistence()) {
hugegraph.initBackend();
if (this.requireAuthentication()) {
String token = config.get(ServerOptions.AUTH_ADMIN_TOKEN);
String adminPassword = config.get(ServerOptions.ADMIN_PA);
try {
this.authenticator().initAdminUser(token);
this.authenticator().initAdminUser(adminPassword);
} catch (Exception e) {
throw new BackendException(
"The backend store of '%s' can't " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public static synchronized AuthOptions instance() {
new ConfigOption<>(
"auth.authenticator",
"The class path of authenticator implementation. " +
"e.g., org.apache.hugegraph.auth.StandardAuthenticator, " +
"or org.apache.hugegraph.auth.ConfigAuthenticator.",
"e.g., org.apache.hugegraph.auth.StandardAuthenticator.",
null,
""
);
Expand All @@ -59,24 +58,6 @@ public static synchronized AuthOptions instance() {
"hugegraph"
);

public static final ConfigOption<String> AUTH_ADMIN_TOKEN =
new ConfigOption<>(
"auth.admin_token",
"Token for administrator operations, " +
"only for org.apache.hugegraph.auth.ConfigAuthenticator.",
disallowEmpty(),
"162f7848-0b6d-4faf-b557-3a0797869c55"
);

public static final ConfigListOption<String> AUTH_USER_TOKENS =
new ConfigListOption<>(
"auth.user_tokens",
"The map of user tokens with name and password, " +
"only for org.apache.hugegraph.auth.ConfigAuthenticator.",
disallowEmpty(),
"hugegraph:9fd95c9c-711b-415b-b85f-d4df46ba5c31"
);

public static final ConfigOption<String> AUTH_REMOTE_URL =
new ConfigOption<>(
"auth.remote_url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.apache.hugegraph.options;

import org.apache.hugegraph.config.ConfigListOption;
import org.apache.hugegraph.config.ConfigOption;
import org.apache.hugegraph.config.OptionHolder;

Expand Down Expand Up @@ -82,8 +81,7 @@ public static synchronized AuthOptions instance() {
new ConfigOption<>(
"auth.authenticator",
"The class path of authenticator implementation. " +
"e.g., org.apache.hugegraph.auth.StandardAuthenticator, " +
"or org.apache.hugegraph.auth.ConfigAuthenticator.",
"e.g., org.apache.hugegraph.auth.StandardAuthenticator.",
null,
""
);
Expand All @@ -97,24 +95,6 @@ public static synchronized AuthOptions instance() {
"hugegraph"
);

public static final ConfigOption<String> AUTH_ADMIN_TOKEN =
new ConfigOption<>(
"auth.admin_token",
"Token for administrator operations, " +
"only for org.apache.hugegraph.auth.ConfigAuthenticator.",
disallowEmpty(),
"162f7848-0b6d-4faf-b557-3a0797869c55"
);

public static final ConfigListOption<String> AUTH_USER_TOKENS =
new ConfigListOption<>(
"auth.user_tokens",
"The map of user tokens with name and password, " +
"only for org.apache.hugegraph.auth.ConfigAuthenticator.",
disallowEmpty(),
"hugegraph:9fd95c9c-711b-415b-b85f-d4df46ba5c31"
);

public static final ConfigOption<String> AUTH_REMOTE_URL =
new ConfigOption<>(
"auth.remote_url",
Expand Down
Loading