diff --git a/CHANGELOG b/CHANGELOG index 6762fc9e44..01eb0b4d4c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ v1.1.x (XXXX-XX-XX) ------------------- +* INCOMPATIBLE CHANGE: renamed parameters "connect-timeout" and "request-timeout" + for arangosh and arangoimp to "--server.connect-timeout" and "--server.request-timeout" + * INCOMPATIBLE CHANGE: authorization is now required when using the server Clients sending requests without HTTP autorization will be rejected with HTTP 401 diff --git a/arangosh/V8Client/arangoimp.cpp b/arangosh/V8Client/arangoimp.cpp index f29847c80f..b8cae7d84d 100644 --- a/arangosh/V8Client/arangoimp.cpp +++ b/arangosh/V8Client/arangoimp.cpp @@ -70,6 +70,12 @@ static int64_t DEFAULT_REQUEST_TIMEOUT = 300; static size_t DEFAULT_RETRIES = 2; static int64_t DEFAULT_CONNECTION_TIMEOUT = 3; +//////////////////////////////////////////////////////////////////////////////// +/// @brief whether or not a password was specified +//////////////////////////////////////////////////////////////////////////////// + +static bool _hasPassword = false; + //////////////////////////////////////////////////////////////////////////////// /// @brief endpoint to connect to //////////////////////////////////////////////////////////////////////////////// @@ -175,6 +181,8 @@ static void ParseProgramOptions (int argc, char* argv[]) { cerr << options.lastError() << "\n"; exit(EXIT_FAILURE); } + + _hasPassword = options.has("server.password"); if (FileName == "" && myargs.size() > 0) { FileName = myargs[0]; @@ -238,7 +246,7 @@ int main (int argc, char* argv[]) { exit(EXIT_FAILURE); } - if (_password.size() == 0) { + if (! _hasPassword) { // no password given on command-line cout << "Please specify a password:" << endl; // now prompt for it @@ -252,11 +260,6 @@ int main (int argc, char* argv[]) { #endif } - if (_password.size() == 0) { - cerr << "no value specified for --server.password" << endl; - exit(EXIT_FAILURE); - } - _endpoint = Endpoint::clientFactory(_endpointString); if (_endpoint == 0) { diff --git a/arangosh/V8Client/arangosh.cpp b/arangosh/V8Client/arangosh.cpp index d14ea1ab1a..3a13feb8b5 100644 --- a/arangosh/V8Client/arangosh.cpp +++ b/arangosh/V8Client/arangosh.cpp @@ -121,6 +121,12 @@ static char const DEF_RESET[5] = "\x1b[0m"; /// @{ //////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +/// @brief whether or not a password was specified on the command line +//////////////////////////////////////////////////////////////////////////////// + +static bool _hasPassword = false; + //////////////////////////////////////////////////////////////////////////////// /// @brief endpoint //////////////////////////////////////////////////////////////////////////////// @@ -597,6 +603,8 @@ static void ParseProgramOptions (int argc, char* argv[]) { TRI_SetLogLevelLogging(level.c_str()); TRI_CreateLogAppenderFile("-"); + _hasPassword = options.has("server.password"); + // set colors if (options.has("colors")) { NoColors = false; @@ -1234,7 +1242,7 @@ int main (int argc, char* argv[]) { exit(EXIT_FAILURE); } - if (_password.size() == 0) { + if (! _hasPassword) { // no password given on command-line cout << "Please specify a password:" << endl; // now prompt for it @@ -1248,12 +1256,6 @@ int main (int argc, char* argv[]) { #endif } - if (_password.size() == 0) { - cerr << "no value specified for --server.password" << endl; - exit(EXIT_FAILURE); - } - - // ............................................................................. // set-up client connection // .............................................................................