|
16 | 16 |
|
17 | 17 | import java.net.UnknownHostException;
|
18 | 18 | import java.util.ArrayList;
|
19 |
| -import java.util.Arrays; |
20 | 19 | import java.util.List;
|
21 | 20 |
|
22 | 21 | import static java.util.Collections.emptyList;
|
@@ -112,35 +111,12 @@ public void testUnwhitelistedRemote() {
|
112 | 111 | assertEquals("[not in list:" + port + "] not whitelisted in reindex.remote.whitelist", e.getMessage());
|
113 | 112 | }
|
114 | 113 |
|
115 |
| - public void testRejectMatchAll() { |
116 |
| - assertMatchesTooMuch(singletonList("*")); |
117 |
| - assertMatchesTooMuch(singletonList("**")); |
118 |
| - assertMatchesTooMuch(singletonList("***")); |
119 |
| - assertMatchesTooMuch(Arrays.asList("realstuff", "*")); |
120 |
| - assertMatchesTooMuch(Arrays.asList("*", "realstuff")); |
121 |
| - List<String> random = randomWhitelist(); |
122 |
| - random.add("*"); |
123 |
| - assertMatchesTooMuch(random); |
124 |
| - } |
125 |
| - |
126 | 114 | public void testIPv6Address() {
|
127 | 115 | List<String> whitelist = randomWhitelist();
|
128 | 116 | whitelist.add("[::1]:*");
|
129 | 117 | checkRemoteWhitelist(buildRemoteWhitelist(whitelist), newRemoteInfo("[::1]", 9200));
|
130 | 118 | }
|
131 | 119 |
|
132 |
| - private void assertMatchesTooMuch(List<String> whitelist) { |
133 |
| - Exception e = expectThrows(IllegalArgumentException.class, () -> buildRemoteWhitelist(whitelist)); |
134 |
| - assertEquals( |
135 |
| - "Refusing to start because whitelist " |
136 |
| - + whitelist |
137 |
| - + " accepts all addresses. " |
138 |
| - + "This would allow users to reindex-from-remote any URL they like effectively having Elasticsearch make HTTP GETs " |
139 |
| - + "for them.", |
140 |
| - e.getMessage() |
141 |
| - ); |
142 |
| - } |
143 |
| - |
144 | 120 | private List<String> randomWhitelist() {
|
145 | 121 | int size = between(1, 100);
|
146 | 122 | List<String> whitelist = new ArrayList<>(size);
|
|
0 commit comments