You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2017/04/21 17:45:57 UTC
[3/8] mesos git commit: Added a ContainerID to
'ObjectApprover::Object'.
Added a ContainerID to 'ObjectApprover::Object'.
This patch adds a new member, `container_id` to the
`ObjectApprover::Object` to facilitate implicit executor
authorization.
Review: https://reviews.apache.org/r/58253/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c4011900
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c4011900
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c4011900
Branch: refs/heads/master
Commit: c401190086e1a419280c49833663aaf740ce6104
Parents: 02c2d6f
Author: Greg Mann <gr...@mesosphere.io>
Authored: Fri Apr 21 10:45:16 2017 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Apr 21 10:45:16 2017 -0700
----------------------------------------------------------------------
include/mesos/authorizer/authorizer.hpp | 8 ++++++--
include/mesos/authorizer/authorizer.proto | 1 +
src/authorizer/local/authorizer.cpp | 1 +
3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c4011900/include/mesos/authorizer/authorizer.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/authorizer/authorizer.hpp b/include/mesos/authorizer/authorizer.hpp
index 75801cc..4a7376f 100644
--- a/include/mesos/authorizer/authorizer.hpp
+++ b/include/mesos/authorizer/authorizer.hpp
@@ -54,7 +54,8 @@ public:
quota_info(nullptr),
weight_info(nullptr),
resource(nullptr),
- command_info(nullptr) {}
+ command_info(nullptr),
+ container_id(nullptr) {}
Object(const authorization::Object& object)
: value(object.has_value() ? &object.value() : nullptr),
@@ -68,7 +69,9 @@ public:
weight_info(object.has_weight_info() ? &object.weight_info() : nullptr),
resource(object.has_resource() ? &object.resource() : nullptr),
command_info(
- object.has_command_info() ? &object.command_info() : nullptr) {}
+ object.has_command_info() ? &object.command_info() : nullptr),
+ container_id(
+ object.has_container_id() ? &object.container_id() : nullptr) {}
const std::string* value;
const FrameworkInfo* framework_info;
@@ -79,6 +82,7 @@ public:
const WeightInfo* weight_info;
const Resource* resource;
const CommandInfo* command_info;
+ const ContainerID* container_id;
};
/**
http://git-wip-us.apache.org/repos/asf/mesos/blob/c4011900/include/mesos/authorizer/authorizer.proto
----------------------------------------------------------------------
diff --git a/include/mesos/authorizer/authorizer.proto b/include/mesos/authorizer/authorizer.proto
index 736f76d..0951be9 100644
--- a/include/mesos/authorizer/authorizer.proto
+++ b/include/mesos/authorizer/authorizer.proto
@@ -54,6 +54,7 @@ message Object {
optional WeightInfo weight_info = 7;
optional Resource resource = 8;
optional CommandInfo command_info = 9;
+ optional ContainerID container_id = 10;
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c4011900/src/authorizer/local/authorizer.cpp
----------------------------------------------------------------------
diff --git a/src/authorizer/local/authorizer.cpp b/src/authorizer/local/authorizer.cpp
index 8ca9ae9..8c3178a 100644
--- a/src/authorizer/local/authorizer.cpp
+++ b/src/authorizer/local/authorizer.cpp
@@ -1079,6 +1079,7 @@ process::Future<bool> LocalAuthorizer::authorized(
request.object().has_executor_info() ||
request.object().has_quota_info() ||
request.object().has_weight_info() ||
+ request.object().has_container_id() ||
request.object().has_resource())));
typedef Future<bool> (LocalAuthorizerProcess::*F)(