Changed the namespaces of the secret generators.

This patch updates the namespaces of the secret generators.
The `SecretGenerator` is placed into `mesos::`, consistent
with other classes declared in files in the same directory.
The implementations in `src/authentication/` do not exhibit
a consistent pattern, so the `JWTSecretGenerator` was placed
in a namespace indicative of its directory structure:
`mesos::authentication::executor`.

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


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

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

----------------------------------------------------------------------
 include/mesos/authentication/secret_generator.hpp    | 4 ----
 include/mesos/module/secret_generator.hpp            | 8 ++++----
 src/authentication/executor/jwt_secret_generator.cpp | 4 ++--
 src/authentication/executor/jwt_secret_generator.hpp | 4 ++--
 src/tests/secret_generator_tests.cpp                 | 2 +-
 5 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c67c1/include/mesos/authentication/secret_generator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/authentication/secret_generator.hpp 
b/include/mesos/authentication/secret_generator.hpp
index f2fb0e7..680b0d6 100644
--- a/include/mesos/authentication/secret_generator.hpp
+++ b/include/mesos/authentication/secret_generator.hpp
@@ -23,8 +23,6 @@
 #include <process/http.hpp>
 
 namespace mesos {
-namespace http {
-namespace authentication {
 
 /**
  * The SecretGenerator interface represents a mechanism to create a secret
@@ -42,8 +40,6 @@ public:
       const process::http::authentication::Principal& principal) = 0;
 };
 
-} // namespace authentication {
-} // namespace http {
 } // namespace mesos {
 
 #endif // __MESOS_AUTHENTICATION_SECRET_GENERATOR_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c67c1/include/mesos/module/secret_generator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/module/secret_generator.hpp 
b/include/mesos/module/secret_generator.hpp
index c8b7d8c..2add6b8 100644
--- a/include/mesos/module/secret_generator.hpp
+++ b/include/mesos/module/secret_generator.hpp
@@ -26,14 +26,14 @@ namespace mesos {
 namespace modules {
 
 template <>
-inline const char* kind<mesos::http::authentication::SecretGenerator>()
+inline const char* kind<mesos::SecretGenerator>()
 {
   return "SecretGenerator";
 }
 
 
 template <>
-struct Module<mesos::http::authentication::SecretGenerator> : ModuleBase
+struct Module<mesos::SecretGenerator> : ModuleBase
 {
   Module(
       const char* _moduleApiVersion,
@@ -47,14 +47,14 @@ struct Module<mesos::http::authentication::SecretGenerator> 
: ModuleBase
     : ModuleBase(
         _moduleApiVersion,
         _mesosVersion,
-        mesos::modules::kind<mesos::http::authentication::SecretGenerator>(),
+        mesos::modules::kind<mesos::SecretGenerator>(),
         _authorName,
         _authorEmail,
         _description,
         _compatible),
       create(_create) {}
 
-  mesos::http::authentication::SecretGenerator* (*create)(
+  mesos::SecretGenerator* (*create)(
       const Parameters& parameters);
 };
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c67c1/src/authentication/executor/jwt_secret_generator.cpp
----------------------------------------------------------------------
diff --git a/src/authentication/executor/jwt_secret_generator.cpp 
b/src/authentication/executor/jwt_secret_generator.cpp
index 6aed6bd..5530a84 100644
--- a/src/authentication/executor/jwt_secret_generator.cpp
+++ b/src/authentication/executor/jwt_secret_generator.cpp
@@ -22,8 +22,8 @@
 #include <stout/stringify.hpp>
 
 namespace mesos {
-namespace http {
 namespace authentication {
+namespace executor {
 
 using process::Failure;
 using process::Future;
@@ -70,6 +70,6 @@ Future<Secret> JWTSecretGenerator::generate(const Principal& 
principal)
   return result;
 }
 
+} // namespace executor {
 } // namespace authentication {
-} // namespace http {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c67c1/src/authentication/executor/jwt_secret_generator.hpp
----------------------------------------------------------------------
diff --git a/src/authentication/executor/jwt_secret_generator.hpp 
b/src/authentication/executor/jwt_secret_generator.hpp
index a945358..91c0d86 100644
--- a/src/authentication/executor/jwt_secret_generator.hpp
+++ b/src/authentication/executor/jwt_secret_generator.hpp
@@ -25,8 +25,8 @@
 #include <process/future.hpp>
 
 namespace mesos {
-namespace http {
 namespace authentication {
+namespace executor {
 
 /**
  * Creates a VALUE-type secret containing a JWT. When the secret is
@@ -48,8 +48,8 @@ private:
   std::string secret_;
 };
 
+} // namespace executor {
 } // namespace authentication {
-} // namespace http {
 } // namespace mesos {
 
 #endif // __MESOS_AUTHENTICATION_EXECUTOR_JWT_SECRET_GENERATOR_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c67c1/src/tests/secret_generator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/secret_generator_tests.cpp 
b/src/tests/secret_generator_tests.cpp
index 81fd54d..7fd649b 100644
--- a/src/tests/secret_generator_tests.cpp
+++ b/src/tests/secret_generator_tests.cpp
@@ -35,7 +35,7 @@ namespace mesos {
 namespace internal {
 namespace tests {
 
-using mesos::http::authentication::JWTSecretGenerator;
+using mesos::authentication::executor::JWTSecretGenerator;
 
 using process::Future;
 

Reply via email to