Skip to content

Commit

Permalink
sources: bump to aws-sdk v1
Browse files Browse the repository at this point in the history
  • Loading branch information
jmt-lab committed Mar 19, 2024
1 parent eaad645 commit 7a8ed39
Show file tree
Hide file tree
Showing 65 changed files with 575 additions and 613 deletions.
765 changes: 339 additions & 426 deletions sources/Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions sources/api/apiclient/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ futures = { version = "0.3", default-features = false }
futures-channel = { version = "0.3", default-features = false }
http = "0.2"
httparse = "1"
hyper = { version = "0.14", default-features = false, features = [ "client", "http1", "http2" ] }
hyper = { version = "0.14", default-features = false, features = ["client", "http1", "http2"] }
hyper-unix-connector = "0.2"
libc = "0.2"
log = "0.4"
models = { path = "../../models", version = "0.1" }
nix = "0.26"
nix = { version = "0.28", features = ["term", "fs"] }
rand = "0.8"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls-native-roots"] }
retry-read = { path = "../../retry-read", version = "0.1" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
signal-hook = "0.3"
simplelog = "0.12"
snafu = { version = "0.7", features = ["futures"] }
snafu = { version = "0.8", features = ["futures"] }
tokio = { version = "~1.32", default-features = false, features = ["fs", "io-std", "io-util", "macros", "rt-multi-thread", "time"] } # LTS
tokio-tungstenite = { version = "0.20", default-features = false, features = ["connect"] }
toml = "0.5"
toml = "0.8"
unindent = "0.1"
url = "2"

Expand Down
7 changes: 4 additions & 3 deletions sources/api/apiclient/src/exec/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use nix::{
unistd::isatty,
};
use snafu::ResultExt;
use std::io;

/// The Terminal type acts as a guard around changes to terminal settings, resetting them to their
/// original state when the Terminal is dropped.
Expand Down Expand Up @@ -59,7 +60,7 @@ impl Terminal {

// Get the current settings of the user's terminal so we can restore them later.
let current_termios =
tcgetattr(STDOUT_FILENO).context(error::TermAttrSnafu { op: "get" })?;
tcgetattr(io::stdout()).context(error::TermAttrSnafu { op: "get" })?;

debug!("Setting terminal to raw mode, sorry about the carriage returns");
let mut new_termios = current_termios.clone();
Expand All @@ -69,7 +70,7 @@ impl Terminal {
cfmakeraw(&mut new_termios);
// We make the change 'NOW' because we don't expect any input/output yet, and so should
// have nothing to FLUSH.
tcsetattr(STDOUT_FILENO, SetArg::TCSANOW, &new_termios)
tcsetattr(io::stdout(), SetArg::TCSANOW, &new_termios)
.context(error::TermAttrSnafu { op: "set" })?;

orig_termios = Some(current_termios);
Expand All @@ -89,7 +90,7 @@ impl Drop for Terminal {
if let Some(orig_termios) = &self.orig_termios {
// We shouldn't fail to reset unless stdout was closed somehow, and there's not much we
// can do about cleaning it up then.
if tcsetattr(STDOUT_FILENO, SetArg::TCSANOW, orig_termios).is_err() {
if tcsetattr(io::stdout(), SetArg::TCSANOW, orig_termios).is_err() {
warn!("Failed to clean up terminal :(");
}
}
Expand Down
6 changes: 3 additions & 3 deletions sources/api/apiserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ http = "0.2"
libc = "0.2"
log = "0.4"
models = { path = "../../models", version = "0.1" }
nix = "0.26"
nix = { version = "0.28", features = ["user", "signal", "fs", "term"] }
num = "0.4"
rand = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
thar-be-updates = { path = "../thar-be-updates", version = "0.1" }
tokio = { version = "~1.32", default-features = false, features = ["process"] }

Expand All @@ -37,4 +37,4 @@ generate-readme = { version = "0.1", path = "../../generate-readme" }

[dev-dependencies]
maplit = "1"
toml = "0.5"
toml = "0.8"
9 changes: 6 additions & 3 deletions sources/api/apiserver/src/server/exec/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use std::convert::TryFrom;
use std::ffi::OsStr;
use std::fs::File;
use std::io::{self, Write};
use std::os::fd::AsRawFd;
use std::os::unix::{
io::{FromRawFd, IntoRawFd, RawFd},
process::CommandExt,
Expand Down Expand Up @@ -284,7 +285,7 @@ impl ChildFds {
// The "master" end of a PTY represents a user typing at a physical terminal; we connect
// that to the user over the WebSocket. The "slave" end is connected to the process
// requested by the user.
let read_fd = pty.master;
let read_fd = pty.master.as_raw_fd();

// Set CLOEXEC on read_fd so it's closed automatically in the child; the child doesn't need
// access to our end of the PTY.
Expand All @@ -303,13 +304,14 @@ impl ChildFds {
// for this environment.
// Implementation note: this seemed simpler than forkpty&exec because Command is a familiar
// abstraction and this keeps the low-level bits to the TTY case that needs them.
let slave_fd = pty.slave.as_raw_fd();
unsafe {
child.pre_exec(move || {
// login_tty does a bunch of useful things for us that make the child process act
// like a "real" process the user would start in their own terminal. It makes a
// new session, sets the given FD as the controlling terminal and as stdin, stdout,
// and stderr, and then closes the FD.
if login_tty(pty.slave) != 0 {
if login_tty(slave_fd) != 0 {
return Err(io::Error::last_os_error());
}
Ok(())
Expand All @@ -319,7 +321,7 @@ impl ChildFds {
Ok(Self {
read_fd,
write_fd: Some(write_fd),
close_fd: Some(pty.slave),
close_fd: Some(slave_fd),
})
}

Expand All @@ -332,6 +334,7 @@ impl ChildFds {
// of the pipe and the parent will read from the other. The child doesn't need access to
// our end of the pipe so we use CLOEXEC to have it closed in the child automatically.
let (read_fd, write_fd) = pipe2(OFlag::O_CLOEXEC).context(error::CreatePipeSnafu)?;
let (read_fd, write_fd) = (read_fd.as_raw_fd(), write_fd.as_raw_fd());
// Make a duplicate for stderr. dup() sets CLOEXEC for us.
let write_fd_dup = dup(write_fd)?;

Expand Down
4 changes: 2 additions & 2 deletions sources/api/bootstrap-containers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ exclude = ["README.md"]
apiclient = { path = "../apiclient", version = "0.1" }
constants = { path = "../../constants", version = "0.1" }
datastore = { path = "../datastore", version = "0.1" }
base64 = "0.13"
base64 = "0.21"
log = "0.4"
models = { path = "../../models", version = "0.1" }
serde_json = "1"
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
tokio = { version = "~1.32", default-features = false, features = ["macros", "rt-multi-thread"] } # LTS

[build-dependencies]
Expand Down
6 changes: 4 additions & 2 deletions sources/api/bootstrap-containers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ journalctl -u bootstrap-containers@bear.service
#[macro_use]
extern crate log;

use base64::Engine;
use datastore::{serialize_scalar, Key, KeyType};
use simplelog::{Config as LogConfig, LevelFilter, SimpleLogger};
use snafu::{ensure, OptionExt, ResultExt};
Expand Down Expand Up @@ -272,8 +273,9 @@ where
// If user data was specified, decode it and write it out
if let Some(user_data) = &container_details.user_data {
debug!("Decoding user data for container '{}'", name);
let decoded_bytes =
base64::decode(user_data.as_bytes()).context(error::Base64DecodeSnafu { name })?;
let decoded_bytes = base64::engine::general_purpose::STANDARD
.decode(user_data.as_bytes())
.context(error::Base64DecodeSnafu { name })?;

let path = dir.join("user-data");
debug!("Storing user data in {}", path.display());
Expand Down
6 changes: 3 additions & 3 deletions sources/api/certdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ exclude = ["README.md"]

[dependencies]
argh = "0.1"
base64 = "0.13"
base64 = "0.21"
constants = { path = "../../constants", version = "0.1" }
log = "0.4"
modeled-types = { path = "../../models/modeled-types", version = "0.1" }
serde = { version = "1.0", features = ["derive"]}
serde = { version = "1.0", features = ["derive"] }
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
toml = "0.8"
x509-parser = "0.15"

Expand Down
16 changes: 11 additions & 5 deletions sources/api/certdog/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
extern crate log;

use argh::FromArgs;
use base64::Engine;
use serde::Deserialize;
use simplelog::{Config as LogConfig, LevelFilter, SimpleLogger};
use snafu::ResultExt;
Expand Down Expand Up @@ -100,7 +101,9 @@ fn split_bundles(certificates_bundle: HashMap<Identifier, PemCertificate>) -> Re
}

let name = name.as_ref();
let decoded = base64::decode(data.as_bytes()).context(error::Base64DecodeSnafu { name })?;
let decoded = base64::engine::general_purpose::STANDARD
.decode(data.as_bytes())
.context(error::Base64DecodeSnafu { name })?;
// Each record in the API could include one or more certificates
let mut pems = pems_from_iter(x509_parser::pem::Pem::iter_from_buffer(&decoded))?;

Expand Down Expand Up @@ -186,7 +189,7 @@ fn pem_to_string(pem: &x509_parser::pem::Pem) -> Result<String> {

writeln!(out, "{} {}{}", PEM_HEADER, pem.label, PEM_SUFFIX)
.context(error::WritePemStringSnafu)?;
let encoded = base64::encode(&pem.contents);
let encoded = base64::engine::general_purpose::STANDARD.encode(&pem.contents);
let bytes = encoded.as_bytes();
for chunk in bytes.chunks(64) {
let chunk = String::from_utf8_lossy(chunk);
Expand Down Expand Up @@ -343,9 +346,12 @@ mod test_certdog {
fn trusted_store_updated() {
let trusted_store = tempfile::NamedTempFile::new().unwrap();
let source_bundle = tempfile::NamedTempFile::new().unwrap();
let (_, pem) =
x509_parser::pem::parse_x509_pem(&base64::decode(TEST_PEM.as_bytes()).unwrap())
.unwrap();
let (_, pem) = x509_parser::pem::parse_x509_pem(
&base64::engine::general_purpose::STANDARD
.decode(TEST_PEM.as_bytes())
.unwrap(),
)
.unwrap();
let trusted_certs: Vec<x509_parser::pem::Pem> = vec![pem];
let certs_bundle = CertBundle {
trusted_certs,
Expand Down
4 changes: 2 additions & 2 deletions sources/api/corndog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ exclude = ["README.md"]
[dependencies]
log = "0.4"
modeled-types = { path = "../../models/modeled-types", version = "0.1" }
serde = { version = "1.0", features = ["derive"]}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
toml = "0.8"

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions sources/api/datastore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ log = "0.4"
percent-encoding = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
snafu = "0.7"
snafu = "0.8"
walkdir = "2"

[build-dependencies]
generate-readme = { version = "0.1", path = "../../generate-readme" }

[dev-dependencies]
maplit = "1"
toml = "0.5"
toml = "0.8"
6 changes: 3 additions & 3 deletions sources/api/early-boot-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exclude = ["README.md"]
[dependencies]
apiclient = { path = "../apiclient", version = "0.1" }
async-trait = "0.1"
base64 = "0.13"
base64 = "0.21"
constants = { path = "../../constants", version = "0.1" }
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
http = "0.2"
Expand All @@ -24,9 +24,9 @@ serde_json = "1"
serde_plain = "1"
serde-xml-rs = "0.6"
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
tokio = { version = "~1.32", default-features = false, features = ["macros", "rt-multi-thread"] } # LTS
toml = "0.5"
toml = "0.8"

[target.'cfg(target_arch = "x86_64")'.dependencies]
# vmw_backdoor includes x86_64 assembly, prevent it from building for ARM
Expand Down
4 changes: 2 additions & 2 deletions sources/api/ecs-settings-applier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ exclude = ["README.md"]

[dependencies]
constants = { path = "../../constants", version = "0.1" }
serde = {version = "1", features = ["derive"]}
serde = { version = "1", features = ["derive"] }
serde_json = "1"
schnauzer = { path = "../schnauzer", version = "0.1" }
log = "0.4"
models = { path = "../../models", version = "0.1" }
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
tokio = { version = "~1.32", default-features = false, features = ["macros", "rt-multi-thread"] } # LTS

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions sources/api/host-containers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ build = "build.rs"
exclude = ["README.md"]

[dependencies]
base64 = "0.13"
base64 = "0.21"
constants = { path = "../../constants", version = "0.1" }
log = "0.4"
modeled-types = { path = "../../models/modeled-types", version = "0.1" }
serde = { version = "1", features = ["derive"] }
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
toml = "0.8"

[dev-dependencies]
Expand Down
6 changes: 4 additions & 2 deletions sources/api/host-containers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ It reads the currently configured containers from its config file, then configur
#[macro_use]
extern crate log;

use base64::Engine;
use simplelog::{Config as LogConfig, LevelFilter, SimpleLogger};
use snafu::{ensure, OptionExt, ResultExt};
use std::collections::HashMap;
Expand Down Expand Up @@ -353,8 +354,9 @@ where

// If user data was specified, unencode it and write it out before we start the container.
if let Some(user_data) = &image_details.user_data {
let decoded_bytes =
base64::decode(user_data.as_bytes()).context(error::Base64DecodeSnafu { name })?;
let decoded_bytes = base64::engine::general_purpose::STANDARD
.decode(user_data.as_bytes())
.context(error::Base64DecodeSnafu { name })?;

let path = dir.join("user-data");
fs::write(path, decoded_bytes).context(error::UserDataWriteSnafu { name })?;
Expand Down
2 changes: 1 addition & 1 deletion sources/api/migration/migration-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ schnauzer = { path = "../../schnauzer", version = "0.1" }
serde = "1"
serde_json = "1"
shlex = "1"
snafu = "0.7"
snafu = "0.8"
tokio = { version = "~1.32", default-features = false, features = ["rt-multi-thread"] }

[dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers" }
snafu = "0.7"
snafu = "0.8"
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers", version = "0.1.0"}
migration-helpers = { path = "../../../migration-helpers", version = "0.1.0" }
serde_json = "1"
snafu = "0.7"
snafu = "0.8"
6 changes: 3 additions & 3 deletions sources/api/migration/migrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ futures = "0.3"
futures-core = "0.3"
log = "0.4"
lz4 = "1"
nix = "0.26"
nix = { version = "0.28", features = ["dir", "fs"] }
pentacle = "1"
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"] }
semver = "1"
simplelog = "0.12"
snafu = "0.7"
snafu = "0.8"
tokio = { version = "~1.32", default-features = false, features = ["fs", "macros", "rt-multi-thread"] } # LTS
tokio-util = { version = "0.7", features = ["compat", "io-util"] }
tough = { version = "0.15", features = ["http"] }
tough = { version = "0.17", features = ["http"] }
update_metadata = { path = "../../../updater/update_metadata", version = "0.1" }
url = "2"

Expand Down
8 changes: 4 additions & 4 deletions sources/api/netdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ argh = "0.1"
dns-lookup = "2"
ipnet = { version = "2", features = ["serde"] }
imdsclient = { path = "../../imdsclient", version = "0.1" }
indexmap = { version = "1", features = ["serde"]}
indexmap = { version = "1", features = ["serde"] }
envy = "0.4"
lazy_static = "1"
systemd-derive = { path = "systemd-derive", version = "0.1" }
quick-xml = {version = "0.26", features = ["serialize"]}
quick-xml = { version = "0.26", features = ["serialize"] }
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"] }
regex = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_plain = "1"
snafu = "0.7"
snafu = "0.8"
tokio = { version = "~1.32", default-features = false, features = ["macros", "rt-multi-thread", "time"] } # LTS
tokio-retry = "0.3"
toml = { version = "0.5", features = ["preserve_order"] }
toml = { version = "0.8", features = ["preserve_order"] }

[dev-dependencies]
tempfile = "3"
Expand Down

0 comments on commit 7a8ed39

Please sign in to comment.