You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2016/03/18 22:32:34 UTC

[3/3] mesos git commit: Enabled Authentication information in endpoint HELP.

Enabled Authentication information in endpoint HELP.

Enabled endpoint HELP string to display information about
authentication requirements.

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


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

Branch: refs/heads/master
Commit: 84fcc1de23e00bd2afe5daaa0a0c915277720c65
Parents: 630b12a
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Fri Mar 18 03:27:01 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Fri Mar 18 14:31:20 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/help.hpp | 18 ++++++++++++++++--
 3rdparty/libprocess/src/help.cpp             |  8 ++++++++
 3rdparty/libprocess/src/logging.cpp          |  1 +
 3 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/84fcc1de/3rdparty/libprocess/include/process/help.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/help.hpp b/3rdparty/libprocess/include/process/help.hpp
index 783304e..3f85980 100644
--- a/3rdparty/libprocess/include/process/help.hpp
+++ b/3rdparty/libprocess/include/process/help.hpp
@@ -40,13 +40,17 @@ namespace process {
 //     ### DESCRIPTION ###
 //     description
 //
+//     ### AUTHENTICATION ###
+//     authentication requirements
+//
 //     references
 //
-// See the 'USAGE', 'TLDR', 'DESCRIPTION', and 'REFERENCES' helpers
-// below to more easily construct your help pages.
+// See the 'USAGE', 'TLDR', 'DESCRIPTION', 'AUTHENTICATION', and
+// 'REFERENCES' helpers below to more easily construct your help pages.
 std::string HELP(
     const std::string& tldr,
     const Option<std::string>& description = None(),
+    const Option<std::string>& authentication = None(),
     const Option<std::string>& references = None());
 
 // Helper for single-line usage that puts it in a blockquote as code
@@ -70,6 +74,16 @@ inline std::string DESCRIPTION(T&&... args)
   return strings::join("\n", std::forward<T>(args)..., "\n");
 }
 
+// Helper for description of Authentication requirements.
+inline std::string AUTHENTICATION(bool required)
+{
+  if (required) {
+    return "This endpoint requires authentication iff HTTP authentication is\n"
+           "enabled.\n";
+  }
+  return "This endpoint does not require authentication.\n";
+}
+
 
 template <typename... T>
 inline std::string REFERENCES(T&&... args)

http://git-wip-us.apache.org/repos/asf/mesos/blob/84fcc1de/3rdparty/libprocess/src/help.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/help.cpp b/3rdparty/libprocess/src/help.cpp
index 5f36880..e046933 100644
--- a/3rdparty/libprocess/src/help.cpp
+++ b/3rdparty/libprocess/src/help.cpp
@@ -40,6 +40,7 @@ namespace process {
 string HELP(
     const string& tldr,
     const Option<string>& description,
+    const Option<string>& authentication,
     const Option<string>& references)
 {
   // Construct the help string.
@@ -58,6 +59,13 @@ string HELP(
       description.get();
   }
 
+  if (authentication.isSome()) {
+    help +=
+      "\n"
+      "### AUTHENTICATION ###\n" +
+      authentication.get();
+  }
+
   if (!strings::endsWith(help, "\n")) {
     help += "\n";
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/84fcc1de/3rdparty/libprocess/src/logging.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/logging.cpp b/3rdparty/libprocess/src/logging.cpp
index 015a43d..bdbf716 100644
--- a/3rdparty/libprocess/src/logging.cpp
+++ b/3rdparty/libprocess/src/logging.cpp
@@ -92,6 +92,7 @@ const std::string Logging::TOGGLE_HELP()
         ">        level=VALUE          Verbosity level (e.g., 1, 2, 3)",
         ">        duration=VALUE       Duration to keep verbosity level",
         ">                             toggled (e.g., 10secs, 15mins, etc.)"),
+    None(),
     REFERENCES(
         "[glog]: https://code.google.com/p/google-glog"));
 }