Repository: mesos Updated Branches: refs/heads/master fe7ca914d -> d225d4d41
Renamed RegisterAgent.agent to RegisterAgent.agents in acls.proto. Renames the field `RegisterAgent.agent` to `RegisterAgent.agents` in order to come make it consistent with other ACLs. Review: https://reviews.apache.org/r/59453/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d225d4d4 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d225d4d4 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d225d4d4 Branch: refs/heads/master Commit: d225d4d4122e773e2416ba0d0eee653da8ced352 Parents: fe7ca91 Author: Alexander Rojas <alexan...@mesosphere.io> Authored: Wed May 24 09:24:20 2017 -0700 Committer: Neil Conway <neil.con...@gmail.com> Committed: Wed May 24 09:43:07 2017 -0700 ---------------------------------------------------------------------- include/mesos/authorizer/acls.proto | 2 +- src/authorizer/local/authorizer.cpp | 6 +++--- src/tests/authorization_tests.cpp | 6 +++--- src/tests/master_authorization_tests.cpp | 8 ++++---- src/tests/script.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/d225d4d4/include/mesos/authorizer/acls.proto ---------------------------------------------------------------------- diff --git a/include/mesos/authorizer/acls.proto b/include/mesos/authorizer/acls.proto index ae0b1ea..36b3ac2 100644 --- a/include/mesos/authorizer/acls.proto +++ b/include/mesos/authorizer/acls.proto @@ -351,7 +351,7 @@ message ACL { // Objects: Given implicitly. Use Entity type ANY or NONE to allow or deny // access. - required Entity agent = 2; + required Entity agents = 2; } } http://git-wip-us.apache.org/repos/asf/mesos/blob/d225d4d4/src/authorizer/local/authorizer.cpp ---------------------------------------------------------------------- diff --git a/src/authorizer/local/authorizer.cpp b/src/authorizer/local/authorizer.cpp index 89aaf4b..1f2a990 100644 --- a/src/authorizer/local/authorizer.cpp +++ b/src/authorizer/local/authorizer.cpp @@ -1242,7 +1242,7 @@ private: foreach (const ACL::RegisterAgent& acl, acls.register_agents()) { GenericACL acl_; acl_.subjects = acl.principals(); - acl_.objects = acl.agent(); + acl_.objects = acl.agents(); acls_.push_back(acl_); } @@ -1337,9 +1337,9 @@ Option<Error> LocalAuthorizer::validate(const ACLs& acls) } foreach (const ACL::RegisterAgent& acl, acls.register_agents()) { - if (acl.agent().type() == ACL::Entity::SOME) { + if (acl.agents().type() == ACL::Entity::SOME) { return Error( - "acls.register_agents.agent type must be either NONE or ANY"); + "acls.register_agents type must be either NONE or ANY"); } } http://git-wip-us.apache.org/repos/asf/mesos/blob/d225d4d4/src/tests/authorization_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/authorization_tests.cpp b/src/tests/authorization_tests.cpp index 32aa6ac..6d85a54 100644 --- a/src/tests/authorization_tests.cpp +++ b/src/tests/authorization_tests.cpp @@ -4898,14 +4898,14 @@ TYPED_TEST(AuthorizationTest, RegisterAgent) // "foo" principal can register as an agent. mesos::ACL::RegisterAgent* acl = acls.add_register_agents(); acl->mutable_principals()->add_values("foo"); - acl->mutable_agent()->set_type(mesos::ACL::Entity::ANY); + acl->mutable_agents()->set_type(mesos::ACL::Entity::ANY); } { // Nobody else can register as an agent. mesos::ACL::RegisterAgent* acl = acls.add_register_agents(); acl->mutable_principals()->set_type(mesos::ACL::Entity::ANY); - acl->mutable_agent()->set_type(mesos::ACL::Entity::NONE); + acl->mutable_agents()->set_type(mesos::ACL::Entity::NONE); } Try<Authorizer*> create = TypeParam::create(parameterize(acls)); @@ -4936,7 +4936,7 @@ TYPED_TEST(AuthorizationTest, RegisterAgent) mesos::ACL::RegisterAgent* acl = invalid.add_register_agents(); acl->mutable_principals()->add_values("foo"); - acl->mutable_agent()->add_values("yoda"); + acl->mutable_agents()->add_values("yoda"); Try<Authorizer*> create = TypeParam::create(parameterize(invalid)); EXPECT_ERROR(create); http://git-wip-us.apache.org/repos/asf/mesos/blob/d225d4d4/src/tests/master_authorization_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/master_authorization_tests.cpp b/src/tests/master_authorization_tests.cpp index e4233c1..0a2f31b 100644 --- a/src/tests/master_authorization_tests.cpp +++ b/src/tests/master_authorization_tests.cpp @@ -2339,7 +2339,7 @@ TEST_F(MasterAuthorizationTest, AuthorizedToRegisterAndReregisterAgent) ACLs acls; mesos::ACL::RegisterAgent* acl = acls.add_register_agents(); acl->mutable_principals()->add_values(DEFAULT_CREDENTIAL.principal()); - acl->mutable_agent()->set_type(ACL::Entity::ANY); + acl->mutable_agents()->set_type(ACL::Entity::ANY); master::Flags masterFlags = CreateMasterFlags(); masterFlags.acls = acls; @@ -2378,7 +2378,7 @@ TEST_F(MasterAuthorizationTest, UnauthorizedToRegisterAgent) ACLs acls; mesos::ACL::RegisterAgent* acl = acls.add_register_agents(); acl->mutable_principals()->add_values(DEFAULT_CREDENTIAL.principal()); - acl->mutable_agent()->set_type(ACL::Entity::NONE); + acl->mutable_agents()->set_type(ACL::Entity::NONE); master::Flags flags = CreateMasterFlags(); flags.acls = acls; @@ -2405,7 +2405,7 @@ TEST_F(MasterAuthorizationTest, UnauthorizedToReregisterAgent) ACLs acls; mesos::ACL::RegisterAgent* acl = acls.add_register_agents(); acl->mutable_principals()->add_values(DEFAULT_CREDENTIAL.principal()); - acl->mutable_agent()->set_type(ACL::Entity::ANY); + acl->mutable_agents()->set_type(ACL::Entity::ANY); master::Flags flags = CreateMasterFlags(); flags.acls = acls; @@ -2428,7 +2428,7 @@ TEST_F(MasterAuthorizationTest, UnauthorizedToReregisterAgent) master->reset(); // The new master doesn't allow this agent principal to re-register. - acl->mutable_agent()->set_type(ACL::Entity::NONE); + acl->mutable_agents()->set_type(ACL::Entity::NONE); flags.acls = acls; Future<Message> shutdownMessage = http://git-wip-us.apache.org/repos/asf/mesos/blob/d225d4d4/src/tests/script.cpp ---------------------------------------------------------------------- diff --git a/src/tests/script.cpp b/src/tests/script.cpp index 791d331..8d40e01 100644 --- a/src/tests/script.cpp +++ b/src/tests/script.cpp @@ -164,7 +164,7 @@ void execute(const string& script) // TODO(xujyan): Enable agent authN and authZ by default in example tests. mesos::ACL::RegisterAgent* registerAgent = acls.add_register_agents(); registerAgent->mutable_principals()->set_type(mesos::ACL::Entity::ANY); - registerAgent->mutable_agent()->set_type(mesos::ACL::Entity::ANY); + registerAgent->mutable_agents()->set_type(mesos::ACL::Entity::ANY); const string& aclsPath = path::join(directory.get(), "acls");