Skip to content

Commit 6fd4f2d

Browse files
committed
Expose proxy settings for GCS repositories
They were added in elastic#82737, but not exposed via the GCSPlugin to end users.
1 parent dfb39f5 commit 6fd4f2d

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

modules/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStoragePlugin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ public List<Setting<?>> getSettings() {
7171
GoogleCloudStorageClientSettings.CONNECT_TIMEOUT_SETTING,
7272
GoogleCloudStorageClientSettings.READ_TIMEOUT_SETTING,
7373
GoogleCloudStorageClientSettings.APPLICATION_NAME_SETTING,
74-
GoogleCloudStorageClientSettings.TOKEN_URI_SETTING
74+
GoogleCloudStorageClientSettings.TOKEN_URI_SETTING,
75+
GoogleCloudStorageClientSettings.PROXY_TYPE_SETTING,
76+
GoogleCloudStorageClientSettings.PROXY_HOST_SETTING,
77+
GoogleCloudStorageClientSettings.PROXY_PORT_SETTING
7578
);
7679
}
7780

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.elasticsearch.repositories.gcs;
2+
3+
import org.elasticsearch.common.settings.Setting;
4+
import org.elasticsearch.common.settings.Settings;
5+
import org.elasticsearch.test.ESTestCase;
6+
import org.junit.Assert;
7+
8+
import java.util.List;
9+
import java.util.stream.Collectors;
10+
11+
public class GoogleCloudStoragePluginTest extends ESTestCase {
12+
13+
public void testGetSettings() {
14+
List<Setting<?>> settings = new GoogleCloudStoragePlugin(Settings.EMPTY).getSettings();
15+
16+
Assert.assertEquals(
17+
List.of(
18+
"gcs.client.*.credentials_file",
19+
"gcs.client.*.endpoint",
20+
"gcs.client.*.project_id",
21+
"gcs.client.*.connect_timeout",
22+
"gcs.client.*.read_timeout",
23+
"gcs.client.*.application_name",
24+
"gcs.client.*.token_uri",
25+
"gcs.client.*.proxy.type",
26+
"gcs.client.*.proxy.host",
27+
"gcs.client.*.proxy.port"
28+
),
29+
settings.stream().map(Setting::getKey).collect(Collectors.toList())
30+
);
31+
}
32+
}

0 commit comments

Comments
 (0)