1455 1455 | fn runtime_components(
|
1456 1456 | &self,
|
1457 1457 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1458 1458 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1459 1459 | ::std::borrow::Cow::Borrowed(&self.components)
|
1460 1460 | }
|
1461 1461 | }
|
1462 1462 |
|
1463 1463 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1464 1464 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1465 1465 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1466 1466 |
|
1467 1467 | pub use ::aws_credential_types::Credentials;
|
1468 1468 |
|
1469 1469 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1470 1470 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1471 1471 | let mut builder = Builder::default();
|
1472 1472 | builder.set_credentials_provider(input.credentials_provider());
|
1473 1473 | builder = builder.region(input.region().cloned());
|
1474 1474 | builder.set_request_checksum_calculation(input.request_checksum_calculation());
|
1475 1475 | builder.set_response_checksum_validation(input.response_checksum_validation());
|
1476 1476 | builder.set_use_fips(input.use_fips());
|
1477 1477 | builder.set_use_dual_stack(input.use_dual_stack());
|
1478 1478 | if input.get_origin("endpoint_url").is_client_config() {
|
1479 1479 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1480 1480 | } else {
|
1481 1481 | builder.set_endpoint_url(
|
1482 1482 | input
|
1483 1483 | .service_config()
|
1484 1484 | .and_then(|conf| {
|
1485 - | conf.load_config(service_config_key("AWS_ENDPOINT_URL", "endpoint_url"))
|
1485 + | conf.load_config(service_config_key("S3", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1486 1486 | .map(|it| it.parse().unwrap())
|
1487 1487 | })
|
1488 1488 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1489 1489 | );
|
1490 1490 | }
|
1491 1491 | // resiliency
|
1492 1492 | builder.set_retry_config(input.retry_config().cloned());
|
1493 1493 | builder.set_timeout_config(input.timeout_config().cloned());
|
1494 1494 | builder.set_sleep_impl(input.sleep_impl());
|
1495 1495 |
|
1496 1496 | builder.set_http_client(input.http_client());
|
1497 1497 | builder.set_time_source(input.time_source());
|
1498 1498 | builder.set_behavior_version(input.behavior_version());
|
1499 1499 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1500 1500 | // setting `None` here removes the default
|
1501 1501 | if let Some(config) = input.stalled_stream_protection() {
|
1502 1502 | builder.set_stalled_stream_protection(Some(config));
|
1503 1503 | }
|
1504 1504 |
|
1505 1505 | if let Some(cache) = input.identity_cache() {
|
1506 1506 | builder.set_identity_cache(cache);
|
1507 1507 | }
|
1508 1508 | builder.set_disable_s3_express_session_auth(input.service_config().and_then(|conf| {
|
1509 1509 | let str_config = conf.load_config(service_config_key(
|
1510 + | "S3",
|
1510 1511 | "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",
|
1511 1512 | "s3_disable_express_session_auth",
|
1512 1513 | ));
|
1513 1514 | str_config.and_then(|it| it.parse::<bool>().ok())
|
1514 1515 | }));
|
1515 1516 | builder.set_app_name(input.app_name().cloned());
|
1516 1517 |
|
1517 1518 | builder
|
1518 1519 | }
|
1519 1520 | }
|
1520 1521 |
|
1521 1522 | impl From<&::aws_types::sdk_config::SdkConfig> for Config {
|
1522 1523 | fn from(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1523 1524 | Builder::from(sdk_config).build()
|
1524 1525 | }
|
1525 1526 | }
|
1526 1527 |
|
1527 1528 | pub use ::aws_types::app_name::AppName;
|
1528 1529 |
|
1529 1530 | #[allow(dead_code)]
|
1530 - | fn service_config_key<'a>(env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> {
|
1531 + | fn service_config_key<'a>(service_id: &'a str, env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> {
|
1531 1532 | ::aws_types::service_config::ServiceConfigKey::builder()
|
1532 - | .service_id("S3")
|
1533 + | .service_id(service_id)
|
1533 1534 | .env(env)
|
1534 1535 | .profile(profile)
|
1535 1536 | .build()
|
1536 1537 | .expect("all field sets explicitly, can't fail")
|
1537 1538 | }
|
1538 1539 |
|
1539 1540 | pub use ::aws_smithy_async::rt::sleep::Sleep;
|
1540 1541 |
|
1541 1542 | pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
|
1542 1543 | let mut configured_plugins = ::std::vec::Vec::new();
|
1543 1544 | ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins);
|
1544 1545 | #[cfg(feature = "behavior-version-latest")]
|
1545 1546 | {
|
1546 1547 | if config.behavior_version.is_none() {
|
1547 1548 | config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
|
1548 1549 | }
|
1549 1550 | }
|
1550 1551 |
|
1551 1552 | let default_retry_partition = "s3";
|
1552 1553 | let default_retry_partition = match config.region() {
|
1553 1554 | Some(region) => ::std::borrow::Cow::from(format!("{default_retry_partition}-{}", region)),
|
1554 1555 | None => ::std::borrow::Cow::from(default_retry_partition),
|
1555 1556 | };
|
1556 1557 |
|
1557 1558 | let scope = "aws-sdk-s3";
|
1558 1559 |
|
1559 1560 | let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
|
1560 1561 | // defaults
|
1561 1562 | .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
|
1562 1563 | ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
|