Added a realm for resource provider authentication. Review: https://reviews.apache.org/r/66933/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/abc76653 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/abc76653 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/abc76653 Branch: refs/heads/master Commit: abc76653daa2a555b7675a50e6ce96f15f92c25f Parents: 50f561a Author: Jan Schlicht <j...@mesosphere.io> Authored: Wed May 9 12:39:19 2018 +0200 Committer: Benjamin Bannier <bbann...@apache.org> Committed: Wed May 9 13:32:05 2018 +0200 ---------------------------------------------------------------------- src/slave/constants.hpp | 4 ++++ src/slave/slave.cpp | 2 +- src/tests/cluster.cpp | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/abc76653/src/slave/constants.hpp ---------------------------------------------------------------------- diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp index d1d15c3..b97daf3 100644 --- a/src/slave/constants.hpp +++ b/src/slave/constants.hpp @@ -167,6 +167,10 @@ constexpr char READWRITE_HTTP_AUTHENTICATION_REALM[] = "mesos-agent-readwrite"; // Name of the agent HTTP authentication realm for HTTP executors. constexpr char EXECUTOR_HTTP_AUTHENTICATION_REALM[] = "mesos-agent-executor"; +// Name of the agent HTTP authentication realm for HTTP resource providers. +constexpr char RESOURCE_PROVIDER_HTTP_AUTHENTICATION_REALM[] = + "mesos-agent-resource-provider"; + // Default maximum storage space to be used by the fetcher cache. constexpr Bytes DEFAULT_FETCHER_CACHE_SIZE = Gigabytes(2); http://git-wip-us.apache.org/repos/asf/mesos/blob/abc76653/src/slave/slave.cpp ---------------------------------------------------------------------- diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp index c6d9152..1f77bcc 100644 --- a/src/slave/slave.cpp +++ b/src/slave/slave.cpp @@ -779,7 +779,7 @@ void Slave::initialize() }); route( "/api/v1/resource_provider", - READWRITE_HTTP_AUTHENTICATION_REALM, + RESOURCE_PROVIDER_HTTP_AUTHENTICATION_REALM, Http::RESOURCE_PROVIDER_HELP(), [this](const http::Request& request, const Option<Principal>& principal) -> Future<http::Response> { http://git-wip-us.apache.org/repos/asf/mesos/blob/abc76653/src/tests/cluster.cpp ---------------------------------------------------------------------- diff --git a/src/tests/cluster.cpp b/src/tests/cluster.cpp index c071da6..b56212f 100644 --- a/src/tests/cluster.cpp +++ b/src/tests/cluster.cpp @@ -600,6 +600,8 @@ Slave::~Slave() slave::READWRITE_HTTP_AUTHENTICATION_REALM); process::http::authentication::unsetAuthenticator( slave::EXECUTOR_HTTP_AUTHENTICATION_REALM); + process::http::authentication::unsetAuthenticator( + slave::RESOURCE_PROVIDER_HTTP_AUTHENTICATION_REALM); // If either `shutdown()` or `terminate()` were called already, // skip the below container cleanup logic. Additionally, we can skip