cargo: roxmltree-0.18 and aws-sdk-s3-0.28 bump #591

Merged
lx merged 6 commits from jpds/garage:roxmltree-0.18 into main 2023-06-27 17:20:59 +00:00
11 changed files with 1918 additions and 2012 deletions

1178
Cargo.lock generated

File diff suppressed because it is too large Load diff

2709
Cargo.nix

File diff suppressed because it is too large Load diff

View file

@ -47,7 +47,7 @@ http-range = "0.1"
hyper = { version = "0.14", features = ["server", "http1", "runtime", "tcp", "stream"] } hyper = { version = "0.14", features = ["server", "http1", "runtime", "tcp", "stream"] }
multer = "2.0" multer = "2.0"
percent-encoding = "2.1.0" percent-encoding = "2.1.0"
roxmltree = "0.14" roxmltree = "0.18"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11" serde_bytes = "0.11"
serde_json = "1.0" serde_json = "1.0"

View file

@ -61,7 +61,8 @@ opentelemetry-otlp = { version = "0.10", optional = true }
prometheus = { version = "0.13", optional = true } prometheus = { version = "0.13", optional = true }
[dev-dependencies] [dev-dependencies]
aws-sdk-s3 = "0.19" aws-config = "0.55.2"
aws-sdk-s3 = "0.28"
chrono = "0.4" chrono = "0.4"
http = "0.2" http = "0.2"
hmac = "0.12" hmac = "0.12"

View file

@ -1,7 +1,6 @@
use crate::common; use crate::common;
use crate::common::ext::CommandExt; use crate::common::ext::CommandExt;
use aws_sdk_s3::model::BucketLocationConstraint; use aws_sdk_s3::operation::delete_bucket::DeleteBucketOutput;
use aws_sdk_s3::output::DeleteBucketOutput;
#[tokio::test] #[tokio::test]
async fn test_bucket_all() { async fn test_bucket_all() {
@ -63,10 +62,7 @@ async fn test_bucket_all() {
.await .await
.unwrap(); .unwrap();
match r.location_constraint.unwrap() { assert_eq!(r.location_constraint.unwrap().as_str(), "garage-integ-test");
BucketLocationConstraint::Unknown(v) if v.as_str() == "garage-integ-test" => (),
_ => unreachable!("wrong region"),
}
} }
{ {
// (Stub) check GetVersioning // (Stub) check GetVersioning

View file

@ -1,15 +1,16 @@
use aws_sdk_s3::{Client, Config, Credentials, Endpoint}; use aws_sdk_s3::config::Credentials;
use aws_sdk_s3::{Client, Config};
use super::garage::{Instance, Key}; use super::garage::Key;
use crate::common::garage::DEFAULT_PORT;
pub fn build_client(instance: &Instance, key: &Key) -> Client { pub fn build_client(key: &Key) -> Client {
let credentials = Credentials::new(&key.id, &key.secret, None, None, "garage-integ-test"); let credentials = Credentials::new(&key.id, &key.secret, None, None, "garage-integ-test");
let endpoint = Endpoint::immutable(instance.s3_uri());
let config = Config::builder() let config = Config::builder()
.endpoint_url(format!("http://127.0.0.1:{}", DEFAULT_PORT))
.region(super::REGION) .region(super::REGION)
.credentials_provider(credentials) .credentials_provider(credentials)
.endpoint_resolver(endpoint)
.build(); .build();
Client::from_conf(config) Client::from_conf(config)

View file

@ -1,4 +1,5 @@
use aws_sdk_s3::{Client, Region}; use aws_sdk_s3::config::Region;
use aws_sdk_s3::Client;
use ext::*; use ext::*;
use k2v_client::K2vClient; use k2v_client::K2vClient;
@ -32,7 +33,7 @@ impl Context {
fn new() -> Self { fn new() -> Self {
let garage = garage::instance(); let garage = garage::instance();
let key = garage.key(None); let key = garage.key(None);
let client = client::build_client(garage, &key); let client = client::build_client(&key);
let custom_request = CustomRequester::new_s3(garage, &key); let custom_request = CustomRequester::new_s3(garage, &key);
let k2v_request = CustomRequester::new_k2v(garage, &key); let k2v_request = CustomRequester::new_k2v(garage, &key);

View file

@ -1,6 +1,6 @@
use crate::common; use crate::common;
use aws_sdk_s3::model::{CompletedMultipartUpload, CompletedPart}; use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::ByteStream; use aws_sdk_s3::types::{CompletedMultipartUpload, CompletedPart};
const SZ_5MB: usize = 5 * 1024 * 1024; const SZ_5MB: usize = 5 * 1024 * 1024;
const SZ_10MB: usize = 10 * 1024 * 1024; const SZ_10MB: usize = 10 * 1024 * 1024;

View file

@ -1,6 +1,6 @@
use crate::common; use crate::common;
use aws_sdk_s3::model::{Delete, ObjectIdentifier}; use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::ByteStream; use aws_sdk_s3::types::{Delete, ObjectIdentifier};
const STD_KEY: &str = "hello world"; const STD_KEY: &str = "hello world";
const CTRL_KEY: &str = "\x00\x01\x02\x00"; const CTRL_KEY: &str = "\x00\x01\x02\x00";

View file

@ -2,7 +2,7 @@ use crate::common;
#[tokio::test] #[tokio::test]
async fn test_simple() { async fn test_simple() {
use aws_sdk_s3::types::ByteStream; use aws_sdk_s3::primitives::ByteStream;
let ctx = common::context(); let ctx = common::context();
let bucket = ctx.create_bucket("test-simple"); let bucket = ctx.create_bucket("test-simple");

View file

@ -4,8 +4,8 @@ use crate::k2v::json_body;
use assert_json_diff::assert_json_eq; use assert_json_diff::assert_json_eq;
use aws_sdk_s3::{ use aws_sdk_s3::{
model::{CorsConfiguration, CorsRule, ErrorDocument, IndexDocument, WebsiteConfiguration}, primitives::ByteStream,
types::ByteStream, types::{CorsConfiguration, CorsRule, ErrorDocument, IndexDocument, WebsiteConfiguration},
}; };
use http::{Request, StatusCode}; use http::{Request, StatusCode};
use hyper::{ use hyper::{