Skip to content

Expose proxy settings for GCS repositories #85785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/85785.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 85785
summary: Expose proxy settings for GCS repositories
area: Snapshot/Restore
type: bug
issues:
- 84569
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public List<Setting<?>> getSettings() {
GoogleCloudStorageClientSettings.CONNECT_TIMEOUT_SETTING,
GoogleCloudStorageClientSettings.READ_TIMEOUT_SETTING,
GoogleCloudStorageClientSettings.APPLICATION_NAME_SETTING,
GoogleCloudStorageClientSettings.TOKEN_URI_SETTING
GoogleCloudStorageClientSettings.TOKEN_URI_SETTING,
GoogleCloudStorageClientSettings.PROXY_TYPE_SETTING,
GoogleCloudStorageClientSettings.PROXY_HOST_SETTING,
GoogleCloudStorageClientSettings.PROXY_PORT_SETTING
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.repositories.gcs;

import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase;
import org.junit.Assert;

import java.util.List;

public class GoogleCloudStoragePluginTests extends ESTestCase {

public void testExposedSettings() {
List<Setting<?>> settings = new GoogleCloudStoragePlugin(Settings.EMPTY).getSettings();

Assert.assertEquals(
List.of(
"gcs.client.*.credentials_file",
"gcs.client.*.endpoint",
"gcs.client.*.project_id",
"gcs.client.*.connect_timeout",
"gcs.client.*.read_timeout",
"gcs.client.*.application_name",
"gcs.client.*.token_uri",
"gcs.client.*.proxy.type",
"gcs.client.*.proxy.host",
"gcs.client.*.proxy.port"
),
settings.stream().map(Setting::getKey).toList()
);
}
}