|
| 1 | +/* |
| 2 | + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 3 | + * or more contributor license agreements. Licensed under the "Elastic License |
| 4 | + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side |
| 5 | + * Public License v 1"; you may not use this file except in compliance with, at |
| 6 | + * your election, the "Elastic License 2.0", the "GNU Affero General Public |
| 7 | + * License v3.0 only", or the "Server Side Public License, v 1". |
| 8 | + */ |
| 9 | + |
| 10 | +package org.elasticsearch.repositories.s3; |
| 11 | + |
| 12 | +import org.elasticsearch.common.settings.Setting; |
| 13 | + |
| 14 | +import java.util.ArrayList; |
| 15 | +import java.util.List; |
| 16 | + |
| 17 | +final class S3RepositorySettings { |
| 18 | + |
| 19 | + static final List<Setting<?>> SETTINGS = List.of( |
| 20 | + // named s3 client configuration settings |
| 21 | + S3ClientSettings.ACCESS_KEY_SETTING, |
| 22 | + S3ClientSettings.SECRET_KEY_SETTING, |
| 23 | + S3ClientSettings.SESSION_TOKEN_SETTING, |
| 24 | + S3ClientSettings.ENDPOINT_SETTING, |
| 25 | + S3ClientSettings.PROTOCOL_SETTING, |
| 26 | + S3ClientSettings.PROXY_HOST_SETTING, |
| 27 | + S3ClientSettings.PROXY_PORT_SETTING, |
| 28 | + S3ClientSettings.PROXY_SCHEME_SETTING, |
| 29 | + S3ClientSettings.PROXY_USERNAME_SETTING, |
| 30 | + S3ClientSettings.PROXY_PASSWORD_SETTING, |
| 31 | + S3ClientSettings.READ_TIMEOUT_SETTING, |
| 32 | + S3ClientSettings.MAX_CONNECTIONS_SETTING, |
| 33 | + S3ClientSettings.MAX_RETRIES_SETTING, |
| 34 | + S3ClientSettings.API_CALL_TIMEOUT_SETTING, |
| 35 | + S3ClientSettings.UNUSED_USE_THROTTLE_RETRIES_SETTING, |
| 36 | + S3ClientSettings.USE_PATH_STYLE_ACCESS, |
| 37 | + S3ClientSettings.DISABLE_CHUNKED_ENCODING, |
| 38 | + S3ClientSettings.UNUSED_SIGNER_OVERRIDE, |
| 39 | + S3ClientSettings.ADD_PURPOSE_CUSTOM_QUERY_PARAMETER, |
| 40 | + S3ClientSettings.REGION, |
| 41 | + S3ClientSettings.CONNECTION_MAX_IDLE_TIME_SETTING, |
| 42 | + S3ClientSettings.MAX_COPY_SIZE_BEFORE_MULTIPART, |
| 43 | + S3Service.REPOSITORY_S3_CAS_TTL_SETTING, |
| 44 | + S3Service.REPOSITORY_S3_CAS_ANTI_CONTENTION_DELAY_SETTING, |
| 45 | + S3Repository.ACCESS_KEY_SETTING, |
| 46 | + S3Repository.SECRET_KEY_SETTING, |
| 47 | + S3ClientSettings.S3_TENACIOUS_RETRIES_ENABLED_SETTING, |
| 48 | + S3ClientSettings.ALWAYS_SIGN_REQUESTS |
| 49 | + ); |
| 50 | + |
| 51 | + static final List<Setting.AffixSetting<?>> DEPRECATED_CLIENT_SETTINGS = deprecatedClientSettings(); |
| 52 | + |
| 53 | + private S3RepositorySettings() {} |
| 54 | + |
| 55 | + private static List<Setting.AffixSetting<?>> deprecatedClientSettings() { |
| 56 | + final List<Setting.AffixSetting<?>> deprecatedClientSettings = new ArrayList<>(); |
| 57 | + for (Setting<?> setting : SETTINGS) { |
| 58 | + if (setting instanceof Setting.AffixSetting<?> affixSetting && setting.getProperties().contains(Setting.Property.Deprecated)) { |
| 59 | + deprecatedClientSettings.add(affixSetting); |
| 60 | + } |
| 61 | + } |
| 62 | + return List.copyOf(deprecatedClientSettings); |
| 63 | + } |
| 64 | +} |
0 commit comments