1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

server: Upgrade aws-sdk-rust

This commit is contained in:
Zhaofeng Li 2023-03-05 11:05:11 -07:00
parent 18ca2cf29a
commit b6002b413c
3 changed files with 177 additions and 62 deletions

230
Cargo.lock generated
View file

@ -87,6 +87,17 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
[[package]]
name = "assert-json-diff"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4259cbe96513d2f1073027a259fc2ca917feb3026a5a8d984e3628e490255cc0"
dependencies = [
"extend",
"serde",
"serde_json",
]
[[package]]
name = "async-channel"
version = "1.8.0"
@ -304,10 +315,11 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "aws-config"
version = "0.52.0"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7688e1dfbb9f7804fab0a830820d7e827b8d973906763cf1a855ce4719292f5"
checksum = "3c3d1e2a1f1ab3ac6c4b884e37413eaa03eb9d901e4fc68ee8f5c1d49721680e"
dependencies = [
"aws-credential-types",
"aws-http",
"aws-sdk-sso",
"aws-sdk-sts",
@ -331,10 +343,23 @@ dependencies = [
]
[[package]]
name = "aws-endpoint"
version = "0.52.0"
name = "aws-credential-types"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "253d7cd480bfa59a5323390e9e91885a8f06a275e0517d81eeb1070b6aa7d271"
checksum = "bb0696a0523a39a19087747e4dafda0362dc867531e3d72a3f195564c84e5e08"
dependencies = [
"aws-smithy-async",
"aws-smithy-types",
"tokio",
"tracing",
"zeroize",
]
[[package]]
name = "aws-endpoint"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80a4f935ab6a1919fbfd6102a80c4fccd9ff5f47f94ba154074afe1051903261"
dependencies = [
"aws-smithy-http",
"aws-smithy-types",
@ -346,10 +371,11 @@ dependencies = [
[[package]]
name = "aws-http"
version = "0.52.0"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cd1b83859383e46ea8fda633378f9f3f02e6e3a446fd89f0240b5c3662716c9"
checksum = "82976ca4e426ee9ca3ffcf919d9b2c8d14d0cd80d43cc02173737a8f07f28d4d"
dependencies = [
"aws-credential-types",
"aws-smithy-http",
"aws-smithy-types",
"aws-types",
@ -364,10 +390,11 @@ dependencies = [
[[package]]
name = "aws-sdk-s3"
version = "0.22.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4d240ff751efc65099d18f6b0fb80360b31a298cec7b392c511692bec4a6e21"
checksum = "1533be023eeac69668eb718b1c48af7bd5e26305ed770553d2877ab1f7507b68"
dependencies = [
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-sig-auth",
@ -378,6 +405,7 @@ dependencies = [
"aws-smithy-eventstream",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json",
"aws-smithy-types",
"aws-smithy-xml",
"aws-types",
@ -386,17 +414,22 @@ dependencies = [
"fastrand",
"http",
"http-body",
"once_cell",
"percent-encoding",
"regex",
"tokio-stream",
"tower",
"tracing",
"url",
]
[[package]]
name = "aws-sdk-sso"
version = "0.22.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf03342c2b3f52b180f484e60586500765474f2bfc7dcd4ffe893a7a1929db1d"
checksum = "ca0119bacf0c42f587506769390983223ba834e605f049babe514b2bd646dbb2"
dependencies = [
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-sig-auth",
@ -409,16 +442,18 @@ dependencies = [
"aws-types",
"bytes",
"http",
"regex",
"tokio-stream",
"tower",
]
[[package]]
name = "aws-sdk-sts"
version = "0.22.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa1de4e07ea87a30a317c7b563b3a40fd18a843ad794216dda81672b6e174bce"
checksum = "270b6a33969ebfcb193512fbd5e8ee5306888ad6c6d5d775cdbfb2d50d94de26"
dependencies = [
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-sig-auth",
@ -426,22 +461,25 @@ dependencies = [
"aws-smithy-client",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json",
"aws-smithy-query",
"aws-smithy-types",
"aws-smithy-xml",
"aws-types",
"bytes",
"http",
"regex",
"tower",
"tracing",
]
[[package]]
name = "aws-sig-auth"
version = "0.52.0"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6126c4ff918e35fb9ae1bf2de71157fad36f0cc6a2b1d0f7197ee711713700fc"
checksum = "660a02a98ab1af83bd8d714afbab2d502ba9b18c49e7e4cddd6bf8837ff778cb"
dependencies = [
"aws-credential-types",
"aws-sigv4",
"aws-smithy-eventstream",
"aws-smithy-http",
@ -452,9 +490,9 @@ dependencies = [
[[package]]
name = "aws-sigv4"
version = "0.52.0"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84c7f88d7395f5411c6eef5889b6cd577ce6b677af461356cbfc20176c26c160"
checksum = "cdaf11005b7444e6cd66f600d09861a3aeb6eb89a0f003c7c9820dbab2d15297"
dependencies = [
"aws-smithy-eventstream",
"aws-smithy-http",
@ -473,9 +511,9 @@ dependencies = [
[[package]]
name = "aws-smithy-async"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e6a895d68852dd1564328e63ef1583e5eb307dd2a5ebf35d862a5c402957d5e"
checksum = "63c712a28a4f2f2139759235c08bf98aca99d4fdf1b13c78c5f95613df0a5db9"
dependencies = [
"futures-util",
"pin-project-lite",
@ -485,9 +523,9 @@ dependencies = [
[[package]]
name = "aws-smithy-checksums"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b847d960abc993319d77b52e82971e2bbdce94f6192df42142e14ed5c9c917"
checksum = "a3875fb4b28606a5368a048016a28c15707f2b21238d5b2e4a23198f590e92c4"
dependencies = [
"aws-smithy-http",
"aws-smithy-types",
@ -506,13 +544,14 @@ dependencies = [
[[package]]
name = "aws-smithy-client"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f505bf793eb3e6d7c166ef1275c27b4b2cd5361173fe950ac8e2cfc08c29a7ef"
checksum = "104ca17f56cde00a10207169697dfe9c6810db339d52fb352707e64875b30a44"
dependencies = [
"aws-smithy-async",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-protocol-test",
"aws-smithy-types",
"bytes",
"fastrand",
@ -522,6 +561,7 @@ dependencies = [
"hyper-rustls",
"lazy_static",
"pin-project-lite",
"serde",
"tokio",
"tower",
"tracing",
@ -529,9 +569,9 @@ dependencies = [
[[package]]
name = "aws-smithy-eventstream"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d751c99da757aecc1408ab6b2d65e9493220a5e7a68bcafa4f07b6fd1bc473f1"
checksum = "ac250d8c0e42af0097a6837ffc5a6fb9f8ba4107bb53124c047c91bc2a58878f"
dependencies = [
"aws-smithy-types",
"bytes",
@ -540,9 +580,9 @@ dependencies = [
[[package]]
name = "aws-smithy-http"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37e4b4304b7ea4af1af3e08535100eb7b6459d5a6264b92078bf85176d04ab85"
checksum = "873f316f1833add0d3aa54ed1b0cd252ddd88c792a0cf839886400099971e844"
dependencies = [
"aws-smithy-eventstream",
"aws-smithy-types",
@ -563,9 +603,9 @@ dependencies = [
[[package]]
name = "aws-smithy-http-tower"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e86072ecc4dc4faf3e2071144285cfd539263fe7102b701d54fb991eafb04af8"
checksum = "4f38231d3f5dac9ac7976f44e12803add1385119ffca9e5f050d8e980733d164"
dependencies = [
"aws-smithy-http",
"aws-smithy-types",
@ -579,18 +619,33 @@ dependencies = [
[[package]]
name = "aws-smithy-json"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e3ddd9275b167bc59e9446469eca56177ec0b51225632f90aaa2cd5f41c940e"
checksum = "4bd83ff2b79e9f729746fcc8ad798676b68fe6ea72986571569a5306a277a182"
dependencies = [
"aws-smithy-types",
]
[[package]]
name = "aws-smithy-query"
version = "0.52.0"
name = "aws-smithy-protocol-test"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b19d2e0b3ce20e460bad0d0d974238673100edebba6978c2c1aadd925602f7"
checksum = "d4d1c9bcb35ce11055ec128dab2c66a7ed47e2dfff99883e32c21a1ab6d6bee6"
dependencies = [
"assert-json-diff",
"http",
"pretty_assertions",
"regex",
"roxmltree",
"serde_json",
"thiserror",
]
[[package]]
name = "aws-smithy-query"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2f0445dafe9d2cd50b44339ae3c3ed46549aad8ac696c52ad660b3e7ae8682b"
dependencies = [
"aws-smithy-types",
"urlencoding",
@ -598,9 +653,9 @@ dependencies = [
[[package]]
name = "aws-smithy-types"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "987b1e37febb9bd409ca0846e82d35299e572ad8279bc404778caeb5fc05ad56"
checksum = "8161232eda10290f5136610a1eb9de56aceaccd70c963a26a260af20ac24794f"
dependencies = [
"base64-simd",
"itoa",
@ -611,19 +666,20 @@ dependencies = [
[[package]]
name = "aws-smithy-xml"
version = "0.52.0"
version = "0.54.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37ce3791e14eec75ffac851a5a559f1ce6b31843297f42cc8bfba82714a6a5d8"
checksum = "343ffe9a9bb3f542675f4df0e0d5933513d6ad038ca3907ad1767ba690a99684"
dependencies = [
"xmlparser",
]
[[package]]
name = "aws-types"
version = "0.52.0"
version = "0.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c05adca3e2bcf686dd2c47836f216ab52ed7845c177d180c84b08522c1166a3"
checksum = "f8f15b34253b68cde08e39b0627cc6101bcca64351229484b4743392c035d057"
dependencies = [
"aws-credential-types",
"aws-smithy-async",
"aws-smithy-client",
"aws-smithy-http",
@ -631,7 +687,6 @@ dependencies = [
"http",
"rustc_version",
"tracing",
"zeroize",
]
[[package]]
@ -735,11 +790,12 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
[[package]]
name = "base64-simd"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5"
checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195"
dependencies = [
"simd-abstraction",
"outref",
"vsimd",
]
[[package]]
@ -1264,6 +1320,16 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df"
[[package]]
name = "ctor"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "cxx"
version = "1.0.91"
@ -1377,6 +1443,12 @@ dependencies = [
"zeroize",
]
[[package]]
name = "diff"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
[[package]]
name = "digest"
version = "0.10.6"
@ -1530,6 +1602,18 @@ version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "extend"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f47da3a72ec598d9c8937a7ebca8962a5c7a1f28444e38c2b33c771ba3f55f05"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "fastcdc"
version = "1.0.8"
@ -1984,7 +2068,6 @@ dependencies = [
"rustls-native-certs",
"tokio",
"tokio-rustls",
"webpki-roots",
]
[[package]]
@ -2532,10 +2615,19 @@ dependencies = [
]
[[package]]
name = "outref"
version = "0.1.0"
name = "output_vt100"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4"
checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66"
dependencies = [
"winapi",
]
[[package]]
name = "outref"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a"
[[package]]
name = "overload"
@ -2691,6 +2783,18 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "pretty_assertions"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755"
dependencies = [
"ctor",
"diff",
"output_vt100",
"yansi",
]
[[package]]
name = "primeorder"
version = "0.12.1"
@ -2981,6 +3085,15 @@ dependencies = [
"syn",
]
[[package]]
name = "roxmltree"
version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "921904a62e410e37e215c40381b7117f830d9d89ba60ab5236170541dd25646b"
dependencies = [
"xmlparser",
]
[[package]]
name = "rsa"
version = "0.7.2"
@ -3514,15 +3627,6 @@ dependencies = [
"rand_core",
]
[[package]]
name = "simd-abstraction"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987"
dependencies = [
"outref",
]
[[package]]
name = "simdutf8"
version = "0.1.4"
@ -4253,6 +4357,12 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "vsimd"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64"
[[package]]
name = "walkdir"
version = "2.3.2"
@ -4566,6 +4676,12 @@ dependencies = [
"lzma-sys",
]
[[package]]
name = "yansi"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
[[package]]
name = "zeroize"
version = "1.5.7"

View file

@ -25,8 +25,8 @@ attic-token = { path = "../token" }
anyhow = "1.0.69"
async-stream = "0.3.4"
async-trait = "0.1.65"
aws-config = "0.52.0"
aws-sdk-s3 = "0.22.0"
aws-config = "0.54.1"
aws-sdk-s3 = "0.24.0"
axum = "0.6.10"
axum-macros = "0.3.5"
base64 = "0.20.0"

View file

@ -9,7 +9,7 @@ use aws_sdk_s3::{
config::Builder as S3ConfigBuilder,
model::{CompletedMultipartUpload, CompletedPart},
presigning::config::PresigningConfig,
Client, Credentials, Endpoint, Region,
Client, Credentials, Region,
};
use bytes::BytesMut;
use futures::future::join_all;
@ -106,8 +106,7 @@ impl S3Backend {
}
if let Some(endpoint) = &config.endpoint {
let endpoint = Endpoint::immutable(endpoint).map_err(ServerError::storage_error)?;
builder = builder.endpoint_resolver(endpoint);
builder = builder.endpoint_url(endpoint).force_path_style(true);
}
Ok(builder)