Skip to content

Commit

Permalink
add enable_plugin config (#551)
Browse files Browse the repository at this point in the history
* add enable_plugin config

* add enable_plugin config

* fix enable_plugin ut

* fix enable_plugin ut

* fix enable_plugin ut

* fix state machine start

* fix state machine start

* update java client

* remove state machine start

* remove state machine start

* make enable plugin true in ut

* make enable plugin true in ut

* add hint

* add hint
  • Loading branch information
lipanpan03 authored Jun 12, 2024
1 parent 2c769ad commit bad38c3
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 39 deletions.
3 changes: 2 additions & 1 deletion include/lgraph/lgraph_exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ X(ReminderException, "Reminder exception.") \
X(GraphCreateException, "Graph create exception.") \
X(CypherParameterTypeError, "Cypher parameter type error.") \
X(ReachMaximumEid, "Edge eid exceeds the limit.") \
X(ReachMaximumCompositeIndexField, "The size of composite index fields exceeds the limit.")
X(ReachMaximumCompositeIndexField, "The size of composite index fields exceeds the limit.") \
X(PluginDisabled, "Plugin disabled!")

enum class ErrorCode {
#define X(code, msg) code,
Expand Down
4 changes: 4 additions & 0 deletions src/core/global_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ fma_common::Configuration lgraph::GlobalConfig::InitConfig
// bolt
bolt_port = 0;
bolt_io_thread_num = 1;
// default disable plugin load/delete
enable_plugin = false;

// parse options
fma_common::Configuration argparser;
Expand Down Expand Up @@ -325,5 +327,7 @@ fma_common::Configuration lgraph::GlobalConfig::InitConfig
.Comment("Bolt protocol port.");
argparser.Add(bolt_io_thread_num, "bolt_io_thread_num", true)
.Comment("Number of bolt io threads.");
argparser.Add(enable_plugin, "enable_plugin", true)
.Comment("Enable load/delete procedure.");
return argparser;
}
8 changes: 6 additions & 2 deletions src/core/global_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ struct BasicConfigs {
, max_backup_log_file_size((size_t)1 << 30)
, unlimited_token(false)
, reset_admin_password(false)
, enable_realtime_count(true) {}
, enable_realtime_count(true)
, enable_plugin(false) {}

BasicConfigs(const BasicConfigs &basicConfigs)
: db_dir(basicConfigs.db_dir)
Expand Down Expand Up @@ -76,7 +77,8 @@ struct BasicConfigs {
, max_backup_log_file_size(basicConfigs.max_backup_log_file_size)
, ft_index_options(basicConfigs.ft_index_options)
, unlimited_token(basicConfigs.unlimited_token)
, reset_admin_password(basicConfigs.reset_admin_password) {}
, reset_admin_password(basicConfigs.reset_admin_password)
, enable_plugin(basicConfigs.enable_plugin) {}

std::string db_dir; // db
int thread_limit; // number of threads, for both rpc and http
Expand Down Expand Up @@ -133,6 +135,8 @@ struct BasicConfigs {
// bolt
int bolt_port = 0;
int bolt_io_thread_num = 1;
// default disable plugin load/delete
bool enable_plugin = false;
};

template <typename T>
Expand Down
4 changes: 4 additions & 0 deletions src/db/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "db/db.h"
#include "lgraph/lgraph_txn.h"

bool lgraph::AccessControlledDB::enable_plugin = true;

lgraph::AccessControlledDB::AccessControlledDB(ScopedRef<LightningGraph>&& ref,
AccessLevel access_level,
const std::string& user)
Expand Down Expand Up @@ -64,13 +66,15 @@ bool lgraph::AccessControlledDB::LoadPlugin(plugin::Type plugin_type, const std:
plugin::CodeType code_type, const std::string& desc,
bool is_read_only, const std::string& version) {
CheckAdmin();
CheckLoadOrDeletePlugin();
return graph_->GetPluginManager()->LoadPluginFromCode(plugin_type, user, name, code, filename,
code_type, desc, is_read_only, version);
}

bool lgraph::AccessControlledDB::DelPlugin(plugin::Type plugin_type, const std::string& user,
const std::string& name) {
CheckAdmin();
CheckLoadOrDeletePlugin();
return graph_->GetPluginManager()->DelPlugin(plugin_type, user, name);
}

Expand Down
16 changes: 16 additions & 0 deletions src/db/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AccessControlledDB {
AutoReadLock graph_ref_lock_;
AccessLevel access_level_;
std::string user_;
static bool enable_plugin;

DISABLE_COPY(AccessControlledDB);

Expand Down Expand Up @@ -147,6 +148,14 @@ class AccessControlledDB {

inline LightningGraph* GetLightningGraph() const { return graph_; }

inline static void SetEnablePlugin(bool enable_plugin_) {
AccessControlledDB::enable_plugin = enable_plugin_;
}

inline static bool GetEnablePlugin() {
return enable_plugin;
}

private:
inline void CheckReadAccess() const {
if (access_level_ < AccessLevel::READ) THROW_CODE(Unauthorized, "No read permission.");
Expand All @@ -163,5 +172,12 @@ class AccessControlledDB {
inline void CheckAdmin() const {
if (user_ != _detail::DEFAULT_ADMIN_NAME) THROW_CODE(Unauthorized, "Not the admin user.");
}

inline void CheckLoadOrDeletePlugin() const {
if (!enable_plugin) THROW_CODE(PluginDisabled, "No permission to load or delete plugin, "
"please use correct config and restart server!\n"
"This function has security risks, please enable "
"it with caution!");
}
};
} // namespace lgraph
11 changes: 2 additions & 9 deletions src/server/lgraph_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ LGraphServer::LGraphServer(std::shared_ptr<lgraph::GlobalConfig> config)
LGraphServer::~LGraphServer() { Stop(false); }

int LGraphServer::Start() {
// assign AccessControllerDB enable_plugin
AccessControlledDB::SetEnablePlugin(config_->enable_plugin);
// adjust config
if (config_->enable_ha && config_->ha_log_dir.empty()) {
#if LGRAPH_SHARE_DIR
Expand Down Expand Up @@ -298,15 +300,6 @@ int LGraphServer::Start() {
return Stop();
}
LOG_INFO() << "Server started.";

#ifndef __SANITIZE_ADDRESS__
const std::string& hostname = fma_common::HardwareInfo::GetHostName();
const std::string server = "localhost:6091";
DBManagementClient::GetInstance().Init(hostname, config_->http_port, server);
heartbeat_detect = std::thread([]() {
DBManagementClient::GetInstance().DetectHeartbeat();
});
#endif
} catch (std::exception &e) {
_kill_signal_.Notify();
LOG_WARN() << "Server hit an exception and shuts down abnormally: " << e.what();
Expand Down
18 changes: 12 additions & 6 deletions test/integration/ha_client_python_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,38 +83,44 @@ def start_ha_server(host, db):
f"&& cd ha1 && ./lgraph_server --host {host} --port 27072 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29092 --directory {db} --log_dir "
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 -c lgraph_ha.json -d start")
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 --enable_plugin 1"
f" -c lgraph_ha.json -d start")
time.sleep(3)
os.system(f"mkdir ha2 && cp -r ../../src/server/lgraph_ha.json "
f"./lgraph_server ./resource ha2 "
f"&& cd ha2 && ./lgraph_server --host {host} --port 27073 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29093 --directory {db} --log_dir "
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 -c lgraph_ha.json -d start")
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 --enable_plugin 1"
f" -c lgraph_ha.json -d start")
time.sleep(3)
os.system(f"mkdir ha3 && cp -r ../../src/server/lgraph_ha.json "
f"./lgraph_server ./resource ha3 "
f"&& cd ha3 && ./lgraph_server --host {host} --port 27074 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29094 --directory {db} --log_dir "
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 -c lgraph_ha.json -d start")
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 --enable_plugin 1"
f" -c lgraph_ha.json -d start")
time.sleep(10)

def restart_ha_server(host, db):
os.system(f"cd ha1 && ./lgraph_server --host {host} --port 27072 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29092 --directory {db} --log_dir "
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 -c lgraph_ha.json -d start")
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 --enable_plugin 1"
f" -c lgraph_ha.json -d start")
time.sleep(3)
os.system(f"cd ha2 && ./lgraph_server --host {host} --port 27073 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29093 --directory {db} --log_dir "
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 -c lgraph_ha.json -d start")
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 --enable_plugin 1"
f" -c lgraph_ha.json -d start")
time.sleep(3)
os.system(f"cd ha3 && ./lgraph_server --host {host} --port 27074 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29094 --directory {db} --log_dir "
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 -c lgraph_ha.json -d start")
f"./log --ha_conf {host}:29092,{host}:29093,{host}:29094 --enable_plugin 1"
f" -c lgraph_ha.json -d start")
time.sleep(10)

def start_ha_client(host, port, user=DEFAULT_ADMIN_NAME, pwd=DEFAULT_ADMIN_PASS, urls=None):
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_algo_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

log = logging.getLogger(__name__)

SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092",
SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092 --enable_plugin 1",
"cleanup_dir":["./testdb"]}

CLIENTOPT = {"host":"127.0.0.1:9092", "user":"admin", "password":"73@TuGraph"}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

log = logging.getLogger(__name__)

SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --port 7072 --rpc_port 9092 --enable_backup_log true --host 0.0.0.0 --verbose 1 --directory ./testdb",
SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --port 7072 --rpc_port 9092 --enable_plugin 1 --enable_backup_log true --host 0.0.0.0 --verbose 1 --directory ./testdb",
"cleanup_dir":["./testdb"]}

SERVEROPT_1 = {"cmd":"./lgraph_server -c lgraph_standalone.json --port 7073 --rpc_port 9093 --enable_backup_log true --host 0.0.0.0 --verbose 1 --directory ./testdb1",
SERVEROPT_1 = {"cmd":"./lgraph_server -c lgraph_standalone.json --port 7073 --rpc_port 9093 --enable_plugin 1 --enable_backup_log true --host 0.0.0.0 --verbose 1 --directory ./testdb1",
"cleanup_dir":["./testdb1"]}

CLIENTOPT = {"host":"127.0.0.1:9092", "user":"admin", "password":"73@TuGraph"}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_cpp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestCppClient:
"cmd" : "./clienttest"
}

SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092",
SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092 --enable_plugin 1",
"cleanup_dir":["./testdb"]}

@pytest.mark.parametrize("build_so", [BUILDOPT], indirect=True)
Expand Down
10 changes: 6 additions & 4 deletions test/integration/test_ha_python_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ def test_follower_restart(self):
self.client.logout()
os.system(f"cd ha2 && ./lgraph_server --host {self.host} --port 27073 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29093 --directory ./db --log_dir "
f"./log --ha_conf {self.host}:29092,{self.host}:29093,{self.host}:29094 -c lgraph_ha.json -d start")
f"--rpc_port 29093 --enable_plugin 1 --directory ./db --log_dir "
f"./log --enable_plugin 1 --ha_conf {self.host}:29092,{self.host}:29093,"
f"{self.host}:29094 -c lgraph_ha.json -d start")
time.sleep(13)
self.client = start_ha_client(self.host, "29092")
time.sleep(7)
Expand All @@ -273,8 +274,9 @@ def test_leader_restart(self):
self.client.logout()
os.system(f"cd ha1 && ./lgraph_server --host {self.host} --port 27072 --enable_rpc "
f"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
f"--rpc_port 29092 --directory ./db --log_dir "
f"./log --ha_conf {self.host}:29092,{self.host}:29093,{self.host}:29094 -c lgraph_ha.json -d start")
f"--rpc_port 29092 --enable_plugin 1 --directory ./db --log_dir "
f"./log --enable_plugin 1 --ha_conf {self.host}:29092,{self.host}:29093,"
f"{self.host}:29094 -c lgraph_ha.json -d start")
time.sleep(13)
self.client = start_ha_client(self.host, "29093")
time.sleep(7)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_java_client_and_ogm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cmd" : "echo run TestJavaClientAndOGM"
}

SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092",
SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092 --enable_plugin 1",
"cleanup_dir":["./testdb"]}

class TestJavaClientAndOGM:
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test_procedure.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

log = logging.getLogger(__name__)

SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092",
SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092 --enable_plugin 1",
"cleanup_dir":["./testdb"]}

SERVEROPT_1 = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092",
SERVEROPT_1 = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7072 --rpc_port 9092 --enable_plugin 1",
"cleanup_dir":[]}

CLIENTOPT = {"host":"127.0.0.1:9092", "user":"admin", "password":"73@TuGraph"}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

log = logging.getLogger(__name__)

SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7073 --rpc_port 9093",
SERVEROPT = {"cmd":"./lgraph_server -c lgraph_standalone.json --directory ./testdb --port 7073 --rpc_port 9093 --enable_plugin 1",
"cleanup_dir":["./testdb"]}

RESTTOPT = {"port":"7073", "user":"admin", "password":"73@TuGraph"}
Expand Down
10 changes: 6 additions & 4 deletions test/test_ha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TestHA : public TuGraphTest {
"true --enable_ha true --ha_node_offline_ms 5000 "
"--ha_node_remove_ms 10000 --ha_snapshot_interval_s -1 "
"--rpc_port {} --directory ./db --log_dir "
"./log --ha_conf {} --verbose 1 -c lgraph_ha.json -d start";
"./log --ha_conf {} --enable_plugin 1 --verbose 1 -c lgraph_ha.json -d start";
#else
std::string cmd_f =
"mkdir {} && cp -r ../../src/server/lgraph_ha.json "
Expand All @@ -40,7 +40,8 @@ class TestHA : public TuGraphTest {
"true --enable_ha true --ha_node_offline_ms 5000 "
"--ha_node_remove_ms 10000 --ha_snapshot_interval_s -1 "
"--rpc_port {} --directory ./db --log_dir "
"./log --ha_conf {} --use_pthread 1 --verbose 1 -c lgraph_ha.json -d start";
"./log --ha_conf {} --enable_plugin 1 --use_pthread 1 --verbose 1 -c "
"lgraph_ha.json -d start";
#endif

int rt;
Expand Down Expand Up @@ -194,13 +195,14 @@ TEST_F(TestHA, HAConsistency) {
"cd {} && ./lgraph_server --host {} --port {} --enable_rpc "
"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
"--ha_snapshot_interval_s -1 --rpc_port {} --directory ./db --log_dir "
"./log --ha_conf {} -c lgraph_ha.json -d start";
"./log --ha_conf {} --enable_plugin 1 -c lgraph_ha.json -d start";
#else
cmd_f =
"cd {} && ./lgraph_server --host {} --port {} --enable_rpc "
"true --enable_ha true --ha_node_offline_ms 5000 --ha_node_remove_ms 10000 "
"--ha_snapshot_interval_s -1 --rpc_port {} --directory ./db --log_dir "
"./log --ha_conf {} --use_pthread 1 --verbose 1 -c lgraph_ha.json -d start";
"./log --ha_conf {} --enable_plugin 1 --use_pthread 1 --verbose 1 -c "
"lgraph_ha.json -d start";
#endif
cmd = FMA_FMT(cmd_f.c_str(), "ha3", host, "27074", "29094",
host + ":29092," + host + ":29093," + host + ":29094");
Expand Down
1 change: 1 addition & 0 deletions test/test_ha_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class TestHABase : public TuGraphTest {
config->rpc_port = rpc_port;
config->enable_ha = true;
config->verbose = 1;
config->enable_plugin = true;
t.reset(new HaUnitTest(config, n_clients));

fma_common::file_system::RemoveDir(t->config_->db_dir);
Expand Down
8 changes: 4 additions & 4 deletions test/test_ha_witness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ const char ha_mkdir[] = "mkdir {} && cp -r ../../src/server/lgraph_ha.json "
const char server_cmd_f[] =
"cd {} && ./lgraph_server --host {} --port {} --enable_rpc "
"true --enable_ha true --ha_snapshot_interval_s -1 --ha_node_join_group_s 60 "
"--rpc_port {} --directory ./db --log_dir "
"--rpc_port {} --enable_plugin 1 --directory ./db --log_dir "
"./log --ha_conf {} --verbose 1 -c lgraph_ha.json -d start";
const char witness_cmd_f[] =
"cd {} && ./lgraph_server --host {} --port {} --enable_rpc "
"true --enable_ha true --ha_is_witness 1 "
"--ha_snapshot_interval_s -1 --ha_node_join_group_s 60 "
"--rpc_port {} --directory ./db --log_dir "
"--rpc_port {} --enable_plugin 1 --directory ./db --log_dir "
"./log --ha_conf {} --verbose 1 "
"-c lgraph_ha.json --ha_enable_witness_to_leader {} -d start";
#else
const char server_cmd_f[] =
"cd {} && ./lgraph_server --host {} --port {} --enable_rpc "
"true --enable_ha true --ha_snapshot_interval_s -1 "
"--ha_node_join_group_s 60 --rpc_port {} --directory ./db --log_dir "
"./log --ha_conf {} --use_pthread 1 --verbose 1 -c lgraph_ha.json -d start";
"./log --enable_plugin 1 --ha_conf {} --use_pthread 1 --verbose 1 -c lgraph_ha.json -d start";
const char witness_cmd_f[] =
"cd {} && ./lgraph_server --host {} --port {} --enable_rpc "
"true --enable_ha true --ha_is_witness 1 --ha_snapshot_interval_s -1 "
"true --enable_ha true --enable_plugin 1 --ha_is_witness 1 --ha_snapshot_interval_s -1 "
"--ha_node_join_group_s 60 --rpc_port {} --directory ./db --log_dir "
"./log --ha_conf {} --use_pthread 1 --verbose 1 -c lgraph_ha.json "
"--ha_enable_witness_to_leader {} -d start";
Expand Down
1 change: 1 addition & 0 deletions test/test_lgraph_backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ TEST_F(TestLGraphBackupTool, LGraphBackupTool) {
config_->http_port = 17173;
config_->rpc_port = 19193;
config_->verbose = 2;
config_->enable_plugin = true;
std::string username = "admin";
std::string password = "73@TuGraph";
std::string plugin_name = "scan_graph";
Expand Down
1 change: 1 addition & 0 deletions test/test_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,5 +375,6 @@ TEST_F(TestQuery, TestCypherFinbench) {
set_graph_type(GraphFactory::GRAPH_DATASET_TYPE::MINI_FINBENCH);
set_query_type(lgraph::ut::QUERY_TYPE::CYPHER);
std::string dir = test_suite_dir_ + "/finbench/cypher";
lgraph::AccessControlledDB::SetEnablePlugin(true);
test_files(dir);
}
1 change: 1 addition & 0 deletions test/test_rest_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ TEST_P(TestRestClient, RestClient) {
gconfig->db_dir = db_dir;
gconfig->server_key_file = key_path;
gconfig->server_cert_file = cert_path;
gconfig->enable_plugin = true;

auto StartEmptyServer = [&]() {
std::unique_ptr<LGraphServer> server(new LGraphServer(gconfig));
Expand Down
1 change: 1 addition & 0 deletions test/test_restful_base_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ TEST_P(TestRestfulBaseOperation, RestfulBaseOperation) {
gconfig->db_dir = db_dir;
gconfig->server_key_file = key_path;
gconfig->server_cert_file = cert_path;
gconfig->enable_plugin = true;
LGraphServer server(gconfig);
server.Start();
#endif
Expand Down
1 change: 1 addition & 0 deletions test/test_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void on_initialize_rpc_server() {
sm_config.rpc_port = 19099;

gconfig->ft_index_options.enable_fulltext_index = true;
lgraph::AccessControlledDB::SetEnablePlugin(true);
ptr_state_machine = new lgraph::StateMachine(sm_config, gconfig);
ptr_rpc_service = new RPCService(ptr_state_machine);

Expand Down

0 comments on commit bad38c3

Please sign in to comment.