summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2018-12-12 15:32:20 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2019-01-10 10:42:14 -0500
commitddfcf4db94f442d0a9f7426a5ec4b284e64c3718 (patch)
tree1c9401448513caab7b58b5d61b7b84f020a7760f /src
parentfcfe516250e2172d2fe6c9dab006b13d9d8140d7 (diff)
downloadmongo-ddfcf4db94f442d0a9f7426a5ec4b284e64c3718.tar.gz
SERVER-38534 Convert enableLocalhostAuthBypass to IDL
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/auth/SConscript1
-rw-r--r--src/mongo/db/auth/authz_session_external_state_server_common.cpp2
-rw-r--r--src/mongo/db/auth/enable_localhost_auth_bypass_parameter.idl10
3 files changed, 12 insertions, 1 deletions
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index 83b1597c06d..60700235c12 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -262,6 +262,7 @@ env.Library(
source=[
'authz_session_external_state_server_common.cpp',
'sasl_commands.cpp',
+ env.Idlc('enable_localhost_auth_bypass_parameter.idl')[0],
],
LIBDEPS=[
'auth',
diff --git a/src/mongo/db/auth/authz_session_external_state_server_common.cpp b/src/mongo/db/auth/authz_session_external_state_server_common.cpp
index 9fe4fa2a828..1bfac978e74 100644
--- a/src/mongo/db/auth/authz_session_external_state_server_common.cpp
+++ b/src/mongo/db/auth/authz_session_external_state_server_common.cpp
@@ -37,6 +37,7 @@
#include <mutex>
#include "mongo/base/status.h"
+#include "mongo/db/auth/enable_localhost_auth_bypass_parameter_gen.h"
#include "mongo/db/client.h"
#include "mongo/db/server_parameters.h"
#include "mongo/util/debug_util.h"
@@ -45,7 +46,6 @@
namespace mongo {
namespace {
-MONGO_EXPORT_STARTUP_SERVER_PARAMETER(enableLocalhostAuthBypass, bool, true);
std::once_flag checkShouldAllowLocalhostOnceFlag;
} // namespace
diff --git a/src/mongo/db/auth/enable_localhost_auth_bypass_parameter.idl b/src/mongo/db/auth/enable_localhost_auth_bypass_parameter.idl
new file mode 100644
index 00000000000..b93a6fbc7ac
--- /dev/null
+++ b/src/mongo/db/auth/enable_localhost_auth_bypass_parameter.idl
@@ -0,0 +1,10 @@
+global:
+ cpp_namespace: "mongo"
+
+server_parameters:
+ enableLocalhostAuthBypass:
+ description: "Enable authorization bypass for localhost connections"
+ set_at: startup
+ cpp_varname: "enableLocalhostAuthBypass"
+ cpp_vartype: bool
+ default: true \ No newline at end of file