27
27
import software .amazon .awssdk .identity .spi .IdentityProvider ;
28
28
import software .amazon .awssdk .identity .spi .IdentityProviders ;
29
29
import software .amazon .awssdk .identity .spi .TokenIdentity ;
30
- import software .amazon .awssdk .protocols .json .internal .unmarshall .SdkClientJsonProtocolAdvancedOption ;
31
30
import software .amazon .awssdk .regions .ServiceMetadataAdvancedOption ;
32
31
import software .amazon .awssdk .retries .api .RetryStrategy ;
33
32
import software .amazon .awssdk .services .json .auth .scheme .JsonAuthSchemeProvider ;
@@ -60,13 +59,13 @@ protected final String serviceName() {
60
59
@ Override
61
60
protected final SdkClientConfiguration mergeServiceDefaults (SdkClientConfiguration config ) {
62
61
return config .merge (c -> c
63
- .option (SdkClientOption .ENDPOINT_PROVIDER , defaultEndpointProvider ())
64
- .option (SdkClientOption .AUTH_SCHEME_PROVIDER , defaultAuthSchemeProvider ())
65
- .option (SdkClientOption .AUTH_SCHEMES , authSchemes ())
66
- .option (SdkClientOption .CRC32_FROM_COMPRESSED_DATA_ENABLED , false )
67
- .lazyOption (AwsClientOption .TOKEN_PROVIDER ,
62
+ .option (SdkClientOption .ENDPOINT_PROVIDER , defaultEndpointProvider ())
63
+ .option (SdkClientOption .AUTH_SCHEME_PROVIDER , defaultAuthSchemeProvider ())
64
+ .option (SdkClientOption .AUTH_SCHEMES , authSchemes ())
65
+ .option (SdkClientOption .CRC32_FROM_COMPRESSED_DATA_ENABLED , false )
66
+ .lazyOption (AwsClientOption .TOKEN_PROVIDER ,
68
67
p -> TokenUtils .toSdkTokenProvider (p .get (AwsClientOption .TOKEN_IDENTITY_PROVIDER )))
69
- .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER , defaultTokenProvider ()));
68
+ .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER , defaultTokenProvider ()));
70
69
}
71
70
72
71
@ Override
@@ -77,7 +76,7 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
77
76
endpointInterceptors .add (new JsonRequestSetEndpointInterceptor ());
78
77
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory ();
79
78
List <ExecutionInterceptor > interceptors = interceptorFactory
80
- .getInterceptors ("software/amazon/awssdk/services/json/execution.interceptors" );
79
+ .getInterceptors ("software/amazon/awssdk/services/json/execution.interceptors" );
81
80
List <ExecutionInterceptor > additionalInterceptors = new ArrayList <>();
82
81
interceptors = CollectionUtils .mergeLists (endpointInterceptors , interceptors );
83
82
interceptors = CollectionUtils .mergeLists (interceptors , additionalInterceptors );
@@ -93,22 +92,21 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
93
92
});
94
93
builder .option (SdkClientOption .EXECUTION_INTERCEPTORS , interceptors );
95
94
builder .lazyOptionIfAbsent (
96
- SdkClientOption .CLIENT_ENDPOINT_PROVIDER ,
97
- c -> AwsClientEndpointProvider
98
- .builder ()
99
- .serviceEndpointOverrideEnvironmentVariable ("AWS_ENDPOINT_URL_JSON_SERVICE" )
100
- .serviceEndpointOverrideSystemProperty ("aws.endpointUrlJson" )
101
- .serviceProfileProperty ("json_service" )
102
- .serviceEndpointPrefix (serviceEndpointPrefix ())
103
- .defaultProtocol ("https" )
104
- .region (c .get (AwsClientOption .AWS_REGION ))
105
- .profileFile (c .get (SdkClientOption .PROFILE_FILE_SUPPLIER ))
106
- .profileName (c .get (SdkClientOption .PROFILE_NAME ))
107
- .putAdvancedOption (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ,
108
- c .get (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ))
109
- .dualstackEnabled (c .get (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ))
110
- .fipsEnabled (c .get (AwsClientOption .FIPS_ENDPOINT_ENABLED )).build ());
111
- builder .option (SdkClientJsonProtocolAdvancedOption .ENABLE_FAST_UNMARSHALLER , true );
95
+ SdkClientOption .CLIENT_ENDPOINT_PROVIDER ,
96
+ c -> AwsClientEndpointProvider
97
+ .builder ()
98
+ .serviceEndpointOverrideEnvironmentVariable ("AWS_ENDPOINT_URL_JSON_SERVICE" )
99
+ .serviceEndpointOverrideSystemProperty ("aws.endpointUrlJson" )
100
+ .serviceProfileProperty ("json_service" )
101
+ .serviceEndpointPrefix (serviceEndpointPrefix ())
102
+ .defaultProtocol ("https" )
103
+ .region (c .get (AwsClientOption .AWS_REGION ))
104
+ .profileFile (c .get (SdkClientOption .PROFILE_FILE_SUPPLIER ))
105
+ .profileName (c .get (SdkClientOption .PROFILE_NAME ))
106
+ .putAdvancedOption (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ,
107
+ c .get (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ))
108
+ .dualstackEnabled (c .get (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ))
109
+ .fipsEnabled (c .get (AwsClientOption .FIPS_ENDPOINT_ENABLED )).build ());
112
110
return builder .build ();
113
111
}
114
112
@@ -196,6 +194,6 @@ private List<SdkPlugin> internalPlugins(SdkClientConfiguration config) {
196
194
197
195
protected static void validateClientOptions (SdkClientConfiguration c ) {
198
196
Validate .notNull (c .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER ),
199
- "The 'tokenProvider' must be configured in the client builder." );
197
+ "The 'tokenProvider' must be configured in the client builder." );
200
198
}
201
199
}
0 commit comments