From 2e938c767cce4507ee0ea767e8dd2bf7bd1711ca Mon Sep 17 00:00:00 2001 From: Yichen Wang <18348405+Aiee@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:37:32 +0800 Subject: [PATCH] Cherry pick v3.0.1 (#4027) * unify leader change and machine not found (#4022) Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> * delete src/common/encryption src/common/base/stringunorderedmap (#3867) * delete src/common/encryption * encryption format code * Update error message when connect with an out-of-date client (#4021) * Update error message * Do clientAddr check before FLAGS_enable_authorize check * Fix typo Co-authored-by: yaphet <4414314+darionyaphet@users.noreply.github.com> Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> Co-authored-by: yuehua.jia <3423893+jiayuehua@users.noreply.github.com> --- src/clients/meta/MetaClient.cpp | 5 +- src/common/CMakeLists.txt | 1 - src/common/base/StringUnorderedMap.h | 133 ------------------ src/common/encryption/Base64.cpp | 17 --- src/common/encryption/Base64.h | 23 --- src/common/encryption/CMakeLists.txt | 9 -- src/common/encryption/MD5Utils.cpp | 16 --- src/common/encryption/MD5Utils.h | 20 --- src/common/expression/test/CMakeLists.txt | 1 - src/common/plugin/fulltext/FTUtils.h | 12 +- .../plugin/fulltext/test/CMakeLists.txt | 1 - .../fulltext/test/FulltextPluginTest.cpp | 1 - src/common/utils/test/CMakeLists.txt | 1 - src/daemons/CMakeLists.txt | 1 - src/graph/context/test/CMakeLists.txt | 1 - .../executor/admin/ChangePasswordExecutor.cpp | 7 +- .../executor/admin/CreateUserExecutor.cpp | 5 +- .../executor/admin/UpdateUserExecutor.cpp | 6 +- src/graph/executor/test/CMakeLists.txt | 1 - src/graph/optimizer/test/CMakeLists.txt | 1 - src/graph/service/CloudAuthenticator.cpp | 5 +- src/graph/service/GraphService.cpp | 44 +++--- src/graph/util/test/CMakeLists.txt | 1 - src/graph/validator/test/CMakeLists.txt | 1 - src/graph/visitor/test/CMakeLists.txt | 1 - src/kvstore/test/CMakeLists.txt | 1 - src/meta/CMakeLists.txt | 1 - src/meta/RootUserMan.h | 5 +- src/parser/test/CMakeLists.txt | 1 - src/storage/test/CMakeLists.txt | 1 - src/tools/db-dump/CMakeLists.txt | 1 - src/tools/db-upgrade/CMakeLists.txt | 1 - src/tools/meta-dump/CMakeLists.txt | 1 - src/tools/simple-kv-verify/CMakeLists.txt | 1 - src/tools/storage-perf/CMakeLists.txt | 1 - 35 files changed, 48 insertions(+), 280 deletions(-) delete mode 100644 src/common/base/StringUnorderedMap.h delete mode 100644 src/common/encryption/Base64.cpp delete mode 100644 src/common/encryption/Base64.h delete mode 100644 src/common/encryption/CMakeLists.txt delete mode 100644 src/common/encryption/MD5Utils.cpp delete mode 100644 src/common/encryption/MD5Utils.h diff --git a/src/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp index 4a57894c53a..c8de564aef8 100644 --- a/src/clients/meta/MetaClient.cpp +++ b/src/clients/meta/MetaClient.cpp @@ -746,7 +746,8 @@ void MetaClient::getResponse(Request req, // succeeded pro.setValue(respGen(std::move(resp))); return; - } else if (code == nebula::cpp2::ErrorCode::E_LEADER_CHANGED) { + } else if (code == nebula::cpp2::ErrorCode::E_LEADER_CHANGED || + code == nebula::cpp2::ErrorCode::E_MACHINE_NOT_FOUND) { updateLeader(resp.get_leader()); if (retry < retryLimit) { evb->runAfterDelay( @@ -772,8 +773,6 @@ void MetaClient::getResponse(Request req, } else if (code == nebula::cpp2::ErrorCode::E_CLIENT_SERVER_INCOMPATIBLE) { pro.setValue(respGen(std::move(resp))); return; - } else if (resp.get_code() == nebula::cpp2::ErrorCode::E_MACHINE_NOT_FOUND) { - updateLeader(); } pro.setValue(this->handleResponse(resp)); }); // then diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b0abdc68f49..9964f3365fc 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -15,7 +15,6 @@ nebula_add_subdirectory(http) nebula_add_subdirectory(stats) nebula_add_subdirectory(charset) nebula_add_subdirectory(algorithm) -nebula_add_subdirectory(encryption) nebula_add_subdirectory(datatypes) nebula_add_subdirectory(conf) nebula_add_subdirectory(meta) diff --git a/src/common/base/StringUnorderedMap.h b/src/common/base/StringUnorderedMap.h deleted file mode 100644 index 081e4d68786..00000000000 --- a/src/common/base/StringUnorderedMap.h +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (c) 2018 vesoft inc. All rights reserved. - * - * This source code is licensed under Apache 2.0 License. - */ - -#ifndef COMMON_BASE_STRINGUNORDEREDMAP_H_ -#define COMMON_BASE_STRINGUNORDEREDMAP_H_ - -#include -#include - -namespace nebula { - -template -class StringUnorderedMap { - public: - using key_type = std::string; - using mapped_type = T; - using value_type = std::pair; - using size_type = size_t; - using hasher = folly::SpookyHashV2; - using reference = value_type&; - using const_reference = const value_type&; - // using iterator = - // using const_iterator = - - /****************************************** - * - * Constructors and destructor - * - *****************************************/ - StringUnorderedMap() = default; - StringUnorderedMap(const StringUnorderedMap& other); - StringUnorderedMap(StringUnorderedMap&& other); - StringUnorderedMap(std::initializer_list init); - - template - StringUnorderedMap(InputIt first, InputIt last); - - ~StringUnorderedMap() = default; - - /****************************************** - * - * Assignments - * - *****************************************/ - StringUnorderedMap& operator=(const StringUnorderedMap& other); - StringUnorderedMap& operator=(StringUnorderedMap&& other); - StringUnorderedMap& operator=(StringUnorderedMap&& other) noexcept; - StringUnorderedMap& operator=(std::initializer_list ilist); - - /****************************************** - * - * Iterators - * - *****************************************/ - iterator begin() noexcept; - const_iterator begin() const noexcept; - const_iterator cbegin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - const_iterator cend() const noexcept; - - /****************************************** - * - * Capacity - * - *****************************************/ - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - /****************************************** - * - * Modifier - * - *****************************************/ - void clear() noexcept; - - std::pair insert(const value_type& value); - std::pair insert(value_type&& value); - template - std::pair insert(V&& value); - template - void insert(InputIt first, InputIt last); - void insert(std::initializer_list ilist); - - template - std::pair insert_or_assign(const key_type& key, V&& v); - template - std::pair insert_or_assign(key_type&& key, V&& v); - - template - std::pair emplace(Args&&... args); - - iterator erase(const_iterator pos); - iterator erase(const_iterator first, const_iterator last); - size_type erase(const key_type& key); - - void swap(StringUnorderedMap& other); - void swap(StringUnorderedMap& other) noexcept; - - /****************************************** - * - * Lookup - * - *****************************************/ - T& at(const key_type& key); - const T& at(const key_type& key) const; - - T& operator[](const key_type& key); - T& operator[](key_type&& key); - - size_type count(const key_type& key) const; - - iterator find(const key_type& key); - const_iterator find(const key_type& key) const; - - std::pair equal_range(const key_type& key); - std::pair equal_range(const key_type& key) const; - - private: - std::unordered_map valueMap_; - std::unordered_map keyMap_; -}; - -template -bool operator==(const StringUnorderedMap& lhs, const StringUnorderedMap& rhs); -template -bool operator!=(const StringUnorderedMap& lhs, const StringUnorderedMap& rhs); - -} // namespace nebula -#endif // COMMON_BASE_STRINGUNORDEREDMAP_H_ diff --git a/src/common/encryption/Base64.cpp b/src/common/encryption/Base64.cpp deleted file mode 100644 index af1557d11e0..00000000000 --- a/src/common/encryption/Base64.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. - * - * This source code is licensed under Apache 2.0 License. - */ - -#include "common/encryption/Base64.h" - -namespace nebula { -namespace encryption { - -std::string Base64::encode(const std::string &toEncodeStr) { - return proxygen::base64Encode(folly::ByteRange( - reinterpret_cast(toEncodeStr.c_str()), toEncodeStr.length())); -} - -} // namespace encryption -} // namespace nebula diff --git a/src/common/encryption/Base64.h b/src/common/encryption/Base64.h deleted file mode 100644 index c269ef62cc5..00000000000 --- a/src/common/encryption/Base64.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. - * - * This source code is licensed under Apache 2.0 License. - */ - -#ifndef COMMON_ENCRYPTION_BASE64_H_ -#define COMMON_ENCRYPTION_BASE64_H_ - -#include - -namespace nebula { -namespace encryption { - -class Base64 final { - public: - Base64() = delete; - - static std::string encode(const std::string &toEncodeStr); -}; - -} // namespace encryption -} // namespace nebula -#endif // COMMON_ENCRYPTION_BASE64_H_ diff --git a/src/common/encryption/CMakeLists.txt b/src/common/encryption/CMakeLists.txt deleted file mode 100644 index 2ee30149c8c..00000000000 --- a/src/common/encryption/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2020 vesoft inc. All rights reserved. -# -# This source code is licensed under Apache 2.0 License. - -nebula_add_library( - encryption_obj OBJECT - MD5Utils.cpp - Base64.cpp -) diff --git a/src/common/encryption/MD5Utils.cpp b/src/common/encryption/MD5Utils.cpp deleted file mode 100644 index 31c6698c10e..00000000000 --- a/src/common/encryption/MD5Utils.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. - * - * This source code is licensed under Apache 2.0 License. - */ - -#include "common/encryption/MD5Utils.h" - -namespace nebula { -namespace encryption { -// static -std::string MD5Utils::md5Encode(const std::string &str) { - return proxygen::md5Encode( - folly::ByteRange(reinterpret_cast(str.c_str()), str.length())); -} -} // namespace encryption -} // namespace nebula diff --git a/src/common/encryption/MD5Utils.h b/src/common/encryption/MD5Utils.h deleted file mode 100644 index 0ea64dc6ae4..00000000000 --- a/src/common/encryption/MD5Utils.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. - * - * This source code is licensed under Apache 2.0 License. - */ - -#ifndef COMMON_ENCRYPTION_MD5UTILS_H_ -#define COMMON_ENCRYPTION_MD5UTILS_H_ - -#include - -namespace nebula { -namespace encryption { -class MD5Utils final { - public: - MD5Utils() = delete; - static std::string md5Encode(const std::string &str); -}; -} // namespace encryption -} // namespace nebula -#endif // COMMON_ENCRYPTION_MD5UTILS_H_ diff --git a/src/common/expression/test/CMakeLists.txt b/src/common/expression/test/CMakeLists.txt index 6c00bd7031f..bab22cb5bc7 100644 --- a/src/common/expression/test/CMakeLists.txt +++ b/src/common/expression/test/CMakeLists.txt @@ -5,7 +5,6 @@ set(expression_test_common_libs $ $ - $ $ $ $ diff --git a/src/common/plugin/fulltext/FTUtils.h b/src/common/plugin/fulltext/FTUtils.h index 3e2382641c8..78475a727c4 100644 --- a/src/common/plugin/fulltext/FTUtils.h +++ b/src/common/plugin/fulltext/FTUtils.h @@ -6,14 +6,14 @@ #ifndef COMMON_PLUGIN_FULLTEXT_UTILS_H_ #define COMMON_PLUGIN_FULLTEXT_UTILS_H_ +#include + #include #include #include "common/base/Base.h" #include "common/base/CommonMacro.h" #include "common/datatypes/HostAddr.h" -#include "common/encryption/Base64.h" -#include "common/encryption/MD5Utils.h" #define CURL "/usr/bin/curl" #define XPUT " -XPUT" @@ -141,7 +141,7 @@ struct DocIDTraits { static std::string column(const std::string& col) { // normalized column name is 32 bytes - return encryption::MD5Utils::md5Encode(col); + return proxygen::md5Encode(folly::StringPiece(col)); } static std::string val(const std::string& v) { @@ -158,9 +158,9 @@ struct DocIDTraits { // docId structure : partId(10bytes) + schemaId(10Bytes) + // columnName(32bytes) + encoded_val(max 344bytes) // the max length of docId is 512 bytes, still have about 100 bytes reserved - auto encoded = encryption::Base64::encode((item.val.size() > MAX_INDEX_TYPE_LENGTH) - ? item.val.substr(0, MAX_INDEX_TYPE_LENGTH) - : item.val); + auto encoded = proxygen::base64Encode(folly::StringPiece( + (item.val.size() > MAX_INDEX_TYPE_LENGTH) ? item.val.substr(0, MAX_INDEX_TYPE_LENGTH) + : item.val)); std::replace(encoded.begin(), encoded.end(), '/', '_'); std::stringstream ss; ss << id(item.part) << column(item.column) << encoded; diff --git a/src/common/plugin/fulltext/test/CMakeLists.txt b/src/common/plugin/fulltext/test/CMakeLists.txt index 235e220f7e4..1446e8a34b3 100644 --- a/src/common/plugin/fulltext/test/CMakeLists.txt +++ b/src/common/plugin/fulltext/test/CMakeLists.txt @@ -11,7 +11,6 @@ nebula_add_test( $ $ $ - $ $ $ $ diff --git a/src/common/plugin/fulltext/test/FulltextPluginTest.cpp b/src/common/plugin/fulltext/test/FulltextPluginTest.cpp index d62a372924e..2c48d3e85b5 100644 --- a/src/common/plugin/fulltext/test/FulltextPluginTest.cpp +++ b/src/common/plugin/fulltext/test/FulltextPluginTest.cpp @@ -6,7 +6,6 @@ #include #include "common/base/Base.h" -#include "common/encryption/MD5Utils.h" #include "common/network/NetworkUtils.h" #include "common/plugin/fulltext/FTUtils.h" #include "common/plugin/fulltext/elasticsearch/ESGraphAdapter.h" diff --git a/src/common/utils/test/CMakeLists.txt b/src/common/utils/test/CMakeLists.txt index dcbb1ff0533..20b5ad8c40e 100644 --- a/src/common/utils/test/CMakeLists.txt +++ b/src/common/utils/test/CMakeLists.txt @@ -93,7 +93,6 @@ nebula_add_test( $ $ $ - $ $ LIBRARIES ${THRIFT_LIBRARIES} diff --git a/src/daemons/CMakeLists.txt b/src/daemons/CMakeLists.txt index fbe4d7808a1..d1abd3a8a78 100644 --- a/src/daemons/CMakeLists.txt +++ b/src/daemons/CMakeLists.txt @@ -16,7 +16,6 @@ set(common_deps $ $ $ - $ $ $ $ diff --git a/src/graph/context/test/CMakeLists.txt b/src/graph/context/test/CMakeLists.txt index 450f869d4b9..70728ad7bde 100644 --- a/src/graph/context/test/CMakeLists.txt +++ b/src/graph/context/test/CMakeLists.txt @@ -5,7 +5,6 @@ SET(CONTEXT_TEST_LIBS $ $ - $ $ $ $ diff --git a/src/graph/executor/admin/ChangePasswordExecutor.cpp b/src/graph/executor/admin/ChangePasswordExecutor.cpp index b8244684651..48df995fd7c 100644 --- a/src/graph/executor/admin/ChangePasswordExecutor.cpp +++ b/src/graph/executor/admin/ChangePasswordExecutor.cpp @@ -5,7 +5,8 @@ #include "graph/executor/admin/ChangePasswordExecutor.h" -#include "common/encryption/MD5Utils.h" +#include + #include "graph/context/QueryContext.h" #include "graph/planner/plan/Admin.h" @@ -22,8 +23,8 @@ folly::Future ChangePasswordExecutor::changePassword() { return qctx() ->getMetaClient() ->changePassword(*cpNode->username(), - encryption::MD5Utils::md5Encode(*cpNode->newPassword()), - encryption::MD5Utils::md5Encode(*cpNode->password())) + proxygen::md5Encode(folly::StringPiece(*cpNode->newPassword())), + proxygen::md5Encode(folly::StringPiece(*cpNode->password()))) .via(runner()) .thenValue([this](StatusOr &&resp) { SCOPED_TIMER(&execTime_); diff --git a/src/graph/executor/admin/CreateUserExecutor.cpp b/src/graph/executor/admin/CreateUserExecutor.cpp index 6c185f9d041..83ed5b00d8c 100644 --- a/src/graph/executor/admin/CreateUserExecutor.cpp +++ b/src/graph/executor/admin/CreateUserExecutor.cpp @@ -5,7 +5,8 @@ #include "graph/executor/admin/CreateUserExecutor.h" -#include "common/encryption/MD5Utils.h" +#include + #include "graph/context/QueryContext.h" #include "graph/planner/plan/Admin.h" @@ -22,7 +23,7 @@ folly::Future CreateUserExecutor::createUser() { return qctx() ->getMetaClient() ->createUser(*cuNode->username(), - encryption::MD5Utils::md5Encode(*cuNode->password()), + proxygen::md5Encode(folly::StringPiece(*cuNode->password())), cuNode->ifNotExist()) .via(runner()) .thenValue([this](StatusOr resp) { diff --git a/src/graph/executor/admin/UpdateUserExecutor.cpp b/src/graph/executor/admin/UpdateUserExecutor.cpp index 4e320103dde..6d1027c4c19 100644 --- a/src/graph/executor/admin/UpdateUserExecutor.cpp +++ b/src/graph/executor/admin/UpdateUserExecutor.cpp @@ -2,10 +2,10 @@ * * This source code is licensed under Apache 2.0 License. */ - #include "graph/executor/admin/UpdateUserExecutor.h" -#include "common/encryption/MD5Utils.h" +#include + #include "graph/context/QueryContext.h" #include "graph/planner/plan/Admin.h" @@ -21,7 +21,7 @@ folly::Future UpdateUserExecutor::updateUser() { auto *uuNode = asNode(node()); return qctx() ->getMetaClient() - ->alterUser(*uuNode->username(), encryption::MD5Utils::md5Encode(*uuNode->password())) + ->alterUser(*uuNode->username(), proxygen::md5Encode(folly::StringPiece(*uuNode->password()))) .via(runner()) .thenValue([this](StatusOr resp) { SCOPED_TIMER(&execTime_); diff --git a/src/graph/executor/test/CMakeLists.txt b/src/graph/executor/test/CMakeLists.txt index 4e567905da9..66994a77120 100644 --- a/src/graph/executor/test/CMakeLists.txt +++ b/src/graph/executor/test/CMakeLists.txt @@ -30,7 +30,6 @@ SET(EXEC_QUERY_TEST_OBJS $ $ $ - $ $ $ $ diff --git a/src/graph/optimizer/test/CMakeLists.txt b/src/graph/optimizer/test/CMakeLists.txt index 96f3937b2d3..91b6420661a 100644 --- a/src/graph/optimizer/test/CMakeLists.txt +++ b/src/graph/optimizer/test/CMakeLists.txt @@ -24,7 +24,6 @@ set(OPTIMIZER_TEST_LIB $ $ $ - $ $ $ $ diff --git a/src/graph/service/CloudAuthenticator.cpp b/src/graph/service/CloudAuthenticator.cpp index 930e7b0c911..09961b30ae4 100644 --- a/src/graph/service/CloudAuthenticator.cpp +++ b/src/graph/service/CloudAuthenticator.cpp @@ -5,8 +5,9 @@ #include "graph/service/CloudAuthenticator.h" +#include + #include "common/base/Status.h" -#include "common/encryption/Base64.h" #include "common/http/HttpClient.h" #include "graph/service/GraphFlags.h" @@ -28,7 +29,7 @@ Status CloudAuthenticator::auth(const std::string& user, const std::string& pass // Second, use user + password authentication methods std::string userAndPasswd = user + ":" + password; - std::string base64Str = encryption::Base64::encode(userAndPasswd); + std::string base64Str = proxygen::base64Encode(folly::StringPiece(userAndPasswd)); std::string header = "-H \"Content-Type: application/json\" -H \"Authorization:Nebula "; header = header + base64Str + "\""; diff --git a/src/graph/service/GraphService.cpp b/src/graph/service/GraphService.cpp index be0dc9c8bf3..8e310bdb5b8 100644 --- a/src/graph/service/GraphService.cpp +++ b/src/graph/service/GraphService.cpp @@ -5,11 +5,12 @@ #include "graph/service/GraphService.h" +#include + #include #include "clients/storage/StorageClient.h" #include "common/base/Base.h" -#include "common/encryption/MD5Utils.h" #include "common/stats/StatsManager.h" #include "common/time/Duration.h" #include "common/time/TimezoneInfo.h" @@ -209,36 +210,39 @@ folly::Future GraphService::future_executeJsonWithParameter( Status GraphService::auth(const std::string& username, const std::string& password, const HostAddr& clientIp) { + auto metaClient = queryEngine_->metaClient(); + + // TODO(Aiee) This is a walkaround to address the problem that using a lower version(< v2.6.0) + // client to connect with higher version(>= v3.0.0) Nebula service will cause a crash. + // + // Only the clients since v2.6.0 will call verifyVersion(), thus we could determine whether the + // client version is lower than v2.6.0 + auto clientAddrIt = metaClient->getClientAddrMap().find(clientIp); + if (clientAddrIt == metaClient->getClientAddrMap().end()) { + return Status::Error( + folly::sformat("The version of the client sending request from {} is lower than v2.6.0, " + "please update the client.", + clientIp.toString())); + } + + // Skip authentication if FLAGS_enable_authorize is false if (!FLAGS_enable_authorize) { return Status::OK(); } + // Authenticate via diffrent auth types if (FLAGS_auth_type == "password") { - auto metaClient = queryEngine_->metaClient(); - // TODO(Aiee) This is a walkaround to address the problem that using a lower version(< v2.6.0) - // client to connect with higher version(>= v3.0.0) Nebula service will cause a crash. - // - // Only the clients since v2.6.0 will call verifyVersion(), thus we could determine whether the - // client version is lower than v2.6.0 - auto clientAddrIt = metaClient->getClientAddrMap().find(clientIp); - if (clientAddrIt == metaClient->getClientAddrMap().end()) { - return Status::Error( - folly::sformat("The version of the client sending request from {} is lower than v2.6.0, " - "please update the client.", - clientIp.toString())); - } - // Auth with PasswordAuthenticator - auto authenticator = std::make_unique(queryEngine_->metaClient()); - return authenticator->auth(username, encryption::MD5Utils::md5Encode(password)); + auto authenticator = std::make_unique(metaClient); + return authenticator->auth(username, proxygen::md5Encode(folly::StringPiece(password))); } else if (FLAGS_auth_type == "cloud") { // Cloud user and native user will be mixed. // Since cloud user and native user has the same transport protocol, // There is no way to identify which one is in the graph layer, // let's check the native user's password first, then cloud user. - auto pwdAuth = std::make_unique(queryEngine_->metaClient()); - return pwdAuth->auth(username, encryption::MD5Utils::md5Encode(password)); - auto cloudAuth = std::make_unique(queryEngine_->metaClient()); + auto pwdAuth = std::make_unique(metaClient); + return pwdAuth->auth(username, proxygen::md5Encode(folly::StringPiece(password))); + auto cloudAuth = std::make_unique(metaClient); return cloudAuth->auth(username, password); } LOG(WARNING) << "Unknown auth type: " << FLAGS_auth_type; diff --git a/src/graph/util/test/CMakeLists.txt b/src/graph/util/test/CMakeLists.txt index 64084ffda7d..4170961779c 100644 --- a/src/graph/util/test/CMakeLists.txt +++ b/src/graph/util/test/CMakeLists.txt @@ -35,7 +35,6 @@ nebula_add_test( $ $ $ - $ $ $ $ diff --git a/src/graph/validator/test/CMakeLists.txt b/src/graph/validator/test/CMakeLists.txt index b8b4e279a56..f48925ec24d 100644 --- a/src/graph/validator/test/CMakeLists.txt +++ b/src/graph/validator/test/CMakeLists.txt @@ -49,7 +49,6 @@ set(VALIDATOR_TEST_LIBS $ $ $ - $ $ $ $ diff --git a/src/graph/visitor/test/CMakeLists.txt b/src/graph/visitor/test/CMakeLists.txt index 8544b361b67..a284730e322 100644 --- a/src/graph/visitor/test/CMakeLists.txt +++ b/src/graph/visitor/test/CMakeLists.txt @@ -63,7 +63,6 @@ nebula_add_test( $ $ $ - $ $ $ $ diff --git a/src/kvstore/test/CMakeLists.txt b/src/kvstore/test/CMakeLists.txt index 97eb868396c..1954c2c9f0d 100644 --- a/src/kvstore/test/CMakeLists.txt +++ b/src/kvstore/test/CMakeLists.txt @@ -32,7 +32,6 @@ set(KVSTORE_TEST_LIBS $ $ $ - $ $ $ $ diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 27745cf4759..0c9bacc432e 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -163,7 +163,6 @@ set(meta_test_deps $ $ $ - $ $ $ $ diff --git a/src/meta/RootUserMan.h b/src/meta/RootUserMan.h index c61a1faf70d..398ea3eb8b9 100644 --- a/src/meta/RootUserMan.h +++ b/src/meta/RootUserMan.h @@ -6,8 +6,9 @@ #ifndef META_ROOTUSERMAN_H_ #define META_ROOTUSERMAN_H_ +#include + #include "common/base/Base.h" -#include "common/encryption/MD5Utils.h" #include "common/utils/MetaKeyUtils.h" #include "kvstore/KVStore.h" @@ -34,7 +35,7 @@ class RootUserMan { static bool initRootUser(kvstore::KVStore* kv) { LOG(INFO) << "Init root user"; - auto encodedPwd = encryption::MD5Utils::md5Encode("nebula"); + auto encodedPwd = proxygen::md5Encode(folly::StringPiece("nebula")); auto userKey = MetaKeyUtils::userKey("root"); auto userVal = MetaKeyUtils::userVal(std::move(encodedPwd)); auto roleKey = MetaKeyUtils::roleKey(kDefaultSpaceId, "root"); diff --git a/src/parser/test/CMakeLists.txt b/src/parser/test/CMakeLists.txt index 0ad0b9ce2a2..0b689c5568b 100644 --- a/src/parser/test/CMakeLists.txt +++ b/src/parser/test/CMakeLists.txt @@ -5,7 +5,6 @@ set(PARSER_TEST_LIBS $ $ - $ $ $ $ diff --git a/src/storage/test/CMakeLists.txt b/src/storage/test/CMakeLists.txt index 855ca4295b4..5bbbf05acb3 100644 --- a/src/storage/test/CMakeLists.txt +++ b/src/storage/test/CMakeLists.txt @@ -47,7 +47,6 @@ set(storage_test_deps $ $ $ - $ $ $ $ diff --git a/src/tools/db-dump/CMakeLists.txt b/src/tools/db-dump/CMakeLists.txt index 423a2070fd7..9eb9c671658 100644 --- a/src/tools/db-dump/CMakeLists.txt +++ b/src/tools/db-dump/CMakeLists.txt @@ -48,7 +48,6 @@ set(tools_test_deps $ $ $ - $ $ $ $ diff --git a/src/tools/db-upgrade/CMakeLists.txt b/src/tools/db-upgrade/CMakeLists.txt index 48064583506..367918cb540 100644 --- a/src/tools/db-upgrade/CMakeLists.txt +++ b/src/tools/db-upgrade/CMakeLists.txt @@ -57,7 +57,6 @@ nebula_add_executable( $ $ $ - $ $ $ $ diff --git a/src/tools/meta-dump/CMakeLists.txt b/src/tools/meta-dump/CMakeLists.txt index 2394d47eafe..7ba2307dcb0 100644 --- a/src/tools/meta-dump/CMakeLists.txt +++ b/src/tools/meta-dump/CMakeLists.txt @@ -53,7 +53,6 @@ nebula_add_executable( $ $ $ - $ $ $ $ diff --git a/src/tools/simple-kv-verify/CMakeLists.txt b/src/tools/simple-kv-verify/CMakeLists.txt index f37647239cc..8434a6c8104 100644 --- a/src/tools/simple-kv-verify/CMakeLists.txt +++ b/src/tools/simple-kv-verify/CMakeLists.txt @@ -51,7 +51,6 @@ nebula_add_executable( $ $ $ - $ $ $ $ diff --git a/src/tools/storage-perf/CMakeLists.txt b/src/tools/storage-perf/CMakeLists.txt index 8ac30954c05..40a34abfa48 100644 --- a/src/tools/storage-perf/CMakeLists.txt +++ b/src/tools/storage-perf/CMakeLists.txt @@ -48,7 +48,6 @@ set(perf_test_deps $ $ $ - $ $ $ $