@@ -143,7 +143,7 @@ final class S3ClientSettings {
143143 static final Setting .AffixSetting <Boolean > USE_THROTTLE_RETRIES_SETTING = Setting .affixKeySetting (
144144 PREFIX ,
145145 "use_throttle_retries" ,
146- key -> Setting .boolSetting (key , Defaults .THROTTLE_RETRIES , Property .NodeScope )
146+ key -> Setting .boolSetting (key , Defaults .THROTTLE_RETRIES , Property .NodeScope , Property . Deprecated )
147147 );
148148
149149 /** Whether the s3 client should use path style access. */
@@ -157,7 +157,7 @@ final class S3ClientSettings {
157157 static final Setting .AffixSetting <Boolean > DISABLE_CHUNKED_ENCODING = Setting .affixKeySetting (
158158 PREFIX ,
159159 "disable_chunked_encoding" ,
160- key -> Setting .boolSetting (key , false , Property .NodeScope )
160+ key -> Setting .boolSetting (key , false , Property .NodeScope , Property . Deprecated )
161161 );
162162
163163 /** An override for the s3 region to use for signing requests. */
@@ -167,11 +167,26 @@ final class S3ClientSettings {
167167 key -> Setting .simpleString (key , Property .NodeScope )
168168 );
169169
170+ public enum AwsSignerOverrideType {
171+ // AWS SDK V1 Signer types.
172+ // Supported for upgrade compatibility, ultimately converted to a V2 equivalent.
173+ // Note: AWS4UnsignedPayloadSignerType is no longer supported, there is no equivalent in V2 short of a custom signer.
174+ // Note: QueryStringSigner is deprecated in V2, thus not given support.
175+ AWS4SignerType , // -> Aws4Signer
176+ AWS3SignerType , // -> AwsS3V4Signer
177+ NoOpSignerType , // -> NoOpSigner
178+
179+ // AWS SDK V2 Signer types
180+ Aws4Signer ,
181+ AwsS3V4Signer ,
182+ NoOpSigner ;
183+ };
184+
170185 /** An override for the signer to use. */
171- static final Setting .AffixSetting <String > SIGNER_OVERRIDE = Setting .affixKeySetting (
186+ static final Setting .AffixSetting <AwsSignerOverrideType > SIGNER_OVERRIDE = Setting .affixKeySetting (
172187 PREFIX ,
173188 "signer_override" ,
174- key -> Setting .simpleString ( key , Property .NodeScope )
189+ key -> Setting .enumSetting ( AwsSignerOverrideType . class , key , AwsSignerOverrideType . Aws4Signer , Property .NodeScope )
175190 );
176191
177192 /** Credentials to authenticate with s3. */
@@ -207,19 +222,19 @@ final class S3ClientSettings {
207222 final int maxRetries ;
208223
209224 /** Whether the s3 client should use an exponential backoff retry policy. */
210- final boolean throttleRetries ;
225+ final boolean throttleRetries ; // TODO: remove, no longer supported in v2
211226
212227 /** Whether the s3 client should use path style access. */
213228 final boolean pathStyleAccess ;
214229
215230 /** Whether chunked encoding should be disabled or not. */
216- final boolean disableChunkedEncoding ;
231+ final boolean disableChunkedEncoding ; // TODO: deprecated in V2, remove. Encoding can be disabled by setting an HTTP endpoint, I think?
217232
218233 /** Region to use for signing requests or empty string to use default. */
219234 final String region ;
220235
221236 /** Signer override to use or empty string to use default. */
222- final String signerOverride ;
237+ final AwsSignerOverrideType signerOverride ; // TODO: document somewhat breaking change
223238
224239 private S3ClientSettings (
225240 AwsCredentials credentials ,
@@ -236,7 +251,7 @@ private S3ClientSettings(
236251 boolean pathStyleAccess ,
237252 boolean disableChunkedEncoding ,
238253 String region ,
239- String signerOverride
254+ AwsSignerOverrideType signerOverride
240255 ) {
241256 this .credentials = credentials ;
242257 this .endpoint = endpoint ;
@@ -291,7 +306,7 @@ S3ClientSettings refine(Settings repositorySettings) {
291306 newCredentials = credentials ;
292307 }
293308 final String newRegion = getRepoSettingOrDefault (REGION , normalizedSettings , region );
294- final String newSignerOverride = getRepoSettingOrDefault (SIGNER_OVERRIDE , normalizedSettings , signerOverride );
309+ final AwsSignerOverrideType newSignerOverride = getRepoSettingOrDefault (SIGNER_OVERRIDE , normalizedSettings , signerOverride );
295310 if (Objects .equals (endpoint , newEndpoint )
296311 && Objects .equals (proxyHost , newProxyHost )
297312 && proxyPort == newProxyPort
0 commit comments