You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2018/08/09 09:47:29 UTC

[mesos] branch master updated: Removed code using no longer existing endpoints.

This is an automated email from the ASF dual-hosted git repository.

alexr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 483e9a9  Removed code using no longer existing endpoints.
483e9a9 is described below

commit 483e9a9a6477c38f7d33db1c5477d7721eb7a82e
Author: Jan Schlicht <ja...@mesosphere.io>
AuthorDate: Thu Aug 9 11:46:53 2018 +0200

    Removed code using no longer existing endpoints.
    
    Review: https://reviews.apache.org/r/68276/
---
 src/common/http.cpp                     |  4 +--
 src/slave/http.hpp                      |  1 -
 src/tests/authorization_tests.cpp       |  1 -
 src/tests/slave_authorization_tests.cpp |  1 -
 src/tests/slave_tests.cpp               | 59 ++++++++++++++++-----------------
 5 files changed, 29 insertions(+), 37 deletions(-)

diff --git a/src/common/http.cpp b/src/common/http.cpp
index aaddd17..932111d 100644
--- a/src/common/http.cpp
+++ b/src/common/http.cpp
@@ -99,11 +99,9 @@ namespace internal {
 hashset<string> AUTHORIZABLE_ENDPOINTS{
     "/containers",
     "/files/debug",
-    "/files/debug.json",
     "/logging/toggle",
     "/metrics/snapshot",
-    "/monitor/statistics",
-    "/monitor/statistics.json"};
+    "/monitor/statistics"};
 
 
 string serialize(
diff --git a/src/slave/http.hpp b/src/slave/http.hpp
index dcfd0d9..7820087 100644
--- a/src/slave/http.hpp
+++ b/src/slave/http.hpp
@@ -71,7 +71,6 @@ public:
       const Option<process::http::authentication::Principal>&) const;
 
   // /slave/monitor/statistics
-  // /slave/monitor/statistics.json
   process::Future<process::http::Response> statistics(
       const process::http::Request& request,
       const Option<process::http::authentication::Principal>& principal) const;
diff --git a/src/tests/authorization_tests.cpp b/src/tests/authorization_tests.cpp
index 0c3e59e..de57fc9 100644
--- a/src/tests/authorization_tests.cpp
+++ b/src/tests/authorization_tests.cpp
@@ -4855,7 +4855,6 @@ TYPED_TEST(AuthorizationTest, ValidateEndpoints)
     mesos::ACL::GetEndpoint* acl = acls.add_get_endpoints();
     acl->mutable_principals()->add_values("foo");
     acl->mutable_paths()->add_values("/monitor/statistics");
-    acl->mutable_paths()->add_values("/monitor/statistics.json");
     acl->mutable_paths()->add_values("/containers");
 
     // Create an `Authorizer` with the ACLs.
diff --git a/src/tests/slave_authorization_tests.cpp b/src/tests/slave_authorization_tests.cpp
index ea391f1..061e230 100644
--- a/src/tests/slave_authorization_tests.cpp
+++ b/src/tests/slave_authorization_tests.cpp
@@ -1258,7 +1258,6 @@ INSTANTIATE_TEST_CASE_P(
     SlaveEndpointTest,
     ::testing::Values(
         "monitor/statistics",
-        "monitor/statistics.json",
         "containers"));
 
 
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 73c481f..9597067 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2429,44 +2429,41 @@ TEST_F(SlaveTest, StatisticsEndpointAuthentication)
   Try<Owned<cluster::Slave>> agent = StartSlave(detector.get());
   ASSERT_SOME(agent);
 
-  const string statisticsEndpoints[] =
-    {"monitor/statistics", "monitor/statistics.json"};
+  const string statisticsEndpoint = "monitor/statistics";
 
-  foreach (const string& statisticsEndpoint, statisticsEndpoints) {
-    // Unauthenticated requests are rejected.
-    {
-      Future<Response> response = process::http::get(
-          agent.get()->pid,
-          statisticsEndpoint);
+  // Unauthenticated requests are rejected.
+  {
+    Future<Response> response = process::http::get(
+        agent.get()->pid,
+        statisticsEndpoint);
 
-      AWAIT_EXPECT_RESPONSE_STATUS_EQ(Unauthorized({}).status, response);
-    }
+    AWAIT_EXPECT_RESPONSE_STATUS_EQ(Unauthorized({}).status, response);
+  }
 
-    // Incorrectly authenticated requests are rejected.
-    {
-      Credential badCredential;
-      badCredential.set_principal("badPrincipal");
-      badCredential.set_secret("badSecret");
+  // Incorrectly authenticated requests are rejected.
+  {
+    Credential badCredential;
+    badCredential.set_principal("badPrincipal");
+    badCredential.set_secret("badSecret");
 
-      Future<Response> response = process::http::get(
-          agent.get()->pid,
-          statisticsEndpoint,
-          None(),
-          createBasicAuthHeaders(badCredential));
+    Future<Response> response = process::http::get(
+        agent.get()->pid,
+        statisticsEndpoint,
+        None(),
+        createBasicAuthHeaders(badCredential));
 
-      AWAIT_EXPECT_RESPONSE_STATUS_EQ(Unauthorized({}).status, response);
-    }
+    AWAIT_EXPECT_RESPONSE_STATUS_EQ(Unauthorized({}).status, response);
+  }
 
-    // Correctly authenticated requests succeed.
-    {
-      Future<Response> response = process::http::get(
-          agent.get()->pid,
-          statisticsEndpoint,
-          None(),
-          createBasicAuthHeaders(DEFAULT_CREDENTIAL));
+  // Correctly authenticated requests succeed.
+  {
+    Future<Response> response = process::http::get(
+        agent.get()->pid,
+        statisticsEndpoint,
+        None(),
+        createBasicAuthHeaders(DEFAULT_CREDENTIAL));
 
-      AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
-    }
+    AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
   }
 }