From fa78e3273688c776c0b5f84468d7910232e26f40 Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Tue, 20 Nov 2018 12:27:37 +0000 Subject: Rename `allowed-peers` to `authorized-peers` --- .../transport_options_reading_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vespalib/src/tests/net/tls/transport_options/transport_options_reading_test.cpp') diff --git a/vespalib/src/tests/net/tls/transport_options/transport_options_reading_test.cpp b/vespalib/src/tests/net/tls/transport_options/transport_options_reading_test.cpp index 380bb0a3d71..1a442dc54f0 100644 --- a/vespalib/src/tests/net/tls/transport_options/transport_options_reading_test.cpp +++ b/vespalib/src/tests/net/tls/transport_options/transport_options_reading_test.cpp @@ -66,7 +66,7 @@ vespalib::string json_with_policies(const vespalib::string& policies) { const char* fmt = R"({"files":{"private-key":"dummy_privkey.txt", "certificates":"dummy_certs.txt", "ca-certificates":"dummy_ca_certs.txt"}, - "allowed-peers":[%s]})"; + "authorized-peers":[%s]})"; return vespalib::make_string(fmt, policies.c_str()); } @@ -74,18 +74,18 @@ TransportSecurityOptions parse_policies(const vespalib::string& policies) { return *read_options_from_json_string(json_with_policies(policies)); } -TEST("config file without allowed-peers accepts all pre-verified certificates") { +TEST("config file without authorized-peers accepts all pre-verified certificates") { const char* json = R"({"files":{"private-key":"dummy_privkey.txt", "certificates":"dummy_certs.txt", "ca-certificates":"dummy_ca_certs.txt"}})"; - EXPECT_TRUE(read_options_from_json_string(json)->allowed_peers().allows_all_authenticated()); + EXPECT_TRUE(read_options_from_json_string(json)->authorized_peers().allows_all_authenticated()); } // Instead of contemplating what the semantics of an empty allow list should be, // we do the easy way out and just say it's not allowed in the first place. TEST("empty policy array throws exception") { EXPECT_EXCEPTION(parse_policies(""), vespalib::IllegalArgumentException, - "\"allowed-peers\" must either be not present (allows " + "\"authorized-peers\" must either be not present (allows " "all peers with valid certificates) or a non-empty array"); } @@ -95,8 +95,8 @@ TEST("can parse single peer policy with single requirement") { {"field": "SAN_DNS", "must-match": "hello.world"} ] })"; - EXPECT_EQUAL(allowed_peers({policy_with({required_san_dns("hello.world")})}), - parse_policies(json).allowed_peers()); + EXPECT_EQUAL(authorized_peers({policy_with({required_san_dns("hello.world")})}), + parse_policies(json).authorized_peers()); } TEST("can parse single peer policy with multiple requirements") { @@ -106,9 +106,9 @@ TEST("can parse single peer policy with multiple requirements") { {"field": "CN", "must-match": "goodbye.moon"} ] })"; - EXPECT_EQUAL(allowed_peers({policy_with({required_san_dns("hello.world"), - required_cn("goodbye.moon")})}), - parse_policies(json).allowed_peers()); + EXPECT_EQUAL(authorized_peers({policy_with({required_san_dns("hello.world"), + required_cn("goodbye.moon")})}), + parse_policies(json).authorized_peers()); } TEST("unknown field type throws exception") { -- cgit v1.2.3