AWS SDK

AWS SDK

rev. 342721de2ad509b9ae0b4cd20fb3a4e2d184c83d (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/README.md

@@ -1,1 +57,57 @@
   17     17   
   18     18   
> For a step-by-step guide including several advanced use cases, check out the [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html).
   19     19   
   20     20   
The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio) as a dependency within your Rust project to execute asynchronous code.
   21     21   
   22     22   
1. Create a new Rust project: `cargo new sdk-example`
   23     23   
2. Add dependencies to DynamoDB and Tokio to your **Cargo.toml** file:
   24     24   
   25     25   
    ```toml
   26     26   
    [dependencies]
   27         -
    aws-config = { version= "1.9.0", features = ["behavior-version-latest"] }
          27  +
    aws-config = { version= "1.8.16", features = ["behavior-version-latest"] }
   28     28   
    aws-sdk-dynamodb = "0.0.0-local"
   29     29   
    tokio = { version = "1", features = ["full"] }
   30     30   
    ```
   31     31   
   32     32   
3. Provide your AWS credentials with the default credential provider chain, which currently looks in:
   33     33   
   - Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION`
   34     34   
   - The default credentials files located in `~/.aws/config` and `~/.aws/credentials` (location can vary per platform)
   35     35   
   - Web Identity Token credentials from the environment or container (including EKS)
   36     36   
   - ECS Container Credentials (IAM roles for tasks)
   37     37   
   - EC2 Instance Metadata Service (IAM Roles attached to instance)

tmp-codegen-diff/aws-sdk/sdk/aws-config/Cargo.toml

@@ -1,1 +34,34 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-config"
    4         -
version = "1.9.0"
           4  +
version = "1.8.16"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"]
    6      6   
description = "AWS SDK config and credential provider implementations."
    7      7   
edition = "2021"
    8      8   
exclude = ["test-data/*", "integration-tests/*"]
    9      9   
license = "Apache-2.0"
   10     10   
repository = "https://github.com/smithy-lang/smithy-rs"
   11     11   
rust-version = "1.91.1"
   12     12   
[package.metadata.docs.rs]
   13     13   
all-features = true
   14     14   
targets = ["x86_64-unknown-linux-gnu"]
@@ -54,54 +114,114 @@
   74     74   
path = "../aws-smithy-runtime-api"
   75     75   
features = ["client"]
   76     76   
version = "1.12.0"
   77     77   
   78     78   
[dependencies.aws-smithy-types]
   79     79   
path = "../aws-smithy-types"
   80     80   
version = "1.4.7"
   81     81   
   82     82   
[dependencies.aws-types]
   83     83   
path = "../aws-types"
   84         -
version = "1.4.0"
          84  +
version = "1.3.15"
   85     85   
   86     86   
[dependencies.time]
   87     87   
version = "0.3.4"
   88     88   
features = ["parsing"]
   89     89   
   90     90   
[dependencies.tokio]
   91     91   
version = "1.13.1"
   92     92   
features = ["sync"]
   93     93   
   94     94   
[dependencies.tracing]

tmp-codegen-diff/aws-sdk/sdk/aws-config/fuzz/Cargo.toml

@@ -1,1 +30,30 @@
   13     13   
edition = "2021"
   14     14   
   15     15   
[package.metadata]
   16     16   
cargo-fuzz = true
   17     17   
   18     18   
[dependencies]
   19     19   
libfuzzer-sys = "=0.4.7"
   20     20   
   21     21   
[dependencies.aws-config]
   22     22   
path = ".."
   23         -
version = "1.9.0"
          23  +
version = "1.8.16"
   24     24   
   25     25   
[dependencies.aws-types]
   26     26   
path = "../../../sdk/build/aws-sdk/sdk/aws-types"
   27         -
version = "1.4.0"
          27  +
version = "1.3.15"
   28     28   
   29     29   
[workspace]
   30     30   
members = ["."]

tmp-codegen-diff/aws-sdk/sdk/aws-config/src/lib.rs

@@ -522,522 +599,581 @@
  542    542   
        /// Ignore any environment variables on the host during config resolution
  543    543   
        ///
  544    544   
        /// This allows for testing in a reproducible environment that ensures any
  545    545   
        /// environment variables from the host do not influence environment variable
  546    546   
        /// resolution.
  547    547   
        pub fn empty_test_environment(mut self) -> Self {
  548    548   
            self.env = Some(Env::from_slice(&[]));
  549    549   
            self
  550    550   
        }
  551    551   
  552         -
        /// Override the environment variable abstraction used during config resolution.
  553         -
        ///
  554         -
        /// This can be used with [`Env::from_custom`] to provide a custom environment
  555         -
        /// variable backend (e.g., remote config stores, vaults).
  556         -
        pub fn env(mut self, env: Env) -> Self {
  557         -
            self.env = Some(env);
  558         -
            self
  559         -
        }
  560         -
  561         -
        /// Override the filesystem abstraction used during config resolution.
  562         -
        ///
  563         -
        /// This can be used with [`Fs::from_custom`] to provide a custom filesystem
  564         -
        /// backend (e.g., in-memory stores, encrypted filesystems).
  565         -
        pub fn fs(mut self, fs: Fs) -> Self {
  566         -
            self.fs = Some(fs);
  567         -
            self
  568         -
        }
  569         -
  570    552   
        /// Override the access token provider used to build [`SdkConfig`].
  571    553   
        ///
  572    554   
        /// # Examples
  573    555   
        ///
  574    556   
        /// Override the token provider but load the default value for region:
  575    557   
        /// ```no_run
  576    558   
        /// # use aws_credential_types::Token;
  577    559   
        /// # fn create_my_token_provider() -> Token {
  578    560   
        /// #     Token::new("example", None)
  579    561   
        /// # }
@@ -1032,1014 +1091,1086 @@
 1052   1034   
            builder.set_disable_request_compression(disable_request_compression);
 1053   1035   
            builder.set_request_min_compression_size_bytes(request_min_compression_size_bytes);
 1054   1036   
            builder.set_stalled_stream_protection(self.stalled_stream_protection_config);
 1055   1037   
            builder.set_account_id_endpoint_mode(account_id_endpoint_mode);
 1056   1038   
            builder.set_auth_scheme_preference(auth_scheme_preference);
 1057   1039   
            builder.set_sigv4a_signing_region_set(sigv4a_signing_region_set);
 1058   1040   
            builder.build()
 1059   1041   
        }
 1060   1042   
    }
 1061   1043   
        1044  +
    #[cfg(test)]
        1045  +
    impl ConfigLoader {
        1046  +
        pub(crate) fn env(mut self, env: Env) -> Self {
        1047  +
            self.env = Some(env);
        1048  +
            self
        1049  +
        }
        1050  +
        1051  +
        pub(crate) fn fs(mut self, fs: Fs) -> Self {
        1052  +
            self.fs = Some(fs);
        1053  +
            self
        1054  +
        }
        1055  +
    }
        1056  +
 1062   1057   
    #[cfg(test)]
 1063   1058   
    mod test {
 1064   1059   
        #[allow(deprecated)]
 1065   1060   
        use crate::profile::profile_file::{ProfileFileKind, ProfileFiles};
 1066   1061   
        use crate::test_case::{no_traffic_client, InstantSleep};
 1067   1062   
        use crate::BehaviorVersion;
 1068   1063   
        use crate::{defaults, ConfigLoader};
 1069   1064   
        use aws_credential_types::provider::ProvideCredentials;
 1070   1065   
        use aws_smithy_async::rt::sleep::TokioSleep;
 1071   1066   
        use aws_smithy_http_client::test_util::{infallible_client_fn, NeverClient};

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/Cargo.toml

@@ -44,44 +104,104 @@
   64     64   
features = ["client", "http-1x"]
   65     65   
version = "1.12.0"
   66     66   
   67     67   
[dependencies.aws-smithy-types]
   68     68   
path = "../aws-smithy-types"
   69     69   
features = ["http-body-1-x"]
   70     70   
version = "1.4.7"
   71     71   
   72     72   
[dependencies.aws-types]
   73     73   
path = "../aws-types"
   74         -
version = "1.4.0"
          74  +
version = "1.3.15"
   75     75   
   76     76   
[dependencies.http-02x]
   77     77   
package = "http"
   78     78   
version = "0.2.12"
   79     79   
optional = true
   80     80   
   81     81   
[dependencies.http-body-04x]
   82     82   
package = "http-body"
   83     83   
version = "0.4.6"
   84     84   
optional = true

tmp-codegen-diff/aws-sdk/sdk/aws-types/Cargo.toml

@@ -1,1 +34,34 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-types"
    4         -
version = "1.4.0"
           4  +
version = "1.3.15"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"]
    6      6   
description = "Cross-service types for the AWS SDK."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
rust-version = "1.91.1"
   11     11   
[package.metadata.docs.rs]
   12     12   
all-features = true
   13     13   
targets = ["x86_64-unknown-linux-gnu"]
   14     14   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]

tmp-codegen-diff/aws-sdk/sdk/aws-types/src/os_shim_internal.rs

@@ -1,1 +112,82 @@
    4      4   
 */
    5      5   
    6      6   
//! Abstractions for testing code that interacts with the operating system:
    7      7   
//! - Reading environment variables
    8      8   
//! - Reading from the file system
    9      9   
   10     10   
use std::collections::HashMap;
   11     11   
use std::env::VarError;
   12     12   
use std::ffi::OsString;
   13     13   
use std::fmt::Debug;
   14         -
use std::future::Future;
   15         -
use std::panic::{RefUnwindSafe, UnwindSafe};
   16     14   
use std::path::{Path, PathBuf};
   17         -
use std::pin::Pin;
   18     15   
use std::sync::{Arc, Mutex};
   19     16   
   20     17   
use crate::os_shim_internal::fs::Fake;
   21     18   
   22         -
/// Trait for custom environment variable providers.
   23         -
pub trait ProvideEnv: Debug + Send + Sync + UnwindSafe + RefUnwindSafe {
   24         -
    /// Get the value of environment variable `k`.
   25         -
    fn get(&self, k: &str) -> Result<String, VarError>;
   26         -
}
   27         -
   28         -
/// Trait for custom filesystem providers.
   29         -
pub trait ProvideFs: Debug + Send + Sync + UnwindSafe + RefUnwindSafe {
   30         -
    /// Read the entire contents of the file at `path`.
   31         -
    fn read_to_end(
   32         -
        &self,
   33         -
        path: &Path,
   34         -
    ) -> Pin<Box<dyn Future<Output = std::io::Result<Vec<u8>>> + Send + '_>>;
   35         -
   36         -
    /// Write `contents` to the file at `path`.
   37         -
    fn write(
   38         -
        &self,
   39         -
        path: &Path,
   40         -
        contents: &[u8],
   41         -
    ) -> Pin<Box<dyn Future<Output = std::io::Result<()>> + Send + '_>>;
   42         -
}
   43         -
   44     19   
/// File system abstraction
   45     20   
///
   46     21   
/// Simple abstraction enabling in-memory mocking of the file system
   47     22   
///
   48     23   
/// # Examples
   49     24   
/// Construct a file system which delegates to `std::fs`:
   50     25   
/// ```rust
   51     26   
/// let fs = aws_types::os_shim_internal::Fs::real();
   52     27   
/// ```
   53     28   
///
   54     29   
/// Construct an in-memory file system for testing:
   55     30   
/// ```rust
   56     31   
/// use std::collections::HashMap;
   57     32   
/// let fs = aws_types::os_shim_internal::Fs::from_map({
   58     33   
///     let mut map = HashMap::new();
   59     34   
///     map.insert("/home/.aws/config".to_string(), "[default]\nregion = us-east-1");
   60     35   
///     map
   61     36   
/// });
   62     37   
/// ```
   63     38   
#[derive(Clone, Debug)]
   64     39   
pub struct Fs(fs::Inner);
   65     40   
   66     41   
impl Default for Fs {
   67     42   
    fn default() -> Self {
   68     43   
        Fs::real()
   69     44   
    }
   70     45   
}
   71     46   
   72     47   
impl Fs {
   73     48   
    /// Create `Fs` representing a real file system.
   74     49   
    pub fn real() -> Self {
   75     50   
        Fs(fs::Inner::Real)
   76     51   
    }
   77     52   
   78         -
    /// Create an `Fs` backed by a custom `ProvideFs` implementation.
   79         -
    pub fn from_custom(provider: impl ProvideFs + 'static) -> Self {
   80         -
        Self(fs::Inner::Custom(Arc::new(provider)))
   81         -
    }
   82         -
   83     53   
    /// Create `Fs` from a map of `OsString` to `Vec<u8>`.
   84     54   
    pub fn from_raw_map(fs: HashMap<OsString, Vec<u8>>) -> Self {
   85     55   
        Fs(fs::Inner::Fake(Arc::new(Fake::MapFs(Mutex::new(fs)))))
   86     56   
    }
   87     57   
   88     58   
    /// Create `Fs` from a map of `String` to `Vec<u8>`.
   89     59   
    pub fn from_map(data: HashMap<String, impl Into<Vec<u8>>>) -> Self {
   90     60   
        let fs = data
   91     61   
            .into_iter()
   92     62   
            .map(|(k, v)| (k.into(), v.into()))
@@ -150,120 +481,353 @@
  170    140   
                Fake::NamespacedFs {
  171    141   
                    real_path,
  172    142   
                    namespaced_to,
  173    143   
                } => {
  174    144   
                    let actual_path = path
  175    145   
                        .strip_prefix(namespaced_to)
  176    146   
                        .map_err(|_| std::io::Error::from(std::io::ErrorKind::NotFound))?;
  177    147   
                    std::fs::read(real_path.join(actual_path))
  178    148   
                }
  179    149   
            },
  180         -
            Inner::Custom(provider) => provider.read_to_end(path).await,
  181    150   
        }
  182    151   
    }
  183    152   
  184    153   
    /// Write a slice as the entire contents of a file.
  185    154   
    ///
  186    155   
    /// This is equivalent to `std::fs::write`.
  187    156   
    pub async fn write(
  188    157   
        &self,
  189    158   
        path: impl AsRef<Path>,
  190    159   
        contents: impl AsRef<[u8]>,
  191    160   
    ) -> std::io::Result<()> {
  192    161   
        use fs::Inner;
  193    162   
        match &self.0 {
  194    163   
            // TODO(https://github.com/awslabs/aws-sdk-rust/issues/867): Use async IO below
  195    164   
            Inner::Real => {
  196    165   
                std::fs::write(&path, contents)?;
  197    166   
  198    167   
                #[cfg(unix)]
  199    168   
                {
  200    169   
                    use std::os::unix::fs::PermissionsExt;
  201    170   
                    std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600))?;
  202    171   
                }
  203    172   
            }
  204    173   
            Inner::Fake(fake) => match fake.as_ref() {
  205    174   
                Fake::MapFs(fs) => {
  206    175   
                    fs.lock()
  207    176   
                        .unwrap()
  208    177   
                        .insert(path.as_ref().as_os_str().into(), contents.as_ref().to_vec());
  209    178   
                }
  210    179   
                Fake::NamespacedFs {
  211    180   
                    real_path,
  212    181   
                    namespaced_to,
  213    182   
                } => {
  214    183   
                    let actual_path = path
  215    184   
                        .as_ref()
  216    185   
                        .strip_prefix(namespaced_to)
  217    186   
                        .map_err(|_| std::io::Error::from(std::io::ErrorKind::NotFound))?;
  218    187   
                    std::fs::write(real_path.join(actual_path), contents)?;
  219    188   
                }
  220    189   
            },
  221         -
            Inner::Custom(provider) => {
  222         -
                return provider.write(path.as_ref(), contents.as_ref()).await
  223         -
            }
  224    190   
        }
  225    191   
        Ok(())
  226    192   
    }
  227    193   
}
  228    194   
  229    195   
mod fs {
  230    196   
    use std::collections::HashMap;
  231    197   
    use std::ffi::OsString;
  232    198   
    use std::path::PathBuf;
  233    199   
    use std::sync::{Arc, Mutex};
  234    200   
  235         -
    use super::ProvideFs;
  236         -
  237    201   
    #[derive(Clone, Debug)]
  238    202   
    pub(super) enum Inner {
  239    203   
        Real,
  240    204   
        Fake(Arc<Fake>),
  241         -
        Custom(Arc<dyn ProvideFs>),
  242    205   
    }
  243    206   
  244    207   
    #[derive(Debug)]
  245    208   
    pub(super) enum Fake {
  246    209   
        MapFs(Mutex<HashMap<OsString, Vec<u8>>>),
  247    210   
        NamespacedFs {
  248    211   
            real_path: PathBuf,
  249    212   
            namespaced_to: PathBuf,
  250    213   
        },
  251    214   
    }
  252    215   
}
  253    216   
  254    217   
/// Environment variable abstraction
  255    218   
///
  256    219   
/// Environment variables are global to a process, and, as such, are difficult to test with a multi-
  257    220   
/// threaded test runner like Rust's. This enables loading environment variables either from the
  258    221   
/// actual process environment ([`std::env::var`]) or from a hash map.
  259    222   
///
  260    223   
/// Process environments are cheap to clone:
  261    224   
/// - Faked process environments are wrapped in an internal Arc
  262    225   
/// - Real process environments are pointer-sized
  263    226   
#[derive(Clone, Debug)]
  264    227   
pub struct Env(env::Inner);
  265    228   
  266    229   
impl Default for Env {
  267    230   
    fn default() -> Self {
  268    231   
        Self::real()
  269    232   
    }
  270    233   
}
  271    234   
  272    235   
impl Env {
  273    236   
    /// Retrieve a value for the given `k` and return `VarError` is that key is not present.
  274    237   
    pub fn get(&self, k: &str) -> Result<String, VarError> {
  275    238   
        use env::Inner;
  276    239   
        match &self.0 {
  277    240   
            Inner::Real => std::env::var(k),
  278    241   
            Inner::Fake(map) => map.get(k).cloned().ok_or(VarError::NotPresent),
  279         -
            Inner::Custom(provider) => provider.get(k),
  280    242   
        }
  281    243   
    }
  282    244   
  283    245   
    /// Create a fake process environment from a slice of tuples.
  284    246   
    ///
  285    247   
    /// # Examples
  286    248   
    /// ```rust
  287    249   
    /// use aws_types::os_shim_internal::Env;
  288    250   
    /// let mock_env = Env::from_slice(&[
  289    251   
    ///     ("HOME", "/home/myname"),
  290    252   
    ///     ("AWS_REGION", "us-west-2")
  291    253   
    /// ]);
  292    254   
    /// assert_eq!(mock_env.get("HOME").unwrap(), "/home/myname");
  293    255   
    /// ```
  294    256   
    pub fn from_slice<'a>(vars: &[(&'a str, &'a str)]) -> Self {
  295    257   
        let map: HashMap<_, _> = vars
  296    258   
            .iter()
  297    259   
            .map(|(k, v)| (k.to_string(), v.to_string()))
  298    260   
            .collect();
  299    261   
        Self::from(map)
  300    262   
    }
  301    263   
  302    264   
    /// Create a process environment that uses the real process environment
  303    265   
    ///
  304    266   
    /// Calls will be delegated to [`std::env::var`].
  305    267   
    pub fn real() -> Self {
  306    268   
        Self(env::Inner::Real)
  307    269   
    }
  308         -
  309         -
    /// Create an `Env` backed by a custom `ProvideEnv` implementation.
  310         -
    pub fn from_custom(provider: impl ProvideEnv + 'static) -> Self {
  311         -
        Self(env::Inner::Custom(Arc::new(provider)))
  312         -
    }
  313    270   
}
  314    271   
  315    272   
impl From<HashMap<String, String>> for Env {
  316    273   
    fn from(hash_map: HashMap<String, String>) -> Self {
  317    274   
        Self(env::Inner::Fake(Arc::new(hash_map)))
  318    275   
    }
  319    276   
}
  320    277   
  321    278   
mod env {
  322    279   
    use std::collections::HashMap;
  323    280   
    use std::sync::Arc;
  324    281   
  325         -
    use super::ProvideEnv;
  326         -
  327    282   
    #[derive(Clone, Debug)]
  328    283   
    pub(super) enum Inner {
  329    284   
        Real,
  330    285   
        Fake(Arc<HashMap<String, String>>),
  331         -
        Custom(Arc<dyn ProvideEnv>),
  332    286   
    }
  333    287   
}
  334    288   
  335    289   
#[cfg(test)]
  336    290   
mod test {
  337         -
    use std::collections::HashMap;
  338    291   
    use std::env::VarError;
  339         -
    use std::future::Future;
  340         -
    use std::path::{Path, PathBuf};
  341         -
    use std::pin::Pin;
  342         -
    use std::sync::Mutex;
  343    292   
  344         -
    use crate::os_shim_internal::{Env, Fs, ProvideEnv, ProvideFs};
         293  +
    use crate::os_shim_internal::{Env, Fs};
  345    294   
  346    295   
    #[test]
  347    296   
    fn env_works() {
  348    297   
        let env = Env::from_slice(&[("FOO", "BAR")]);
  349    298   
        assert_eq!(env.get("FOO").unwrap(), "BAR");
  350    299   
        assert_eq!(
  351    300   
            env.get("OTHER").expect_err("no present"),
  352    301   
            VarError::NotPresent
  353    302   
        )
  354    303   
    }
  355    304   
  356    305   
    #[tokio::test]
  357    306   
    async fn fs_from_test_dir_works() {
  358    307   
        let fs = Fs::from_test_dir(".", "/users/test-data");
  359    308   
        let _ = fs
  360    309   
            .read_to_end("/users/test-data/Cargo.toml")
  361    310   
            .await
  362    311   
            .expect("file exists");
  363    312   
  364    313   
        let _ = fs
  365    314   
            .read_to_end("doesntexist")
  366    315   
            .await
  367    316   
            .expect_err("file doesnt exists");
  368    317   
    }
  369    318   
  370    319   
    #[tokio::test]
  371    320   
    async fn fs_round_trip_file_with_real() {
  372    321   
        let temp = tempfile::tempdir().unwrap();
  373    322   
        let path = temp.path().join("test-file");
  374    323   
  375    324   
        let fs = Fs::real();
  376    325   
        fs.read_to_end(&path)
  377    326   
            .await
  378    327   
            .expect_err("file doesn't exist yet");
  379    328   
  380    329   
        fs.write(&path, b"test").await.expect("success");
  381    330   
  382    331   
        let result = fs.read_to_end(&path).await.expect("success");
  383    332   
        assert_eq!(b"test", &result[..]);
  384    333   
    }
  385    334   
  386         -
    #[test]
  387         -
    fn custom_env_works() {
  388         -
        #[derive(Debug)]
  389         -
        struct CustomEnvProvider {
  390         -
            vars: HashMap<String, String>,
  391         -
        }
  392         -
  393         -
        impl ProvideEnv for CustomEnvProvider {
  394         -
            fn get(&self, k: &str) -> Result<String, VarError> {
  395         -
                self.vars.get(k).cloned().ok_or(VarError::NotPresent)
  396         -
            }
  397         -
        }
  398         -
  399         -
        let mut vars = HashMap::new();
  400         -
        vars.insert("FOO".to_string(), "BAR".to_string());
  401         -
        let env = Env::from_custom(CustomEnvProvider { vars });
  402         -
        assert_eq!(env.get("FOO").unwrap(), "BAR");
  403         -
        assert_eq!(
  404         -
            env.get("OTHER").expect_err("not present"),
  405         -
            VarError::NotPresent
  406         -
        );
  407         -
    }
  408         -
  409         -
    #[tokio::test]
  410         -
    async fn custom_fs_round_trip() {
  411         -
        #[derive(Debug)]
  412         -
        struct InMemoryFs {
  413         -
            files: Mutex<HashMap<PathBuf, Vec<u8>>>,
  414         -
        }
  415         -
  416         -
        impl ProvideFs for InMemoryFs {
  417         -
            fn read_to_end(
  418         -
                &self,
  419         -
                path: &Path,
  420         -
            ) -> Pin<Box<dyn Future<Output = std::io::Result<Vec<u8>>> + Send + '_>> {
  421         -
                let path = path.to_path_buf();
  422         -
                Box::pin(async move {
  423         -
                    self.files
  424         -
                        .lock()
  425         -
                        .unwrap()
  426         -
                        .get(&path)
  427         -
                        .cloned()
  428         -
                        .ok_or_else(|| std::io::ErrorKind::NotFound.into())
  429         -
                })
  430         -
            }
  431         -
  432         -
            fn write(
  433         -
                &self,
  434         -
                path: &Path,
  435         -
                contents: &[u8],
  436         -
            ) -> Pin<Box<dyn Future<Output = std::io::Result<()>> + Send + '_>> {
  437         -
                let path = path.to_path_buf();
  438         -
                let contents = contents.to_vec();
  439         -
                Box::pin(async move {
  440         -
                    self.files.lock().unwrap().insert(path, contents);
  441         -
                    Ok(())
  442         -
                })
  443         -
            }
  444         -
        }
  445         -
  446         -
        let provider = InMemoryFs {
  447         -
            files: Mutex::new(HashMap::new()),
  448         -
        };
  449         -
        let fs = Fs::from_custom(provider);
  450         -
  451         -
        fs.read_to_end("/missing")
  452         -
            .await
  453         -
            .expect_err("file doesn't exist yet");
  454         -
  455         -
        fs.write("/test-file", b"hello")
  456         -
            .await
  457         -
            .expect("write succeeds");
  458         -
  459         -
        let result = fs.read_to_end("/test-file").await.expect("read succeeds");
  460         -
        assert_eq!(result, b"hello");
  461         -
    }
  462         -
  463    335   
    #[cfg(unix)]
  464    336   
    #[tokio::test]
  465    337   
    async fn real_fs_write_sets_owner_only_permissions_on_unix() {
  466    338   
        use std::os::unix::fs::PermissionsExt;
  467    339   
  468    340   
        let dir = tempfile::tempdir().expect("create temp dir");
  469    341   
        let path = dir.path().join("secret.txt");
  470    342   
        let fs = Fs::real();
  471    343   
  472    344   
        fs.write(&path, b"sensitive").await.expect("write succeeds");

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/Cargo.toml

@@ -39,39 +124,124 @@
   59     59   
features = ["client", "http-1x", "http-auth"]
   60     60   
version = "1.12.0"
   61     61   
   62     62   
[dependencies.aws-smithy-types]
   63     63   
path = "../aws-smithy-types"
   64     64   
features = ["http-body-1-x"]
   65     65   
version = "1.4.7"
   66     66   
   67     67   
[dependencies.aws-types]
   68     68   
path = "../aws-types"
   69         -
version = "1.4.0"
          69  +
version = "1.3.15"
   70     70   
   71     71   
[dependencies.bytes]
   72     72   
version = "1.4.0"
   73     73   
   74     74   
[dependencies.fastrand]
   75     75   
version = "2.0.0"
   76     76   
   77     77   
[dependencies.http]
   78     78   
version = "0.2.9"
   79     79   
   80     80   
[dependencies.http-1x]
   81     81   
version = "1"
   82     82   
package = "http"
   83     83   
   84     84   
[dependencies.http-body-util]
   85     85   
version = "0.1.3"
   86     86   
   87     87   
[dependencies.regex-lite]
   88     88   
version = "0.1.5"
   89     89   
   90     90   
[dependencies.tracing]
   91     91   
version = "0.1"
   92     92   
[dev-dependencies.aws-config]
   93     93   
path = "../aws-config"
   94         -
version = "1.9.0"
          94  +
version = "1.8.16"
   95     95   
   96     96   
[dev-dependencies.aws-credential-types]
   97     97   
path = "../aws-credential-types"
   98     98   
features = ["test-util"]
   99     99   
version = "1.2.14"
  100    100   
  101    101   
[dev-dependencies.aws-runtime]
  102    102   
path = "../aws-runtime"
  103    103   
features = ["test-util"]
  104    104   
version = "1.7.3"

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/Cargo.toml

@@ -35,35 +117,117 @@
   55     55   
features = ["client", "http-1x"]
   56     56   
version = "1.12.0"
   57     57   
   58     58   
[dependencies.aws-smithy-types]
   59     59   
path = "../aws-smithy-types"
   60     60   
features = ["http-body-1-x"]
   61     61   
version = "1.4.7"
   62     62   
   63     63   
[dependencies.aws-types]
   64     64   
path = "../aws-types"
   65         -
version = "1.4.0"
          65  +
version = "1.3.15"
   66     66   
   67     67   
[dependencies.bytes]
   68     68   
version = "1.4.0"
   69     69   
   70     70   
[dependencies.fastrand]
   71     71   
version = "2.0.0"
   72     72   
   73     73   
[dependencies.http]
   74     74   
version = "0.2.9"
   75     75   
   76     76   
[dependencies.http-1x]
   77     77   
version = "1"
   78     78   
package = "http"
   79     79   
   80     80   
[dependencies.regex-lite]
   81     81   
version = "0.1.5"
   82     82   
   83     83   
[dependencies.tracing]
   84     84   
version = "0.1"
   85     85   
[dev-dependencies.aws-config]
   86     86   
path = "../aws-config"
   87         -
version = "1.9.0"
          87  +
version = "1.8.16"
   88     88   
   89     89   
[dev-dependencies.aws-credential-types]
   90     90   
path = "../aws-credential-types"
   91     91   
features = ["test-util"]
   92     92   
version = "1.2.14"
   93     93   
   94     94   
[dev-dependencies.aws-runtime]
   95     95   
path = "../aws-runtime"
   96     96   
features = ["test-util"]
   97     97   
version = "1.7.3"

tmp-codegen-diff/aws-sdk/sdk/codecatalyst/Cargo.toml

@@ -29,29 +111,111 @@
   49     49   
features = ["client", "http-1x", "http-auth"]
   50     50   
version = "1.12.0"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55     55   
version = "1.4.7"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59         -
version = "1.4.0"
          59  +
version = "1.3.15"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.http-1x]
   71     71   
version = "1"
   72     72   
package = "http"
   73     73   
   74     74   
[dependencies.regex-lite]
   75     75   
version = "0.1.5"
   76     76   
   77     77   
[dependencies.tracing]
   78     78   
version = "0.1"
   79     79   
[dev-dependencies.aws-config]
   80     80   
path = "../aws-config"
   81         -
version = "1.9.0"
          81  +
version = "1.8.16"
   82     82   
   83     83   
[dev-dependencies.aws-credential-types]
   84     84   
path = "../aws-credential-types"
   85     85   
features = ["test-util"]
   86     86   
version = "1.2.14"
   87     87   
   88     88   
[dev-dependencies.aws-runtime]
   89     89   
path = "../aws-runtime"
   90     90   
features = ["test-util"]
   91     91   
version = "1.7.3"

tmp-codegen-diff/aws-sdk/sdk/config/Cargo.toml

@@ -29,29 +102,102 @@
   49     49   
features = ["client", "http-1x"]
   50     50   
version = "1.12.0"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55     55   
version = "1.4.7"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59         -
version = "1.4.0"
          59  +
version = "1.3.15"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.http-1x]
   71     71   
version = "1"
   72     72   
package = "http"
   73     73   
   74     74   
[dependencies.regex-lite]
   75     75   
version = "0.1.5"
   76     76   
   77     77   
[dependencies.tracing]
   78     78   
version = "0.1"
   79     79   
[dev-dependencies.aws-config]
   80     80   
path = "../aws-config"
   81         -
version = "1.9.0"
          81  +
version = "1.8.16"
   82     82   
   83     83   
[dev-dependencies.aws-credential-types]
   84     84   
path = "../aws-credential-types"
   85     85   
features = ["test-util"]
   86     86   
version = "1.2.14"
   87     87   
   88     88   
[dev-dependencies.proptest]
   89     89   
version = "1"
   90     90   
   91     91   
[dev-dependencies.tokio]

tmp-codegen-diff/aws-sdk/sdk/dynamodb/Cargo.toml

@@ -29,29 +114,114 @@
   49     49   
features = ["client", "http-1x"]
   50     50   
version = "1.12.0"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55     55   
version = "1.4.7"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59         -
version = "1.4.0"
          59  +
version = "1.3.15"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.http-1x]
   71     71   
version = "1"
   72     72   
package = "http"
   73     73   
   74     74   
[dependencies.regex-lite]
   75     75   
version = "0.1.5"
   76     76   
   77     77   
[dependencies.tracing]
   78     78   
version = "0.1"
   79     79   
[dev-dependencies.approx]
   80     80   
version = "0.5.1"
   81     81   
   82     82   
[dev-dependencies.aws-config]
   83     83   
path = "../aws-config"
   84         -
version = "1.9.0"
          84  +
version = "1.8.16"
   85     85   
   86     86   
[dev-dependencies.aws-credential-types]
   87     87   
path = "../aws-credential-types"
   88     88   
features = ["test-util"]
   89     89   
version = "1.2.14"
   90     90   
   91     91   
[dev-dependencies.aws-runtime]
   92     92   
path = "../aws-runtime"
   93     93   
features = ["test-util"]
   94     94   
version = "1.7.3"

tmp-codegen-diff/aws-sdk/sdk/ec2/Cargo.toml

@@ -37,37 +116,116 @@
   57     57   
path = "../aws-smithy-types"
   58     58   
features = ["http-body-1-x"]
   59     59   
version = "1.4.7"
   60     60   
   61     61   
[dependencies.aws-smithy-xml]
   62     62   
path = "../aws-smithy-xml"
   63     63   
version = "0.60.15"
   64     64   
   65     65   
[dependencies.aws-types]
   66     66   
path = "../aws-types"
   67         -
version = "1.4.0"
          67  +
version = "1.3.15"
   68     68   
   69     69   
[dependencies.fastrand]
   70     70   
version = "2.0.0"
   71     71   
   72     72   
[dependencies.http]
   73     73   
version = "0.2.9"
   74     74   
   75     75   
[dependencies.http-1x]
   76     76   
version = "1"
   77     77   
package = "http"
   78     78   
   79     79   
[dependencies.regex-lite]
   80     80   
version = "0.1.5"
   81     81   
   82     82   
[dependencies.tracing]
   83     83   
version = "0.1"
   84     84   
[dev-dependencies.aws-config]
   85     85   
path = "../aws-config"
   86         -
version = "1.9.0"
          86  +
version = "1.8.16"
   87     87   
   88     88   
[dev-dependencies.aws-credential-types]
   89     89   
path = "../aws-credential-types"
   90     90   
features = ["test-util"]
   91     91   
version = "1.2.14"
   92     92   
   93     93   
[dev-dependencies.aws-runtime]
   94     94   
path = "../aws-runtime"
   95     95   
features = ["test-util"]
   96     96   
version = "1.7.3"

tmp-codegen-diff/aws-sdk/sdk/ecs/Cargo.toml

@@ -29,29 +102,102 @@
   49     49   
features = ["client", "http-1x"]
   50     50   
version = "1.12.0"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55     55   
version = "1.4.7"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59         -
version = "1.4.0"
          59  +
version = "1.3.15"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.http-1x]
   71     71   
version = "1"
   72     72   
package = "http"
   73     73   
   74     74   
[dependencies.regex-lite]
   75     75   
version = "0.1.5"
   76     76   
   77     77   
[dependencies.tracing]
   78     78   
version = "0.1"
   79     79   
[dev-dependencies.aws-config]
   80     80   
path = "../aws-config"
   81         -
version = "1.9.0"
          81  +
version = "1.8.16"
   82     82   
   83     83   
[dev-dependencies.aws-credential-types]
   84     84   
path = "../aws-credential-types"
   85     85   
features = ["test-util"]
   86     86   
version = "1.2.14"
   87     87   
   88     88   
[dev-dependencies.proptest]
   89     89   
version = "1"
   90     90   
   91     91   
[dev-dependencies.tokio]

tmp-codegen-diff/aws-sdk/sdk/glacier/Cargo.toml

@@ -33,33 +121,121 @@
   53     53   
features = ["client", "http-1x"]
   54     54   
version = "1.12.0"
   55     55   
   56     56   
[dependencies.aws-smithy-types]
   57     57   
path = "../aws-smithy-types"
   58     58   
features = ["http-body-1-x"]
   59     59   
version = "1.4.7"
   60     60   
   61     61   
[dependencies.aws-types]
   62     62   
path = "../aws-types"
   63         -
version = "1.4.0"
          63  +
version = "1.3.15"
   64     64   
   65     65   
[dependencies.bytes]
   66     66   
version = "1.4.0"
   67     67   
   68     68   
[dependencies.fastrand]
   69     69   
version = "2.0.0"
   70     70   
   71     71   
[dependencies.hex]
   72     72   
version = "0.4.3"
   73     73   
   74     74   
[dependencies.http]
   75     75   
version = "0.2.9"
   76     76   
   77     77   
[dependencies.http-1x]
   78     78   
version = "1"
   79     79   
package = "http"
   80     80   
   81     81   
[dependencies.regex-lite]
   82     82   
version = "0.1.5"
   83     83   
   84     84   
[dependencies.ring]
   85     85   
version = "0.17.5"
   86     86   
   87     87   
[dependencies.tracing]
   88     88   
version = "0.1"
   89     89   
[dev-dependencies.aws-config]
   90     90   
path = "../aws-config"
   91         -
version = "1.9.0"
          91  +
version = "1.8.16"
   92     92   
   93     93   
[dev-dependencies.aws-credential-types]
   94     94   
path = "../aws-credential-types"
   95     95   
features = ["test-util"]
   96     96   
version = "1.2.14"
   97     97   
   98     98   
[dev-dependencies.aws-runtime]
   99     99   
path = "../aws-runtime"
  100    100   
features = ["test-util"]
  101    101   
version = "1.7.3"