Renamed a constant.

Renamed the constant containing the default basic HTTP
authenticator's name to accommodate the addition of the
default JWT authenticator.

Review: https://reviews.apache.org/r/57665/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7a267c9e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7a267c9e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7a267c9e

Branch: refs/heads/master
Commit: 7a267c9eb0c979780d8d735e1c861a7f3aa28748
Parents: 4e2eddb
Author: Greg Mann <[email protected]>
Authored: Fri Mar 24 10:00:30 2017 -0700
Committer: Anand Mazumdar <[email protected]>
Committed: Fri Mar 24 10:01:33 2017 -0700

----------------------------------------------------------------------
 src/common/http.cpp  | 11 ++++++-----
 src/common/http.hpp  |  2 +-
 src/master/flags.cpp | 10 +++++-----
 src/slave/flags.cpp  |  6 +++---
 4 files changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7a267c9e/src/common/http.cpp
----------------------------------------------------------------------
diff --git a/src/common/http.cpp b/src/common/http.cpp
index ce32ff3..942761e 100644
--- a/src/common/http.cpp
+++ b/src/common/http.cpp
@@ -950,11 +950,12 @@ Result<Authenticator*> createBasicAuthenticator(
   if (credentials.isNone()) {
     return Error(
         "No credentials provided for the default '" +
-        string(internal::DEFAULT_HTTP_AUTHENTICATOR) +
+        string(internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR) +
         "' HTTP authenticator for realm '" + realm + "'");
   }
 
-  LOG(INFO) << "Creating default '" << internal::DEFAULT_HTTP_AUTHENTICATOR
+  LOG(INFO) << "Creating default '"
+            << internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR
             << "' HTTP authenticator for realm '" << realm << "'";
 
   return BasicAuthenticatorFactory::create(realm, credentials.get());
@@ -969,7 +970,7 @@ Result<Authenticator*> createCustomAuthenticator(
     return Error(
         "HTTP authenticator '" + authenticatorName + "' not found. "
         "Check the spelling (compare to '" +
-        string(internal::DEFAULT_HTTP_AUTHENTICATOR) +
+        string(internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR) +
         "') or verify that the authenticator was loaded "
         "successfully (see --modules)");
   }
@@ -996,7 +997,7 @@ Try<Nothing> initializeHttpAuthenticators(
 
   if (authenticatorNames.size() == 1) {
     Result<Authenticator*> authenticator_ = None();
-    if (authenticatorNames[0] == internal::DEFAULT_HTTP_AUTHENTICATOR) {
+    if (authenticatorNames[0] == internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR) {
       authenticator_ =
         createBasicAuthenticator(realm, authenticatorNames[0], credentials);
     } else {
@@ -1017,7 +1018,7 @@ Try<Nothing> initializeHttpAuthenticators(
     vector<Owned<Authenticator>> authenticators;
     foreach (const string& name, authenticatorNames) {
       Result<Authenticator*> authenticator_ = None();
-      if (name == internal::DEFAULT_HTTP_AUTHENTICATOR) {
+      if (name == internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR) {
         authenticator_ = createBasicAuthenticator(realm, name, credentials);
       } else {
         authenticator_ = createCustomAuthenticator(realm, name);

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a267c9e/src/common/http.hpp
----------------------------------------------------------------------
diff --git a/src/common/http.hpp b/src/common/http.hpp
index a3cfc5d..23984b3 100644
--- a/src/common/http.hpp
+++ b/src/common/http.hpp
@@ -44,7 +44,7 @@ class Task;
 namespace internal {
 
 // Name of the default, basic authenticator.
-constexpr char DEFAULT_HTTP_AUTHENTICATOR[] = "basic";
+constexpr char DEFAULT_BASIC_HTTP_AUTHENTICATOR[] = "basic";
 
 extern hashset<std::string> AUTHORIZABLE_ENDPOINTS;
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a267c9e/src/master/flags.cpp
----------------------------------------------------------------------
diff --git a/src/master/flags.cpp b/src/master/flags.cpp
index d25cfdd..b7a129b 100644
--- a/src/master/flags.cpp
+++ b/src/master/flags.cpp
@@ -516,18 +516,18 @@ mesos::internal::master::Flags::Flags()
       "http_authenticators",
       "HTTP authenticator implementation to use when handling requests to\n"
       "authenticated endpoints. Use the default\n"
-      "`" + string(DEFAULT_HTTP_AUTHENTICATOR) + "`, or load an alternate\n"
-      "HTTP authenticator module using `--modules`.\n"
+      "`" + string(DEFAULT_BASIC_HTTP_AUTHENTICATOR) + "`, or load an\n"
+      "alternate HTTP authenticator module using `--modules`.\n"
       "\n"
       "Currently there is no support for multiple HTTP authenticators.",
-      DEFAULT_HTTP_AUTHENTICATOR);
+      DEFAULT_BASIC_HTTP_AUTHENTICATOR);
 
   add(&Flags::http_framework_authenticators,
       "http_framework_authenticators",
       "HTTP authenticator implementation to use when authenticating HTTP\n"
       "frameworks. Use the \n"
-      "`" + string(DEFAULT_HTTP_AUTHENTICATOR) + "` authenticator or load an\n"
-      "alternate authenticator module using `--modules`.\n"
+      "`" + string(DEFAULT_BASIC_HTTP_AUTHENTICATOR) + "` authenticator or\n"
+      "load an alternate authenticator module using `--modules`.\n"
       "Must be used in conjunction with `--http_authenticate_frameworks`.\n"
       "\n"
       "Currently there is no support for multiple HTTP framework\n"

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a267c9e/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 4637ca6..7198793 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -869,11 +869,11 @@ mesos::internal::slave::Flags::Flags()
       "http_authenticators",
       "HTTP authenticator implementation to use when handling requests to\n"
       "authenticated endpoints. Use the default\n"
-      "`" + string(DEFAULT_HTTP_AUTHENTICATOR) + "`, or load an alternate\n"
-      "HTTP authenticator module using `--modules`.\n"
+      "`" + string(DEFAULT_BASIC_HTTP_AUTHENTICATOR) + "`, or load an\n"
+      "alternate HTTP authenticator module using `--modules`.\n"
       "\n"
       "Currently there is no support for multiple HTTP authenticators.",
-      DEFAULT_HTTP_AUTHENTICATOR);
+      DEFAULT_BASIC_HTTP_AUTHENTICATOR);
 
   add(&Flags::authenticate_http_readwrite,
       "authenticate_http_readwrite",

Reply via email to