AWS SDK
rev. b6dc1d298ba698070286e6838abdd213fcbce093 (ignoring whitespace)
Files changed:
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StarlingDoveService");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("Config Service", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("Config Service", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1305,1305 +1364,1365 @@
1305 1305 | #[derive(::std::fmt::Debug)]
|
1306 1306 | pub(crate) struct ServiceRuntimePlugin {
|
1307 1307 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1308 1308 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1309 1309 | }
|
1310 1310 |
|
1311 1311 | impl ServiceRuntimePlugin {
|
1312 1312 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1313 1313 | let config = {
|
1314 1314 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DynamoDB_20120810");
|
1315 1315 | cfg.store_put(crate::idempotency_token::default_provider());
|
1316 1316 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1317 1317 | ::std::option::Option::Some(cfg.freeze())
|
1318 1318 | };
|
1319 1319 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1320 1320 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1321 1321 | use crate::config::auth::ResolveAuthScheme;
|
1322 1322 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1323 1323 | }));
|
1324 1324 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1325 1325 | use crate::config::endpoint::ResolveEndpoint;
|
1326 1326 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1327 1327 | }));
|
1328 1328 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1329 1329 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1330 1330 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1331 1331 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1332 1332 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1333 1333 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1334 1334 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1335 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1335 1336 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1336 1337 | runtime_components.push_interceptor(crate::account_id_endpoint::AccountIdEndpointFeatureTrackerInterceptor);
|
1337 1338 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1338 1339 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1339 1340 | ));
|
1340 1341 | Self { config, runtime_components }
|
1341 1342 | }
|
1342 1343 | }
|
1343 1344 |
|
1344 1345 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1345 1346 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1346 1347 | self.config.clone()
|
1347 1348 | }
|
1348 1349 |
|
1349 1350 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1350 1351 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1351 1352 | }
|
1352 1353 |
|
1353 1354 | fn runtime_components(
|
1354 1355 | &self,
|
1355 1356 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1356 1357 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1357 1358 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1358 1359 | }
|
1359 1360 | }
|
1360 1361 |
|
1361 1362 | // Cross-operation shared-state singletons
|
1362 1363 |
|
1363 1364 | /// A plugin that enables configuration for a single operation invocation
|
1364 1365 | ///
|
@@ -1396,1397 +1455,1468 @@
1396 1397 | .freeze(),
|
1397 1398 | components,
|
1398 1399 | }
|
1399 1400 | }
|
1400 1401 | }
|
1401 1402 |
|
1402 1403 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1403 1404 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1404 1405 | Some(self.config.clone())
|
1405 1406 | }
|
1406 1407 |
|
1407 1408 | fn runtime_components(
|
1408 1409 | &self,
|
1409 1410 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1410 1411 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1411 1412 | ::std::borrow::Cow::Borrowed(&self.components)
|
1412 1413 | }
|
1413 1414 | }
|
1414 1415 |
|
1415 1416 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1416 1417 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1417 1418 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1418 1419 |
|
1419 1420 | pub use ::aws_credential_types::Credentials;
|
1420 1421 |
|
1421 1422 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1422 1423 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1423 1424 | let mut builder = Builder::default();
|
1424 1425 | builder.set_credentials_provider(input.credentials_provider());
|
1425 1426 | builder = builder.region(input.region().cloned());
|
1427 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1428 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1429 + | let has_service_specific_endpoint = input
|
1430 + | .service_config()
|
1431 + | .and_then(|conf| conf.load_config(service_config_key("DynamoDB", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1432 + | .is_some();
|
1433 + |
|
1434 + | if has_global_endpoint || has_service_specific_endpoint {
|
1435 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1436 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1437 + | ));
|
1438 + | }
|
1426 1439 | builder.set_use_fips(input.use_fips());
|
1427 1440 | builder.set_use_dual_stack(input.use_dual_stack());
|
1428 1441 | if input.get_origin("endpoint_url").is_client_config() {
|
1429 1442 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1430 1443 | } else {
|
1431 1444 | builder.set_endpoint_url(
|
1432 1445 | input
|
1433 1446 | .service_config()
|
1434 1447 | .and_then(|conf| {
|
1435 1448 | conf.load_config(service_config_key("DynamoDB", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1436 1449 | .map(|it| it.parse().unwrap())
|
1437 1450 | })
|
1438 1451 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1439 1452 | );
|
1440 1453 | }
|
1441 1454 | builder.set_account_id_endpoint_mode(input.account_id_endpoint_mode().cloned());
|
1442 1455 | // resiliency
|
1443 1456 | builder.set_retry_config(input.retry_config().cloned());
|
1444 1457 | builder.set_timeout_config(input.timeout_config().cloned());
|
1445 1458 | builder.set_sleep_impl(input.sleep_impl());
|
1446 1459 |
|
1447 1460 | builder.set_http_client(input.http_client());
|
1448 1461 | builder.set_time_source(input.time_source());
|
1449 1462 | builder.set_behavior_version(input.behavior_version());
|
1450 1463 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1451 1464 | // setting `None` here removes the default
|
1452 1465 | if let Some(config) = input.stalled_stream_protection() {
|
1453 1466 | builder.set_stalled_stream_protection(Some(config));
|
1454 1467 | }
|
1455 1468 |
|
@@ -1291,1291 +1350,1351 @@
1291 1291 | #[derive(::std::fmt::Debug)]
|
1292 1292 | pub(crate) struct ServiceRuntimePlugin {
|
1293 1293 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1294 1294 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1295 1295 | }
|
1296 1296 |
|
1297 1297 | impl ServiceRuntimePlugin {
|
1298 1298 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1299 1299 | let config = {
|
1300 1300 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AmazonEC2");
|
1301 1301 | cfg.store_put(crate::idempotency_token::default_provider());
|
1302 1302 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1303 1303 | ::std::option::Option::Some(cfg.freeze())
|
1304 1304 | };
|
1305 1305 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1306 1306 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1307 1307 | use crate::config::auth::ResolveAuthScheme;
|
1308 1308 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1309 1309 | }));
|
1310 1310 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1311 1311 | use crate::config::endpoint::ResolveEndpoint;
|
1312 1312 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1313 1313 | }));
|
1314 1314 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1315 1315 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1316 1316 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1317 1317 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1318 1318 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1319 1319 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1320 1320 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1321 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1321 1322 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1322 1323 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1323 1324 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1324 1325 | ));
|
1325 1326 | Self { config, runtime_components }
|
1326 1327 | }
|
1327 1328 | }
|
1328 1329 |
|
1329 1330 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1330 1331 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1331 1332 | self.config.clone()
|
1332 1333 | }
|
1333 1334 |
|
1334 1335 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1335 1336 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1336 1337 | }
|
1337 1338 |
|
1338 1339 | fn runtime_components(
|
1339 1340 | &self,
|
1340 1341 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1341 1342 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1342 1343 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1343 1344 | }
|
1344 1345 | }
|
1345 1346 |
|
1346 1347 | // Cross-operation shared-state singletons
|
1347 1348 |
|
1348 1349 | /// A plugin that enables configuration for a single operation invocation
|
1349 1350 | ///
|
1350 1351 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1381,1382 +1440,1453 @@
1381 1382 | .freeze(),
|
1382 1383 | components,
|
1383 1384 | }
|
1384 1385 | }
|
1385 1386 | }
|
1386 1387 |
|
1387 1388 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1388 1389 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1389 1390 | Some(self.config.clone())
|
1390 1391 | }
|
1391 1392 |
|
1392 1393 | fn runtime_components(
|
1393 1394 | &self,
|
1394 1395 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1395 1396 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1396 1397 | ::std::borrow::Cow::Borrowed(&self.components)
|
1397 1398 | }
|
1398 1399 | }
|
1399 1400 |
|
1400 1401 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1401 1402 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1402 1403 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1403 1404 |
|
1404 1405 | pub use ::aws_credential_types::Credentials;
|
1405 1406 |
|
1406 1407 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1407 1408 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1408 1409 | let mut builder = Builder::default();
|
1409 1410 | builder.set_credentials_provider(input.credentials_provider());
|
1410 1411 | builder = builder.region(input.region().cloned());
|
1412 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1413 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1414 + | let has_service_specific_endpoint = input
|
1415 + | .service_config()
|
1416 + | .and_then(|conf| conf.load_config(service_config_key("EC2", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1417 + | .is_some();
|
1418 + |
|
1419 + | if has_global_endpoint || has_service_specific_endpoint {
|
1420 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1421 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1422 + | ));
|
1423 + | }
|
1411 1424 | builder.set_use_fips(input.use_fips());
|
1412 1425 | builder.set_use_dual_stack(input.use_dual_stack());
|
1413 1426 | if input.get_origin("endpoint_url").is_client_config() {
|
1414 1427 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1415 1428 | } else {
|
1416 1429 | builder.set_endpoint_url(
|
1417 1430 | input
|
1418 1431 | .service_config()
|
1419 1432 | .and_then(|conf| {
|
1420 1433 | conf.load_config(service_config_key("EC2", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1421 1434 | .map(|it| it.parse().unwrap())
|
1422 1435 | })
|
1423 1436 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1424 1437 | );
|
1425 1438 | }
|
1426 1439 | // resiliency
|
1427 1440 | builder.set_retry_config(input.retry_config().cloned());
|
1428 1441 | builder.set_timeout_config(input.timeout_config().cloned());
|
1429 1442 | builder.set_sleep_impl(input.sleep_impl());
|
1430 1443 |
|
1431 1444 | builder.set_http_client(input.http_client());
|
1432 1445 | builder.set_time_source(input.time_source());
|
1433 1446 | builder.set_behavior_version(input.behavior_version());
|
1434 1447 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1435 1448 | // setting `None` here removes the default
|
1436 1449 | if let Some(config) = input.stalled_stream_protection() {
|
1437 1450 | builder.set_stalled_stream_protection(Some(config));
|
1438 1451 | }
|
1439 1452 |
|
1440 1453 | if let Some(cache) = input.identity_cache() {
|
@@ -1291,1291 +1350,1351 @@
1291 1291 | #[derive(::std::fmt::Debug)]
|
1292 1292 | pub(crate) struct ServiceRuntimePlugin {
|
1293 1293 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1294 1294 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1295 1295 | }
|
1296 1296 |
|
1297 1297 | impl ServiceRuntimePlugin {
|
1298 1298 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1299 1299 | let config = {
|
1300 1300 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AmazonEC2ContainerServiceV20141113");
|
1301 1301 | cfg.store_put(crate::idempotency_token::default_provider());
|
1302 1302 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1303 1303 | ::std::option::Option::Some(cfg.freeze())
|
1304 1304 | };
|
1305 1305 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1306 1306 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1307 1307 | use crate::config::auth::ResolveAuthScheme;
|
1308 1308 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1309 1309 | }));
|
1310 1310 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1311 1311 | use crate::config::endpoint::ResolveEndpoint;
|
1312 1312 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1313 1313 | }));
|
1314 1314 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1315 1315 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1316 1316 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1317 1317 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1318 1318 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1319 1319 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1320 1320 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1321 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1321 1322 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1322 1323 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1323 1324 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1324 1325 | ));
|
1325 1326 | Self { config, runtime_components }
|
1326 1327 | }
|
1327 1328 | }
|
1328 1329 |
|
1329 1330 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1330 1331 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1331 1332 | self.config.clone()
|
1332 1333 | }
|
1333 1334 |
|
1334 1335 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1335 1336 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1336 1337 | }
|
1337 1338 |
|
1338 1339 | fn runtime_components(
|
1339 1340 | &self,
|
1340 1341 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1341 1342 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1342 1343 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1343 1344 | }
|
1344 1345 | }
|
1345 1346 |
|
1346 1347 | // Cross-operation shared-state singletons
|
1347 1348 |
|
1348 1349 | /// A plugin that enables configuration for a single operation invocation
|
1349 1350 | ///
|
1350 1351 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1381,1382 +1440,1453 @@
1381 1382 | .freeze(),
|
1382 1383 | components,
|
1383 1384 | }
|
1384 1385 | }
|
1385 1386 | }
|
1386 1387 |
|
1387 1388 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1388 1389 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1389 1390 | Some(self.config.clone())
|
1390 1391 | }
|
1391 1392 |
|
1392 1393 | fn runtime_components(
|
1393 1394 | &self,
|
1394 1395 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1395 1396 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1396 1397 | ::std::borrow::Cow::Borrowed(&self.components)
|
1397 1398 | }
|
1398 1399 | }
|
1399 1400 |
|
1400 1401 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1401 1402 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1402 1403 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1403 1404 |
|
1404 1405 | pub use ::aws_credential_types::Credentials;
|
1405 1406 |
|
1406 1407 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1407 1408 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1408 1409 | let mut builder = Builder::default();
|
1409 1410 | builder.set_credentials_provider(input.credentials_provider());
|
1410 1411 | builder = builder.region(input.region().cloned());
|
1412 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1413 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1414 + | let has_service_specific_endpoint = input
|
1415 + | .service_config()
|
1416 + | .and_then(|conf| conf.load_config(service_config_key("ECS", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1417 + | .is_some();
|
1418 + |
|
1419 + | if has_global_endpoint || has_service_specific_endpoint {
|
1420 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1421 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1422 + | ));
|
1423 + | }
|
1411 1424 | builder.set_use_fips(input.use_fips());
|
1412 1425 | builder.set_use_dual_stack(input.use_dual_stack());
|
1413 1426 | if input.get_origin("endpoint_url").is_client_config() {
|
1414 1427 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1415 1428 | } else {
|
1416 1429 | builder.set_endpoint_url(
|
1417 1430 | input
|
1418 1431 | .service_config()
|
1419 1432 | .and_then(|conf| {
|
1420 1433 | conf.load_config(service_config_key("ECS", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1421 1434 | .map(|it| it.parse().unwrap())
|
1422 1435 | })
|
1423 1436 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1424 1437 | );
|
1425 1438 | }
|
1426 1439 | // resiliency
|
1427 1440 | builder.set_retry_config(input.retry_config().cloned());
|
1428 1441 | builder.set_timeout_config(input.timeout_config().cloned());
|
1429 1442 | builder.set_sleep_impl(input.sleep_impl());
|
1430 1443 |
|
1431 1444 | builder.set_http_client(input.http_client());
|
1432 1445 | builder.set_time_source(input.time_source());
|
1433 1446 | builder.set_behavior_version(input.behavior_version());
|
1434 1447 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1435 1448 | // setting `None` here removes the default
|
1436 1449 | if let Some(config) = input.stalled_stream_protection() {
|
1437 1450 | builder.set_stalled_stream_protection(Some(config));
|
1438 1451 | }
|
1439 1452 |
|
1440 1453 | if let Some(cache) = input.identity_cache() {
|
@@ -1274,1274 +1333,1334 @@
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Glacier");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(crate::glacier_interceptors::GlacierApiVersionInterceptor::new("2012-06-01"));
|
1303 1303 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1304 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1305 1306 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1306 1307 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1307 1308 | ));
|
1308 1309 | Self { config, runtime_components }
|
1309 1310 | }
|
1310 1311 | }
|
1311 1312 |
|
1312 1313 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1313 1314 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1314 1315 | self.config.clone()
|
1315 1316 | }
|
1316 1317 |
|
1317 1318 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1318 1319 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1319 1320 | }
|
1320 1321 |
|
1321 1322 | fn runtime_components(
|
1322 1323 | &self,
|
1323 1324 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1324 1325 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1325 1326 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1326 1327 | }
|
1327 1328 | }
|
1328 1329 |
|
1329 1330 | // Cross-operation shared-state singletons
|
1330 1331 |
|
1331 1332 | /// A plugin that enables configuration for a single operation invocation
|
1332 1333 | ///
|
1333 1334 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1364,1365 +1423,1436 @@
1364 1365 | .freeze(),
|
1365 1366 | components,
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 | }
|
1369 1370 |
|
1370 1371 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1371 1372 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1372 1373 | Some(self.config.clone())
|
1373 1374 | }
|
1374 1375 |
|
1375 1376 | fn runtime_components(
|
1376 1377 | &self,
|
1377 1378 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1378 1379 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1379 1380 | ::std::borrow::Cow::Borrowed(&self.components)
|
1380 1381 | }
|
1381 1382 | }
|
1382 1383 |
|
1383 1384 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1384 1385 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1385 1386 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1386 1387 |
|
1387 1388 | pub use ::aws_credential_types::Credentials;
|
1388 1389 |
|
1389 1390 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1390 1391 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1391 1392 | let mut builder = Builder::default();
|
1392 1393 | builder.set_credentials_provider(input.credentials_provider());
|
1393 1394 | builder = builder.region(input.region().cloned());
|
1395 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1396 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1397 + | let has_service_specific_endpoint = input
|
1398 + | .service_config()
|
1399 + | .and_then(|conf| conf.load_config(service_config_key("Glacier", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1400 + | .is_some();
|
1401 + |
|
1402 + | if has_global_endpoint || has_service_specific_endpoint {
|
1403 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1404 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1405 + | ));
|
1406 + | }
|
1394 1407 | builder.set_use_fips(input.use_fips());
|
1395 1408 | builder.set_use_dual_stack(input.use_dual_stack());
|
1396 1409 | if input.get_origin("endpoint_url").is_client_config() {
|
1397 1410 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1398 1411 | } else {
|
1399 1412 | builder.set_endpoint_url(
|
1400 1413 | input
|
1401 1414 | .service_config()
|
1402 1415 | .and_then(|conf| {
|
1403 1416 | conf.load_config(service_config_key("Glacier", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1404 1417 | .map(|it| it.parse().unwrap())
|
1405 1418 | })
|
1406 1419 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1407 1420 | );
|
1408 1421 | }
|
1409 1422 | // resiliency
|
1410 1423 | builder.set_retry_config(input.retry_config().cloned());
|
1411 1424 | builder.set_timeout_config(input.timeout_config().cloned());
|
1412 1425 | builder.set_sleep_impl(input.sleep_impl());
|
1413 1426 |
|
1414 1427 | builder.set_http_client(input.http_client());
|
1415 1428 | builder.set_time_source(input.time_source());
|
1416 1429 | builder.set_behavior_version(input.behavior_version());
|
1417 1430 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1418 1431 | // setting `None` here removes the default
|
1419 1432 | if let Some(config) = input.stalled_stream_protection() {
|
1420 1433 | builder.set_stalled_stream_protection(Some(config));
|
1421 1434 | }
|
1422 1435 |
|
1423 1436 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSIdentityManagementV20100508");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("IAM", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("IAM", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("TrentService");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("KMS", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("KMS", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSGirApiService");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("Lambda", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("Lambda", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Parrot_v1");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("Polly", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("Polly", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSDnsV20130401");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("Route 53", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("Route 53", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1425,1425 +1484,1485 @@
1425 1425 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1426 1426 | }
|
1427 1427 |
|
1428 1428 | impl ServiceRuntimePlugin {
|
1429 1429 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1430 1430 | let config = {
|
1431 1431 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AmazonS3");
|
1432 1432 | cfg.store_put(crate::idempotency_token::default_provider());
|
1433 1433 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1434 1434 | ::std::option::Option::Some(cfg.freeze())
|
1435 1435 | };
|
1436 1436 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1437 1437 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1438 1438 | use crate::config::auth::ResolveAuthScheme;
|
1439 1439 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1440 1440 | }));
|
1441 1441 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1442 1442 | use crate::config::endpoint::ResolveEndpoint;
|
1443 1443 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1444 1444 | }));
|
1445 1445 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1446 1446 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1447 1447 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1448 1448 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1449 1449 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1450 1450 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1451 1451 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1452 1452 | crate::s3_express::auth::S3ExpressAuthScheme::new(),
|
1453 1453 | ));
|
1454 1454 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1455 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1455 1456 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1456 1457 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1457 1458 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1458 1459 | ));
|
1459 1460 | #[cfg(feature = "sigv4a")]
|
1460 1461 | {
|
1461 1462 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1462 1463 | ::aws_runtime::auth::sigv4a::SigV4aAuthScheme::new(),
|
1463 1464 | ));
|
1464 1465 | }
|
1465 1466 | Self { config, runtime_components }
|
1466 1467 | }
|
1467 1468 | }
|
1468 1469 |
|
1469 1470 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1470 1471 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1471 1472 | self.config.clone()
|
1472 1473 | }
|
1473 1474 |
|
1474 1475 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1475 1476 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1476 1477 | }
|
1477 1478 |
|
1478 1479 | fn runtime_components(
|
1479 1480 | &self,
|
1480 1481 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1481 1482 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1482 1483 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1483 1484 | }
|
1484 1485 | }
|
@@ -1521,1522 +1580,1593 @@
1521 1522 | .freeze(),
|
1522 1523 | components,
|
1523 1524 | }
|
1524 1525 | }
|
1525 1526 | }
|
1526 1527 |
|
1527 1528 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1528 1529 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1529 1530 | Some(self.config.clone())
|
1530 1531 | }
|
1531 1532 |
|
1532 1533 | fn runtime_components(
|
1533 1534 | &self,
|
1534 1535 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1535 1536 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1536 1537 | ::std::borrow::Cow::Borrowed(&self.components)
|
1537 1538 | }
|
1538 1539 | }
|
1539 1540 |
|
1540 1541 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1541 1542 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1542 1543 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1543 1544 |
|
1544 1545 | pub use ::aws_credential_types::Credentials;
|
1545 1546 |
|
1546 1547 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1547 1548 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1548 1549 | let mut builder = Builder::default();
|
1549 1550 | builder.set_credentials_provider(input.credentials_provider());
|
1550 1551 | builder = builder.region(input.region().cloned());
|
1552 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1553 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1554 + | let has_service_specific_endpoint = input
|
1555 + | .service_config()
|
1556 + | .and_then(|conf| conf.load_config(service_config_key("S3", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1557 + | .is_some();
|
1558 + |
|
1559 + | if has_global_endpoint || has_service_specific_endpoint {
|
1560 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1561 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1562 + | ));
|
1563 + | }
|
1551 1564 | builder.set_request_checksum_calculation(input.request_checksum_calculation());
|
1552 1565 | builder.set_response_checksum_validation(input.response_checksum_validation());
|
1553 1566 | builder.set_use_fips(input.use_fips());
|
1554 1567 | builder.set_use_dual_stack(input.use_dual_stack());
|
1555 1568 | if input.get_origin("endpoint_url").is_client_config() {
|
1556 1569 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1557 1570 | } else {
|
1558 1571 | builder.set_endpoint_url(
|
1559 1572 | input
|
1560 1573 | .service_config()
|
1561 1574 | .and_then(|conf| {
|
1562 1575 | conf.load_config(service_config_key("S3", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1563 1576 | .map(|it| it.parse().unwrap())
|
1564 1577 | })
|
1565 1578 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1566 1579 | );
|
1567 1580 | }
|
1568 1581 | // resiliency
|
1569 1582 | builder.set_retry_config(input.retry_config().cloned());
|
1570 1583 | builder.set_timeout_config(input.timeout_config().cloned());
|
1571 1584 | builder.set_sleep_impl(input.sleep_impl());
|
1572 1585 |
|
1573 1586 | builder.set_http_client(input.http_client());
|
1574 1587 | builder.set_time_source(input.time_source());
|
1575 1588 | builder.set_behavior_version(input.behavior_version());
|
1576 1589 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1577 1590 | // setting `None` here removes the default
|
1578 1591 | if let Some(config) = input.stalled_stream_protection() {
|
1579 1592 | builder.set_stalled_stream_protection(Some(config));
|
1580 1593 | }
|
@@ -1,0 +63,0 @@
1 - | /*
|
2 - | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
3 - | * SPDX-License-Identifier: Apache-2.0
|
4 - | */
|
5 - |
|
6 - | use aws_config::Region;
|
7 - | use aws_runtime::{
|
8 - | sdk_feature::AwsSdkFeature, user_agent::test_util::assert_ua_contains_metric_values,
|
9 - | };
|
10 - | use aws_sdk_s3::{
|
11 - | config::{Intercept, IntoShared},
|
12 - | primitives::ByteStream,
|
13 - | Client, Config,
|
14 - | };
|
15 - | use aws_smithy_http_client::test_util::capture_request;
|
16 - |
|
17 - | #[derive(Debug)]
|
18 - | struct TransferManagerFeatureInterceptor;
|
19 - |
|
20 - | impl Intercept for TransferManagerFeatureInterceptor {
|
21 - | fn name(&self) -> &'static str {
|
22 - | "TransferManagerFeature"
|
23 - | }
|
24 - |
|
25 - | fn read_before_execution(
|
26 - | &self,
|
27 - | _ctx: &aws_sdk_s3::config::interceptors::BeforeSerializationInterceptorContextRef<'_>,
|
28 - | cfg: &mut aws_sdk_s3::config::ConfigBag,
|
29 - | ) -> Result<(), aws_sdk_s3::error::BoxError> {
|
30 - | cfg.interceptor_state()
|
31 - | .store_append(AwsSdkFeature::S3Transfer);
|
32 - | Ok(())
|
33 - | }
|
34 - | }
|
35 - |
|
36 - | #[tokio::test]
|
37 - | async fn test_track_metric_for_s3_transfer_manager() {
|
38 - | let (http_client, captured_request) = capture_request(None);
|
39 - | let mut conf_builder = Config::builder()
|
40 - | .region(Region::new("us-east-1"))
|
41 - | .http_client(http_client.clone())
|
42 - | .with_test_defaults();
|
43 - | // The S3 Transfer Manager uses a passed-in S3 client SDK for operations.
|
44 - | // By configuring an interceptor at the client level to track metrics,
|
45 - | // all operations executed by the client will automatically include the metric.
|
46 - | // This eliminates the need to apply `.config_override` on individual operations
|
47 - | // to insert the `TransferManagerFeatureInterceptor`.
|
48 - | conf_builder.push_interceptor(TransferManagerFeatureInterceptor.into_shared());
|
49 - | let client = Client::from_conf(conf_builder.build());
|
50 - |
|
51 - | let _ = client
|
52 - | .put_object()
|
53 - | .bucket("doesnotmatter")
|
54 - | .key("doesnotmatter")
|
55 - | .body(ByteStream::from_static("Hello, world".as_bytes()))
|
56 - | .send()
|
57 - | .await
|
58 - | .unwrap();
|
59 - |
|
60 - | let expected_req = captured_request.expect_request();
|
61 - | let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
|
62 - | assert_ua_contains_metric_values(user_agent, &["G"]);
|
63 - | }
|
@@ -1302,1302 +1361,1362 @@
1302 1302 | #[derive(::std::fmt::Debug)]
|
1303 1303 | pub(crate) struct ServiceRuntimePlugin {
|
1304 1304 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1305 1305 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1306 1306 | }
|
1307 1307 |
|
1308 1308 | impl ServiceRuntimePlugin {
|
1309 1309 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1310 1310 | let config = {
|
1311 1311 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSS3ControlServiceV20180820");
|
1312 1312 | cfg.store_put(crate::idempotency_token::default_provider());
|
1313 1313 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1314 1314 | ::std::option::Option::Some(cfg.freeze())
|
1315 1315 | };
|
1316 1316 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1317 1317 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1318 1318 | use crate::config::auth::ResolveAuthScheme;
|
1319 1319 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1320 1320 | }));
|
1321 1321 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1322 1322 | use crate::config::endpoint::ResolveEndpoint;
|
1323 1323 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1324 1324 | }));
|
1325 1325 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1326 1326 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1327 1327 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1328 1328 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1329 1329 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1330 1330 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1331 1331 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1332 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1332 1333 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1333 1334 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1334 1335 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1335 1336 | ));
|
1336 1337 | Self { config, runtime_components }
|
1337 1338 | }
|
1338 1339 | }
|
1339 1340 |
|
1340 1341 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1341 1342 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1342 1343 | self.config.clone()
|
1343 1344 | }
|
1344 1345 |
|
1345 1346 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1346 1347 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1347 1348 | }
|
1348 1349 |
|
1349 1350 | fn runtime_components(
|
1350 1351 | &self,
|
1351 1352 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1352 1353 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1353 1354 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1354 1355 | }
|
1355 1356 | }
|
1356 1357 |
|
1357 1358 | // Cross-operation shared-state singletons
|
1358 1359 |
|
1359 1360 | /// A plugin that enables configuration for a single operation invocation
|
1360 1361 | ///
|
1361 1362 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1392,1393 +1451,1464 @@
1392 1393 | .freeze(),
|
1393 1394 | components,
|
1394 1395 | }
|
1395 1396 | }
|
1396 1397 | }
|
1397 1398 |
|
1398 1399 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1399 1400 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1400 1401 | Some(self.config.clone())
|
1401 1402 | }
|
1402 1403 |
|
1403 1404 | fn runtime_components(
|
1404 1405 | &self,
|
1405 1406 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1406 1407 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1407 1408 | ::std::borrow::Cow::Borrowed(&self.components)
|
1408 1409 | }
|
1409 1410 | }
|
1410 1411 |
|
1411 1412 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1412 1413 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1413 1414 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1414 1415 |
|
1415 1416 | pub use ::aws_credential_types::Credentials;
|
1416 1417 |
|
1417 1418 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1418 1419 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1419 1420 | let mut builder = Builder::default();
|
1420 1421 | builder.set_credentials_provider(input.credentials_provider());
|
1421 1422 | builder = builder.region(input.region().cloned());
|
1423 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1424 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1425 + | let has_service_specific_endpoint = input
|
1426 + | .service_config()
|
1427 + | .and_then(|conf| conf.load_config(service_config_key("S3 Control", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1428 + | .is_some();
|
1429 + |
|
1430 + | if has_global_endpoint || has_service_specific_endpoint {
|
1431 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1432 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1433 + | ));
|
1434 + | }
|
1422 1435 | builder.set_use_fips(input.use_fips());
|
1423 1436 | builder.set_use_dual_stack(input.use_dual_stack());
|
1424 1437 | if input.get_origin("endpoint_url").is_client_config() {
|
1425 1438 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1426 1439 | } else {
|
1427 1440 | builder.set_endpoint_url(
|
1428 1441 | input
|
1429 1442 | .service_config()
|
1430 1443 | .and_then(|conf| {
|
1431 1444 | conf.load_config(service_config_key("S3 Control", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1432 1445 | .map(|it| it.parse().unwrap())
|
1433 1446 | })
|
1434 1447 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1435 1448 | );
|
1436 1449 | }
|
1437 1450 | // resiliency
|
1438 1451 | builder.set_retry_config(input.retry_config().cloned());
|
1439 1452 | builder.set_timeout_config(input.timeout_config().cloned());
|
1440 1453 | builder.set_sleep_impl(input.sleep_impl());
|
1441 1454 |
|
1442 1455 | builder.set_http_client(input.http_client());
|
1443 1456 | builder.set_time_source(input.time_source());
|
1444 1457 | builder.set_behavior_version(input.behavior_version());
|
1445 1458 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1446 1459 | // setting `None` here removes the default
|
1447 1460 | if let Some(config) = input.stalled_stream_protection() {
|
1448 1461 | builder.set_stalled_stream_protection(Some(config));
|
1449 1462 | }
|
1450 1463 |
|
1451 1464 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Signin");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("Signin", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("Signin", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SWBPortalService");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("SSO", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("SSO", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|
@@ -1273,1273 +1332,1333 @@
1273 1273 | }
|
1274 1274 | #[derive(::std::fmt::Debug)]
|
1275 1275 | pub(crate) struct ServiceRuntimePlugin {
|
1276 1276 | config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
|
1277 1277 | runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1278 1278 | }
|
1279 1279 |
|
1280 1280 | impl ServiceRuntimePlugin {
|
1281 1281 | pub fn new(_service_config: crate::config::Config) -> Self {
|
1282 1282 | let config = {
|
1283 1283 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSSSOOIDCService");
|
1284 1284 | cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
|
1285 1285 | ::std::option::Option::Some(cfg.freeze())
|
1286 1286 | };
|
1287 1287 | let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
|
1288 1288 | runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
|
1289 1289 | use crate::config::auth::ResolveAuthScheme;
|
1290 1290 | crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
|
1291 1291 | }));
|
1292 1292 | runtime_components.set_endpoint_resolver(::std::option::Option::Some({
|
1293 1293 | use crate::config::endpoint::ResolveEndpoint;
|
1294 1294 | crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
|
1295 1295 | }));
|
1296 1296 | runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
|
1297 1297 | runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
|
1298 1298 | runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
|
1299 1299 | runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
|
1300 1300 | runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
|
1301 1301 | runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
|
1302 1302 | runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
|
1303 + | runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
|
1303 1304 | runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
|
1304 1305 | runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
|
1305 1306 | ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
|
1306 1307 | ));
|
1307 1308 | Self { config, runtime_components }
|
1308 1309 | }
|
1309 1310 | }
|
1310 1311 |
|
1311 1312 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
|
1312 1313 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1313 1314 | self.config.clone()
|
1314 1315 | }
|
1315 1316 |
|
1316 1317 | fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
|
1317 1318 | ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
|
1318 1319 | }
|
1319 1320 |
|
1320 1321 | fn runtime_components(
|
1321 1322 | &self,
|
1322 1323 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1323 1324 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1324 1325 | ::std::borrow::Cow::Borrowed(&self.runtime_components)
|
1325 1326 | }
|
1326 1327 | }
|
1327 1328 |
|
1328 1329 | // Cross-operation shared-state singletons
|
1329 1330 |
|
1330 1331 | /// A plugin that enables configuration for a single operation invocation
|
1331 1332 | ///
|
1332 1333 | /// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
|
@@ -1363,1364 +1422,1435 @@
1363 1364 | .freeze(),
|
1364 1365 | components,
|
1365 1366 | }
|
1366 1367 | }
|
1367 1368 | }
|
1368 1369 |
|
1369 1370 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1370 1371 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1371 1372 | Some(self.config.clone())
|
1372 1373 | }
|
1373 1374 |
|
1374 1375 | fn runtime_components(
|
1375 1376 | &self,
|
1376 1377 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1377 1378 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1378 1379 | ::std::borrow::Cow::Borrowed(&self.components)
|
1379 1380 | }
|
1380 1381 | }
|
1381 1382 |
|
1382 1383 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1383 1384 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1384 1385 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1385 1386 |
|
1386 1387 | pub use ::aws_credential_types::Credentials;
|
1387 1388 |
|
1388 1389 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1389 1390 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1390 1391 | let mut builder = Builder::default();
|
1391 1392 | builder.set_credentials_provider(input.credentials_provider());
|
1392 1393 | builder = builder.region(input.region().cloned());
|
1394 + | // Track endpoint override metric if endpoint URL is configured from any source
|
1395 + | let has_global_endpoint = input.endpoint_url().is_some();
|
1396 + | let has_service_specific_endpoint = input
|
1397 + | .service_config()
|
1398 + | .and_then(|conf| conf.load_config(service_config_key("SSO OIDC", "AWS_ENDPOINT_URL", "endpoint_url")))
|
1399 + | .is_some();
|
1400 + |
|
1401 + | if has_global_endpoint || has_service_specific_endpoint {
|
1402 + | builder.push_runtime_plugin(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(
|
1403 + | ::aws_runtime::endpoint_override::EndpointOverrideRuntimePlugin::new_with_feature_flag(),
|
1404 + | ));
|
1405 + | }
|
1393 1406 | builder.set_use_fips(input.use_fips());
|
1394 1407 | builder.set_use_dual_stack(input.use_dual_stack());
|
1395 1408 | if input.get_origin("endpoint_url").is_client_config() {
|
1396 1409 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1397 1410 | } else {
|
1398 1411 | builder.set_endpoint_url(
|
1399 1412 | input
|
1400 1413 | .service_config()
|
1401 1414 | .and_then(|conf| {
|
1402 1415 | conf.load_config(service_config_key("SSO OIDC", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1403 1416 | .map(|it| it.parse().unwrap())
|
1404 1417 | })
|
1405 1418 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1406 1419 | );
|
1407 1420 | }
|
1408 1421 | // resiliency
|
1409 1422 | builder.set_retry_config(input.retry_config().cloned());
|
1410 1423 | builder.set_timeout_config(input.timeout_config().cloned());
|
1411 1424 | builder.set_sleep_impl(input.sleep_impl());
|
1412 1425 |
|
1413 1426 | builder.set_http_client(input.http_client());
|
1414 1427 | builder.set_time_source(input.time_source());
|
1415 1428 | builder.set_behavior_version(input.behavior_version());
|
1416 1429 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1417 1430 | // setting `None` here removes the default
|
1418 1431 | if let Some(config) = input.stalled_stream_protection() {
|
1419 1432 | builder.set_stalled_stream_protection(Some(config));
|
1420 1433 | }
|
1421 1434 |
|
1422 1435 | if let Some(cache) = input.identity_cache() {
|