summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@mongodb.com>2014-03-31 12:50:33 -0400
committerShaun Verch <shaun.verch@mongodb.com>2014-03-31 13:59:58 -0400
commit6016ef6ba48fbfef484a547b33eaf3e56615f57e (patch)
tree2f4e205560e63fae0898df6968c895796a3a70af
parent2927031d377002fd483ada3d63c2a58a3fa8b0b7 (diff)
downloadmongo-6016ef6ba48fbfef484a547b33eaf3e56615f57e.tar.gz
SERVER-13416 Rename security.authentication to security.authorization
(cherry picked from commit 6c38102c43fe66faa5c282ac59c206f162ccc6ff)
-rw-r--r--jstests/auth/auth_options.js8
-rw-r--r--jstests/libs/config_files/enable_auth.json2
-rw-r--r--src/mongo/db/mongod_options.cpp29
3 files changed, 20 insertions, 19 deletions
diff --git a/jstests/auth/auth_options.js b/jstests/auth/auth_options.js
index 46f0537446d..36a76449f4b 100644
--- a/jstests/auth/auth_options.js
+++ b/jstests/auth/auth_options.js
@@ -32,7 +32,7 @@ jsTest.log("Testing \"auth\" command line option");
var expectedResult = {
"parsed" : {
"security" : {
- "authentication" : "required"
+ "authorization" : "enabled"
}
}
};
@@ -42,18 +42,18 @@ jsTest.log("Testing \"noauth\" command line option");
expectedResult = {
"parsed" : {
"security" : {
- "authentication" : "optional"
+ "authorization" : "disabled"
}
}
};
testGetCmdLineOpts({ noauth : "" }, expectedResult);
-jsTest.log("Testing \"security.authentication\" config file option");
+jsTest.log("Testing \"security.authorization\" config file option");
expectedResult = {
"parsed" : {
"config" : "jstests/libs/config_files/enable_auth.json",
"security" : {
- "authentication" : "required"
+ "authorization" : "enabled"
}
}
};
diff --git a/jstests/libs/config_files/enable_auth.json b/jstests/libs/config_files/enable_auth.json
index 0f8aa7d9779..9f9cc84d107 100644
--- a/jstests/libs/config_files/enable_auth.json
+++ b/jstests/libs/config_files/enable_auth.json
@@ -1,5 +1,5 @@
{
"security" : {
- "authentication" : "required"
+ "authorization" : "enabled"
}
}
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp
index f79c1715278..8c2f7dbc4f1 100644
--- a/src/mongo/db/mongod_options.cpp
+++ b/src/mongo/db/mongod_options.cpp
@@ -96,13 +96,14 @@ namespace mongo {
.incompatibleWith("auth");
// Way to enable or disable auth in JSON Config
- general_options.addOptionChaining("security.authentication", "", moe::String,
- "How the database behaves with respect to authentication of clients. "
- "Options are \"optional\", which means that a client can connect with or without "
- "authentication, and \"required\" which means clients must use authentication")
+ general_options.addOptionChaining("security.authorization", "", moe::String,
+ "How the database behaves with respect to authorization of clients. "
+ "Options are \"disabled\", which means that authorization checks are not "
+ "performed, and \"enabled\" which means that a client cannot perform actions it is "
+ "not authorized to do.")
.setSources(moe::SourceYAMLConfig)
- .format("(:?optional)|(:?required)",
- "(optional/required)");
+ .format("(:?disabled)|(:?enabled)",
+ "(disabled/enabled)");
// setParameter parameters that we want as config file options
// TODO: Actually read these into our environment. Currently they have no effect
@@ -637,8 +638,8 @@ namespace mongo {
// "security.authentication" comes from the config file, so override it if "noauth" or
// "auth" are set since those come from the command line.
if (params->count("noauth")) {
- Status ret = params->set("security.authentication",
- moe::Value(std::string("optional")));
+ Status ret = params->set("security.authorization",
+ moe::Value(std::string("disabled")));
if (!ret.isOK()) {
return ret;
}
@@ -648,8 +649,8 @@ namespace mongo {
}
}
if (params->count("auth")) {
- Status ret = params->set("security.authentication",
- moe::Value(std::string("required")));
+ Status ret = params->set("security.authorization",
+ moe::Value(std::string("enabled")));
if (!ret.isOK()) {
return ret;
}
@@ -862,12 +863,12 @@ namespace mongo {
if (params.count("cpu")) {
serverGlobalParams.cpu = true;
}
- if (params.count("security.authentication") &&
- params["security.authentication"].as<std::string>() == "optional") {
+ if (params.count("security.authorization") &&
+ params["security.authorization"].as<std::string>() == "disabled") {
getGlobalAuthorizationManager()->setAuthEnabled(false);
}
- if (params.count("security.authentication") &&
- params["security.authentication"].as<std::string>() == "required") {
+ if (params.count("security.authorization") &&
+ params["security.authorization"].as<std::string>() == "enabled") {
getGlobalAuthorizationManager()->setAuthEnabled(true);
}
if (params.count("storage.quota.enforced")) {