You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2017/10/10 18:59:28 UTC

[2/4] mesos git commit: Modularized HTTP authenticatee.

Modularized HTTP authenticatee.

Introduces an HTTP authenticatee module kind.

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


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

Branch: refs/heads/master
Commit: a687d975e41ce162cf5806278f3ca78a69f67571
Parents: 185b64f
Author: Till Toenshoff <to...@me.com>
Authored: Tue Oct 10 20:17:38 2017 +0200
Committer: Till Toenshoff <to...@me.com>
Committed: Tue Oct 10 20:59:13 2017 +0200

----------------------------------------------------------------------
 include/mesos/module/http_authenticatee.hpp | 64 ++++++++++++++++++++++++
 src/Makefile.am                             |  1 +
 src/module/manager.cpp                      |  1 +
 3 files changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a687d975/include/mesos/module/http_authenticatee.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/module/http_authenticatee.hpp b/include/mesos/module/http_authenticatee.hpp
new file mode 100644
index 0000000..554b45b
--- /dev/null
+++ b/include/mesos/module/http_authenticatee.hpp
@@ -0,0 +1,64 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __MESOS_MODULE_HTTP_AUTHENTICATEE_HPP__
+#define __MESOS_MODULE_HTTP_AUTHENTICATEE_HPP__
+
+#include <mesos/mesos.hpp>
+#include <mesos/module.hpp>
+
+#include <mesos/authentication/http/authenticatee.hpp>
+
+namespace mesos {
+namespace modules {
+
+template <>
+inline const char* kind<mesos::http::authentication::Authenticatee>()
+{
+  return "HttpAuthenticatee";
+}
+
+
+template <>
+struct Module<mesos::http::authentication::Authenticatee> : ModuleBase
+{
+  Module(
+      const char* _moduleApiVersion,
+      const char* _mesosVersion,
+      const char* _authorName,
+      const char* _authorEmail,
+      const char* _description,
+      bool (*_compatible)(),
+      mesos::http::authentication::Authenticatee* (*_create)(
+          const Parameters& parameters))
+    : ModuleBase(
+        _moduleApiVersion,
+        _mesosVersion,
+        mesos::modules::kind<mesos::http::authentication::Authenticatee>(),
+        _authorName,
+        _authorEmail,
+        _description,
+        _compatible),
+      create(_create) {}
+
+  mesos::http::authentication::Authenticatee* (*create)(
+      const Parameters& parameters);
+};
+
+} // namespace modules {
+} // namespace mesos {
+
+#endif // __MESOS_MODULE_HTTP_AUTHENTICATEE_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/a687d975/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index edfc16d..ca43f25 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -722,6 +722,7 @@ module_HEADERS =							\
   $(top_srcdir)/include/mesos/module/detector.hpp			\
   $(top_srcdir)/include/mesos/module/hook.hpp				\
   $(top_srcdir)/include/mesos/module/hook.proto				\
+  $(top_srcdir)/include/mesos/module/http_authenticatee.hpp		\
   $(top_srcdir)/include/mesos/module/http_authenticator.hpp		\
   $(top_srcdir)/include/mesos/module/isolator.hpp			\
   $(top_srcdir)/include/mesos/module/module.hpp				\

http://git-wip-us.apache.org/repos/asf/mesos/blob/a687d975/src/module/manager.cpp
----------------------------------------------------------------------
diff --git a/src/module/manager.cpp b/src/module/manager.cpp
index ec5614a..d93648a 100644
--- a/src/module/manager.cpp
+++ b/src/module/manager.cpp
@@ -72,6 +72,7 @@ void ModuleManager::initialize()
   kindToVersion["Authorizer"] = MESOS_VERSION;
   kindToVersion["ContainerLogger"] = MESOS_VERSION;
   kindToVersion["Hook"] = MESOS_VERSION;
+  kindToVersion["HttpAuthenticatee"] = MESOS_VERSION;
   kindToVersion["HttpAuthenticator"] = MESOS_VERSION;
   kindToVersion["Isolator"] = MESOS_VERSION;
   kindToVersion["MasterContender"] = MESOS_VERSION;