Dependency upgrades: http, hyper, aws-sdk, smaller deps #703

Merged
lx merged 14 commits from dep-upgrade-202402 into main 2024-02-07 14:59:41 +00:00
11 changed files with 1077 additions and 533 deletions
Showing only changes of commit 6e4229e29c - Show all commits

484
Cargo.lock generated
View file

@ -191,99 +191,108 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]] [[package]]
name = "aws-config" name = "aws-config"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcdcf0d683fe9c23d32cf5b53c9918ea0a500375a9fb20109802552658e576c9" checksum = "8b30c39ebe61f75d1b3785362b1586b41991873c9ab3e317a9181c246fb71d82"
dependencies = [ dependencies = [
"aws-credential-types", "aws-credential-types",
"aws-http", "aws-runtime",
"aws-sdk-sso", "aws-sdk-sso",
"aws-sdk-ssooidc",
"aws-sdk-sts", "aws-sdk-sts",
"aws-smithy-async", "aws-smithy-async",
"aws-smithy-client",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json", "aws-smithy-json",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"aws-types", "aws-types",
"bytes", "bytes",
"fastrand 1.9.0", "fastrand",
"hex", "hex",
"http 0.2.11", "http 0.2.11",
"hyper", "hyper",
"ring 0.16.20", "ring 0.17.7",
"time", "time",
"tokio", "tokio",
"tower",
"tracing", "tracing",
"zeroize", "zeroize",
] ]
[[package]] [[package]]
name = "aws-credential-types" name = "aws-credential-types"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fcdb2f7acbc076ff5ad05e7864bdb191ca70a6fd07668dc3a1a8bcd051de5ae" checksum = "33cc49dcdd31c8b6e79850a179af4c367669150c7ac0135f176c61bec81a70f7"
dependencies = [ dependencies = [
"aws-smithy-async", "aws-smithy-async",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"fastrand 1.9.0",
"tokio",
"tracing",
"zeroize", "zeroize",
] ]
[[package]] [[package]]
name = "aws-endpoint" name = "aws-runtime"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cce1c41a6cfaa726adee9ebb9a56fcd2bbfd8be49fd8a04c5e20fd968330b04" checksum = "eb031bff99877c26c28895766f7bb8484a05e24547e370768d6cc9db514662aa"
dependencies = [ dependencies = [
"aws-credential-types",
"aws-sigv4",
"aws-smithy-async",
"aws-smithy-eventstream",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"aws-types", "aws-types",
"bytes",
"fastrand",
"http 0.2.11", "http 0.2.11",
"regex", "http-body",
"percent-encoding",
"pin-project-lite",
"tracing", "tracing",
"uuid",
] ]
[[package]] [[package]]
name = "aws-http" name = "aws-sdk-config"
version = "0.55.3" version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aadbc44e7a8f3e71c8b374e03ecd972869eb91dd2bc89ed018954a52ba84bc44" checksum = "4af4f5b0f64563ada272e009cc95027effb546110ed85d014611420ac0d97858"
dependencies = [ dependencies = [
"aws-credential-types", "aws-credential-types",
"aws-runtime",
"aws-smithy-async",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-json",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"aws-types", "aws-types",
"bytes", "bytes",
"http 0.2.11", "http 0.2.11",
"http-body", "once_cell",
"lazy_static", "regex-lite",
"percent-encoding",
"pin-project-lite",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "aws-sdk-s3" name = "aws-sdk-s3"
version = "0.28.0" version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fba197193cbb4bcb6aad8d99796b2291f36fa89562ded5d4501363055b0de89f" checksum = "951f7730f51a2155c711c85c79f337fbc02a577fa99d2a0a8059acfce5392113"
dependencies = [ dependencies = [
"aws-credential-types", "aws-credential-types",
"aws-endpoint", "aws-runtime",
"aws-http",
"aws-sig-auth",
"aws-sigv4", "aws-sigv4",
"aws-smithy-async", "aws-smithy-async",
"aws-smithy-checksums", "aws-smithy-checksums",
"aws-smithy-client",
"aws-smithy-eventstream", "aws-smithy-eventstream",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json", "aws-smithy-json",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"aws-smithy-xml", "aws-smithy-xml",
"aws-types", "aws-types",
@ -292,117 +301,123 @@ dependencies = [
"http-body", "http-body",
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"regex", "regex-lite",
"tokio-stream",
"tower",
"tracing", "tracing",
"url", "url",
] ]
[[package]] [[package]]
name = "aws-sdk-sso" name = "aws-sdk-sso"
version = "0.28.0" version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8b812340d86d4a766b2ca73f740dfd47a97c2dff0c06c8517a16d88241957e4" checksum = "f486420a66caad72635bc2ce0ff6581646e0d32df02aa39dc983bfe794955a5b"
dependencies = [ dependencies = [
"aws-credential-types", "aws-credential-types",
"aws-endpoint", "aws-runtime",
"aws-http",
"aws-sig-auth",
"aws-smithy-async", "aws-smithy-async",
"aws-smithy-client",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json", "aws-smithy-json",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"aws-types", "aws-types",
"bytes", "bytes",
"http 0.2.11", "http 0.2.11",
"regex", "once_cell",
"tokio-stream", "regex-lite",
"tower", "tracing",
]
[[package]]
name = "aws-sdk-ssooidc"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39ddccf01d82fce9b4a15c8ae8608211ee7db8ed13a70b514bbfe41df3d24841"
dependencies = [
"aws-credential-types",
"aws-runtime",
"aws-smithy-async",
"aws-smithy-http",
"aws-smithy-json",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types",
"aws-types",
"bytes",
"http 0.2.11",
"once_cell",
"regex-lite",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "aws-sdk-sts" name = "aws-sdk-sts"
version = "0.28.0" version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "265fac131fbfc188e5c3d96652ea90ecc676a934e3174eaaee523c6cec040b3b" checksum = "1a591f8c7e6a621a501b2b5d2e88e1697fcb6274264523a6ad4d5959889a41ce"
dependencies = [ dependencies = [
"aws-credential-types", "aws-credential-types",
"aws-endpoint", "aws-runtime",
"aws-http",
"aws-sig-auth",
"aws-smithy-async", "aws-smithy-async",
"aws-smithy-client",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json", "aws-smithy-json",
"aws-smithy-query", "aws-smithy-query",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"aws-smithy-xml", "aws-smithy-xml",
"aws-types", "aws-types",
"bytes",
"http 0.2.11",
"regex",
"tower",
"tracing",
]
[[package]]
name = "aws-sig-auth"
version = "0.55.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b94acb10af0c879ecd5c7bdf51cda6679a0a4f4643ce630905a77673bfa3c61"
dependencies = [
"aws-credential-types",
"aws-sigv4",
"aws-smithy-eventstream",
"aws-smithy-http",
"aws-types",
"http 0.2.11", "http 0.2.11",
"once_cell",
"regex-lite",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "aws-sigv4" name = "aws-sigv4"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d2ce6f507be68e968a33485ced670111d1cbad161ddbbab1e313c03d37d8f4c" checksum = "c371c6b0ac54d4605eb6f016624fb5c7c2925d315fdf600ac1bf21b19d5f1742"
dependencies = [ dependencies = [
"aws-credential-types",
"aws-smithy-eventstream", "aws-smithy-eventstream",
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-runtime-api",
"aws-smithy-types",
"bytes", "bytes",
"crypto-bigint 0.5.5",
"form_urlencoded", "form_urlencoded",
"hex", "hex",
"hmac", "hmac",
"http 0.2.11", "http 0.2.11",
"http 1.0.0",
"once_cell", "once_cell",
"p256",
"percent-encoding", "percent-encoding",
"regex", "ring 0.17.7",
"sha2", "sha2",
"subtle",
"time", "time",
"tracing", "tracing",
"zeroize",
] ]
[[package]] [[package]]
name = "aws-smithy-async" name = "aws-smithy-async"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13bda3996044c202d75b91afeb11a9afae9db9a721c6a7a427410018e286b880" checksum = "72ee2d09cce0ef3ae526679b522835d63e75fb427aca5413cd371e490d52dcc6"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"pin-project-lite", "pin-project-lite",
"tokio", "tokio",
"tokio-stream",
] ]
[[package]] [[package]]
name = "aws-smithy-checksums" name = "aws-smithy-checksums"
version = "0.55.3" version = "0.60.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07ed8b96d95402f3f6b8b57eb4e0e45ee365f78b1a924faf20ff6e97abf1eae6" checksum = "be2acd1b9c6ae5859999250ed5a62423aedc5cf69045b844432de15fa2f31f2b"
dependencies = [ dependencies = [
"aws-smithy-http", "aws-smithy-http",
"aws-smithy-types", "aws-smithy-types",
@ -419,35 +434,11 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "aws-smithy-client"
version = "0.55.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a86aa6e21e86c4252ad6a0e3e74da9617295d8d6e374d552be7d3059c41cedd"
dependencies = [
"aws-smithy-async",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-types",
"bytes",
"fastrand 1.9.0",
"http 0.2.11",
"http-body",
"hyper",
"hyper-rustls 0.23.2",
"lazy_static",
"pin-project-lite",
"rustls 0.20.9",
"tokio",
"tower",
"tracing",
]
[[package]] [[package]]
name = "aws-smithy-eventstream" name = "aws-smithy-eventstream"
version = "0.55.3" version = "0.60.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460c8da5110835e3d9a717c61f5556b20d03c32a1dec57f8fc559b360f733bb8" checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858"
dependencies = [ dependencies = [
"aws-smithy-types", "aws-smithy-types",
"bytes", "bytes",
@ -456,94 +447,126 @@ dependencies = [
[[package]] [[package]]
name = "aws-smithy-http" name = "aws-smithy-http"
version = "0.55.3" version = "0.60.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b3b693869133551f135e1f2c77cb0b8277d9e3e17feaf2213f735857c4f0d28" checksum = "dab56aea3cd9e1101a0a999447fb346afb680ab1406cebc44b32346e25b4117d"
dependencies = [ dependencies = [
"aws-smithy-eventstream", "aws-smithy-eventstream",
"aws-smithy-runtime-api",
"aws-smithy-types", "aws-smithy-types",
"bytes", "bytes",
"bytes-utils", "bytes-utils",
"futures-core", "futures-core",
"http 0.2.11", "http 0.2.11",
"http-body", "http-body",
"hyper",
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"pin-utils", "pin-utils",
"tokio",
"tokio-util 0.7.10",
"tracing",
]
[[package]]
name = "aws-smithy-http-tower"
version = "0.55.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ae4f6c5798a247fac98a867698197d9ac22643596dc3777f0c76b91917616b9"
dependencies = [
"aws-smithy-http",
"aws-smithy-types",
"bytes",
"http 0.2.11",
"http-body",
"pin-project-lite",
"tower",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "aws-smithy-json" name = "aws-smithy-json"
version = "0.55.3" version = "0.60.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23f9f42fbfa96d095194a632fbac19f60077748eba536eb0b9fecc28659807f8" checksum = "fd3898ca6518f9215f62678870064398f00031912390efd03f1f6ef56d83aa8e"
dependencies = [ dependencies = [
"aws-smithy-types", "aws-smithy-types",
] ]
[[package]] [[package]]
name = "aws-smithy-query" name = "aws-smithy-query"
version = "0.55.3" version = "0.60.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98819eb0b04020a1c791903533b638534ae6c12e2aceda3e6e6fba015608d51d" checksum = "bda4b1dfc9810e35fba8a620e900522cd1bd4f9578c446e82f49d1ce41d2e9f9"
dependencies = [ dependencies = [
"aws-smithy-types", "aws-smithy-types",
"urlencoding", "urlencoding",
] ]
[[package]] [[package]]
name = "aws-smithy-types" name = "aws-smithy-runtime"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16a3d0bf4f324f4ef9793b86a1701d9700fbcdbd12a846da45eed104c634c6e8" checksum = "fafdab38f40ad7816e7da5dec279400dd505160780083759f01441af1bbb10ea"
dependencies = [
"aws-smithy-async",
"aws-smithy-http",
"aws-smithy-runtime-api",
"aws-smithy-types",
"bytes",
"fastrand",
"h2",
"http 0.2.11",
"http-body",
"hyper",
"hyper-rustls 0.24.2",
"once_cell",
"pin-project-lite",
"pin-utils",
"rustls 0.21.10",
"tokio",
"tracing",
]
[[package]]
name = "aws-smithy-runtime-api"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c18276dd28852f34b3bf501f4f3719781f4999a51c7bff1a5c6dc8c4529adc29"
dependencies = [
"aws-smithy-async",
"aws-smithy-types",
"bytes",
"http 0.2.11",
"pin-project-lite",
"tokio",
"tracing",
"zeroize",
]
[[package]]
name = "aws-smithy-types"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb3e134004170d3303718baa2a4eb4ca64ee0a1c0a7041dca31b38be0fb414f3"
dependencies = [ dependencies = [
"base64-simd", "base64-simd",
"bytes",
"bytes-utils",
"futures-core",
"http 0.2.11",
"http-body",
"itoa", "itoa",
"num-integer", "num-integer",
"pin-project-lite",
"pin-utils",
"ryu", "ryu",
"serde",
"time", "time",
"tokio",
"tokio-util 0.7.10",
] ]
[[package]] [[package]]
name = "aws-smithy-xml" name = "aws-smithy-xml"
version = "0.55.3" version = "0.60.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1b9d12875731bd07e767be7baad95700c3137b56730ec9ddeedb52a5e5ca63b" checksum = "8604a11b25e9ecaf32f9aa56b9fe253c5e2f606a3477f0071e96d3155a5ed218"
dependencies = [ dependencies = [
"xmlparser", "xmlparser",
] ]
[[package]] [[package]]
name = "aws-types" name = "aws-types"
version = "0.55.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dd209616cc8d7bfb82f87811a5c655dc97537f592689b18743bddf5dc5c4829" checksum = "789bbe008e65636fe1b6dbbb374c40c8960d1232b96af5ff4aec349f9c4accf4"
dependencies = [ dependencies = [
"aws-credential-types", "aws-credential-types",
"aws-smithy-async", "aws-smithy-async",
"aws-smithy-client", "aws-smithy-runtime-api",
"aws-smithy-http",
"aws-smithy-types", "aws-smithy-types",
"http 0.2.11", "http 0.2.11",
"rustc_version", "rustc_version",
@ -576,6 +599,12 @@ dependencies = [
"rustc-demangle", "rustc-demangle",
] ]
[[package]]
name = "base16ct"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.13.1" version = "0.13.1"
@ -598,6 +627,12 @@ dependencies = [
"vsimd", "vsimd",
] ]
[[package]]
name = "base64ct"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]] [[package]]
name = "bincode" name = "bincode"
version = "1.3.3" version = "1.3.3"
@ -771,6 +806,12 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "const-oid"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.4" version = "0.9.4"
@ -847,6 +888,28 @@ version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
[[package]]
name = "crypto-bigint"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef"
dependencies = [
"generic-array",
"rand_core",
"subtle",
"zeroize",
]
[[package]]
name = "crypto-bigint"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76"
dependencies = [
"rand_core",
"subtle",
]
[[package]] [[package]]
name = "crypto-common" name = "crypto-common"
version = "0.1.6" version = "0.1.6"
@ -902,6 +965,16 @@ dependencies = [
"num_cpus", "num_cpus",
] ]
[[package]]
name = "der"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de"
dependencies = [
"const-oid",
"zeroize",
]
[[package]] [[package]]
name = "deranged" name = "deranged"
version = "0.3.11" version = "0.3.11"
@ -960,12 +1033,44 @@ version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d"
[[package]]
name = "ecdsa"
version = "0.14.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c"
dependencies = [
"der",
"elliptic-curve",
"rfc6979",
"signature",
]
[[package]] [[package]]
name = "either" name = "either"
version = "1.9.0" version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "elliptic-curve"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3"
dependencies = [
"base16ct",
"crypto-bigint 0.4.9",
"der",
"digest",
"ff",
"generic-array",
"group",
"pkcs8",
"rand_core",
"sec1",
"subtle",
"zeroize",
]
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
version = "0.8.33" version = "0.8.33"
@ -1017,21 +1122,22 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]]
name = "fastrand"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "2.0.1" version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
[[package]]
name = "ff"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160"
dependencies = [
"rand_core",
"subtle",
]
[[package]] [[package]]
name = "fixedbitset" name = "fixedbitset"
version = "0.4.2" version = "0.4.2"
@ -1497,6 +1603,17 @@ dependencies = [
"syn 2.0.48", "syn 2.0.48",
] ]
[[package]]
name = "group"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7"
dependencies = [
"ff",
"rand_core",
"subtle",
]
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.3.24" version = "0.3.24"
@ -1928,6 +2045,7 @@ dependencies = [
name = "k2v-client" name = "k2v-client"
version = "0.0.4" version = "0.0.4"
dependencies = [ dependencies = [
"aws-sdk-config",
"aws-sigv4", "aws-sigv4",
"base64 0.21.7", "base64 0.21.7",
"clap 4.4.18", "clap 4.4.18",
@ -2537,6 +2655,17 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "p256"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594"
dependencies = [
"ecdsa",
"elliptic-curve",
"sha2",
]
[[package]] [[package]]
name = "page_size" name = "page_size"
version = "0.4.2" version = "0.4.2"
@ -2669,6 +2798,16 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkcs8"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
dependencies = [
"der",
"spki",
]
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.29" version = "0.3.29"
@ -2936,6 +3075,12 @@ dependencies = [
"regex-syntax 0.8.2", "regex-syntax 0.8.2",
] ]
[[package]]
name = "regex-lite"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e"
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.29" version = "0.6.29"
@ -2988,6 +3133,17 @@ dependencies = [
"winreg", "winreg",
] ]
[[package]]
name = "rfc6979"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb"
dependencies = [
"crypto-bigint 0.4.9",
"hmac",
"zeroize",
]
[[package]] [[package]]
name = "ring" name = "ring"
version = "0.16.20" version = "0.16.20"
@ -3212,6 +3368,20 @@ dependencies = [
"untrusted 0.9.0", "untrusted 0.9.0",
] ]
[[package]]
name = "sec1"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928"
dependencies = [
"base16ct",
"der",
"generic-array",
"pkcs8",
"subtle",
"zeroize",
]
[[package]] [[package]]
name = "secrecy" name = "secrecy"
version = "0.8.0" version = "0.8.0"
@ -3386,6 +3556,16 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "signature"
version = "1.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
dependencies = [
"digest",
"rand_core",
]
[[package]] [[package]]
name = "slab" name = "slab"
version = "0.4.9" version = "0.4.9"
@ -3439,6 +3619,16 @@ version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
[[package]]
name = "spki"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
dependencies = [
"base64ct",
"der",
]
[[package]] [[package]]
name = "static_init" name = "static_init"
version = "1.0.3" version = "1.0.3"
@ -3580,7 +3770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"fastrand 2.0.1", "fastrand",
"redox_syscall 0.4.1", "redox_syscall 0.4.1",
"rustix", "rustix",
"windows-sys 0.52.0", "windows-sys 0.52.0",

977
Cargo.nix

File diff suppressed because it is too large Load diff

View file

@ -115,7 +115,7 @@ opentelemetry-otlp = "0.10"
prometheus = "0.13" prometheus = "0.13"
# used by the k2v-client crate only # used by the k2v-client crate only
aws-sigv4 = "0.55" aws-sigv4 = {version = "1.1", features = ["http0-compat"] }
hyper-rustls = { version = "0.24", features = ["http2"] } hyper-rustls = { version = "0.24", features = ["http2"] }
log = "0.4" log = "0.4"
thiserror = "1.0" thiserror = "1.0"
@ -125,8 +125,9 @@ assert-json-diff = "2.0"
rustc_version = "0.4.0" rustc_version = "0.4.0"
static_init = "1.0" static_init = "1.0"
aws-config = "0.55.2" aws-config = "1.1.4"
aws-sdk-s3 = "0.28" aws-sdk-config = "1.13"
aws-sdk-s3 = "1.14"
[profile.dev] [profile.dev]
lto = "off" lto = "off"

View file

@ -1,3 +1,4 @@
use aws_sdk_s3::config::BehaviorVersion;
use aws_sdk_s3::config::Credentials; use aws_sdk_s3::config::Credentials;
use aws_sdk_s3::{Client, Config}; use aws_sdk_s3::{Client, Config};
@ -11,6 +12,7 @@ pub fn build_client(key: &Key) -> Client {
.endpoint_url(format!("http://127.0.0.1:{}", DEFAULT_PORT)) .endpoint_url(format!("http://127.0.0.1:{}", DEFAULT_PORT))
.region(super::REGION) .region(super::REGION)
.credentials_provider(credentials) .credentials_provider(credentials)
.behavior_version(BehaviorVersion::v2023_11_09())
.build(); .build();
Client::from_conf(config) Client::from_conf(config)

View file

@ -154,7 +154,7 @@ async fn test_multipart_upload() {
.await .await
.unwrap(); .unwrap();
assert_eq!(r.content_length, (SZ_5MB * 3) as i64); assert_eq!(r.content_length.unwrap(), (SZ_5MB * 3) as i64);
} }
{ {
@ -183,7 +183,7 @@ async fn test_multipart_upload() {
.unwrap(); .unwrap();
eprintln!("get_object with part_number = {}", part_number); eprintln!("get_object with part_number = {}", part_number);
assert_eq!(o.content_length, SZ_5MB as i64); assert_eq!(o.content_length.unwrap(), SZ_5MB as i64);
assert_bytes_eq!(o.body, data); assert_bytes_eq!(o.body, data);
} }
} }
@ -249,14 +249,14 @@ async fn test_uploadlistpart() {
let ps = r.parts.unwrap(); let ps = r.parts.unwrap();
assert_eq!(ps.len(), 1); assert_eq!(ps.len(), 1);
assert_eq!(ps[0].part_number, 2); assert_eq!(ps[0].part_number.unwrap(), 2);
let fp = &ps[0]; let fp = &ps[0];
assert!(fp.last_modified.is_some()); assert!(fp.last_modified.is_some());
assert_eq!( assert_eq!(
fp.e_tag.as_ref().unwrap(), fp.e_tag.as_ref().unwrap(),
"\"3366bb9dcf710d6801b5926467d02e19\"" "\"3366bb9dcf710d6801b5926467d02e19\""
); );
assert_eq!(fp.size, SZ_5MB as i64); assert_eq!(fp.size.unwrap(), SZ_5MB as i64);
} }
let p2 = ctx let p2 = ctx
@ -286,23 +286,23 @@ async fn test_uploadlistpart() {
let ps = r.parts.unwrap(); let ps = r.parts.unwrap();
assert_eq!(ps.len(), 2); assert_eq!(ps.len(), 2);
assert_eq!(ps[0].part_number, 1); assert_eq!(ps[0].part_number.unwrap(), 1);
let fp = &ps[0]; let fp = &ps[0];
assert!(fp.last_modified.is_some()); assert!(fp.last_modified.is_some());
assert_eq!( assert_eq!(
fp.e_tag.as_ref().unwrap(), fp.e_tag.as_ref().unwrap(),
"\"3c484266f9315485694556e6c693bfa2\"" "\"3c484266f9315485694556e6c693bfa2\""
); );
assert_eq!(fp.size, SZ_5MB as i64); assert_eq!(fp.size.unwrap(), SZ_5MB as i64);
assert_eq!(ps[1].part_number, 2); assert_eq!(ps[1].part_number.unwrap(), 2);
let sp = &ps[1]; let sp = &ps[1];
assert!(sp.last_modified.is_some()); assert!(sp.last_modified.is_some());
assert_eq!( assert_eq!(
sp.e_tag.as_ref().unwrap(), sp.e_tag.as_ref().unwrap(),
"\"3366bb9dcf710d6801b5926467d02e19\"" "\"3366bb9dcf710d6801b5926467d02e19\""
); );
assert_eq!(sp.size, SZ_5MB as i64); assert_eq!(sp.size.unwrap(), SZ_5MB as i64);
} }
{ {
@ -320,14 +320,14 @@ async fn test_uploadlistpart() {
assert!(r.part_number_marker.is_none()); assert!(r.part_number_marker.is_none());
assert_eq!(r.next_part_number_marker.as_deref(), Some("1")); assert_eq!(r.next_part_number_marker.as_deref(), Some("1"));
assert_eq!(r.max_parts, 1_i32); assert_eq!(r.max_parts.unwrap(), 1_i32);
assert!(r.is_truncated); assert!(r.is_truncated.unwrap());
assert_eq!(r.key.unwrap(), "a"); assert_eq!(r.key.unwrap(), "a");
assert_eq!(r.upload_id.unwrap().as_str(), uid.as_str()); assert_eq!(r.upload_id.unwrap().as_str(), uid.as_str());
let parts = r.parts.unwrap(); let parts = r.parts.unwrap();
assert_eq!(parts.len(), 1); assert_eq!(parts.len(), 1);
let fp = &parts[0]; let fp = &parts[0];
assert_eq!(fp.part_number, 1); assert_eq!(fp.part_number.unwrap(), 1);
assert_eq!( assert_eq!(
fp.e_tag.as_ref().unwrap(), fp.e_tag.as_ref().unwrap(),
"\"3c484266f9315485694556e6c693bfa2\"" "\"3c484266f9315485694556e6c693bfa2\""
@ -349,19 +349,19 @@ async fn test_uploadlistpart() {
r2.part_number_marker.as_ref().unwrap(), r2.part_number_marker.as_ref().unwrap(),
r.next_part_number_marker.as_ref().unwrap() r.next_part_number_marker.as_ref().unwrap()
); );
assert_eq!(r2.max_parts, 1_i32); assert_eq!(r2.max_parts.unwrap(), 1_i32);
assert_eq!(r2.key.unwrap(), "a"); assert_eq!(r2.key.unwrap(), "a");
assert_eq!(r2.upload_id.unwrap().as_str(), uid.as_str()); assert_eq!(r2.upload_id.unwrap().as_str(), uid.as_str());
let parts = r2.parts.unwrap(); let parts = r2.parts.unwrap();
assert_eq!(parts.len(), 1); assert_eq!(parts.len(), 1);
let fp = &parts[0]; let fp = &parts[0];
assert_eq!(fp.part_number, 2); assert_eq!(fp.part_number.unwrap(), 2);
assert_eq!( assert_eq!(
fp.e_tag.as_ref().unwrap(), fp.e_tag.as_ref().unwrap(),
"\"3366bb9dcf710d6801b5926467d02e19\"" "\"3366bb9dcf710d6801b5926467d02e19\""
); );
//assert!(r2.is_truncated); // WHY? (this was the test before) //assert!(r2.is_truncated); // WHY? (this was the test before)
assert!(!r2.is_truncated); assert!(!r2.is_truncated.unwrap());
} }
let cmp = CompletedMultipartUpload::builder() let cmp = CompletedMultipartUpload::builder()
@ -411,7 +411,7 @@ async fn test_uploadlistpart() {
.await .await
.unwrap(); .unwrap();
assert_eq!(r.content_length, (SZ_5MB * 2) as i64); assert_eq!(r.content_length.unwrap(), (SZ_5MB * 2) as i64);
} }
} }

View file

@ -50,9 +50,9 @@ async fn test_putobject() {
// assert_eq!(o.version_id.unwrap(), _version); // assert_eq!(o.version_id.unwrap(), _version);
assert_eq!(o.content_type.unwrap(), content_type); assert_eq!(o.content_type.unwrap(), content_type);
assert!(o.last_modified.is_some()); assert!(o.last_modified.is_some());
assert_eq!(o.content_length, 0); assert_eq!(o.content_length.unwrap(), 0);
assert_eq!(o.parts_count, 0); assert_eq!(o.parts_count, None);
assert_eq!(o.tag_count, 0); assert_eq!(o.tag_count, None);
} }
{ {
@ -86,9 +86,9 @@ async fn test_putobject() {
assert_bytes_eq!(o.body, b"hi"); assert_bytes_eq!(o.body, b"hi");
assert_eq!(o.e_tag.unwrap(), etag); assert_eq!(o.e_tag.unwrap(), etag);
assert!(o.last_modified.is_some()); assert!(o.last_modified.is_some());
assert_eq!(o.content_length, 2); assert_eq!(o.content_length.unwrap(), 2);
assert_eq!(o.parts_count, 0); assert_eq!(o.parts_count, None);
assert_eq!(o.tag_count, 0); assert_eq!(o.tag_count, None);
} }
{ {
@ -119,9 +119,9 @@ async fn test_putobject() {
assert_bytes_eq!(o.body, b""); assert_bytes_eq!(o.body, b"");
assert_eq!(o.e_tag.unwrap(), etag); assert_eq!(o.e_tag.unwrap(), etag);
assert!(o.last_modified.is_some()); assert!(o.last_modified.is_some());
assert_eq!(o.content_length, 0); assert_eq!(o.content_length.unwrap(), 0);
assert_eq!(o.parts_count, 0); assert_eq!(o.parts_count, None);
assert_eq!(o.tag_count, 0); assert_eq!(o.tag_count, None);
} }
} }
@ -205,7 +205,7 @@ async fn test_deleteobject() {
.await .await
.unwrap(); .unwrap();
if i > 0 { if i > 0 {
to_del = to_del.objects(ObjectIdentifier::builder().key(k).build()); to_del = to_del.objects(ObjectIdentifier::builder().key(k).build().unwrap());
} }
} }
@ -223,7 +223,7 @@ async fn test_deleteobject() {
.unwrap(); .unwrap();
if i > 0 { if i > 0 {
to_del = to_del.objects(ObjectIdentifier::builder().key(k).build()); to_del = to_del.objects(ObjectIdentifier::builder().key(k).build().unwrap());
} }
} }
@ -247,7 +247,7 @@ async fn test_deleteobject() {
.client .client
.delete_objects() .delete_objects()
.bucket(&bucket) .bucket(&bucket)
.delete(to_del.build()) .delete(to_del.build().unwrap())
.send() .send()
.await .await
.unwrap(); .unwrap();

View file

@ -57,9 +57,9 @@ async fn test_putobject_streaming() {
// assert_eq!(o.version_id.unwrap(), _version); // assert_eq!(o.version_id.unwrap(), _version);
assert_eq!(o.content_type.unwrap(), content_type); assert_eq!(o.content_type.unwrap(), content_type);
assert!(o.last_modified.is_some()); assert!(o.last_modified.is_some());
assert_eq!(o.content_length, 0); assert_eq!(o.content_length.unwrap(), 0);
assert_eq!(o.parts_count, 0); assert_eq!(o.parts_count, None);
assert_eq!(o.tag_count, 0); assert_eq!(o.tag_count, None);
} }
{ {
@ -95,9 +95,9 @@ async fn test_putobject_streaming() {
assert_bytes_eq!(o.body, BODY); assert_bytes_eq!(o.body, BODY);
assert_eq!(o.e_tag.unwrap(), etag); assert_eq!(o.e_tag.unwrap(), etag);
assert!(o.last_modified.is_some()); assert!(o.last_modified.is_some());
assert_eq!(o.content_length, 62); assert_eq!(o.content_length.unwrap(), 62);
assert_eq!(o.parts_count, 0); assert_eq!(o.parts_count, None);
assert_eq!(o.tag_count, 0); assert_eq!(o.tag_count, None);
} }
} }
@ -187,7 +187,7 @@ async fn test_put_website_streaming() {
.await .await
.unwrap(); .unwrap();
assert_eq!(o.index_document.unwrap().suffix.unwrap(), "home.html"); assert_eq!(o.index_document.unwrap().suffix, "home.html");
assert_eq!(o.error_document.unwrap().key.unwrap(), "err/error.html"); assert_eq!(o.error_document.unwrap().key, "err/error.html");
} }
} }

View file

@ -181,8 +181,18 @@ async fn test_website_s3_api() {
.unwrap(); .unwrap();
let conf = WebsiteConfiguration::builder() let conf = WebsiteConfiguration::builder()
.index_document(IndexDocument::builder().suffix("home.html").build()) .index_document(
.error_document(ErrorDocument::builder().key("err/error.html").build()) IndexDocument::builder()
.suffix("home.html")
.build()
.unwrap(),
)
.error_document(
ErrorDocument::builder()
.key("err/error.html")
.build()
.unwrap(),
)
.build(); .build();
ctx.client ctx.client
@ -201,9 +211,11 @@ async fn test_website_s3_api() {
.allowed_methods("GET") .allowed_methods("GET")
.allowed_methods("PUT") .allowed_methods("PUT")
.allowed_origins("*") .allowed_origins("*")
.build(), .build()
.unwrap(),
) )
.build(); .build()
.unwrap();
ctx.client ctx.client
.put_bucket_cors() .put_bucket_cors()
@ -222,19 +234,16 @@ async fn test_website_s3_api() {
.await .await
.unwrap(); .unwrap();
let main_rule = cors_res.cors_rules().unwrap().iter().next().unwrap(); let main_rule = cors_res.cors_rules().iter().next().unwrap();
assert_eq!(main_rule.id.as_ref().unwrap(), "main-rule"); assert_eq!(main_rule.id.as_ref().unwrap(), "main-rule");
assert_eq!( assert_eq!(
main_rule.allowed_headers.as_ref().unwrap(), main_rule.allowed_headers.as_ref().unwrap(),
&vec!["*".to_string()] &vec!["*".to_string()]
); );
assert_eq!(&main_rule.allowed_origins, &vec!["*".to_string()]);
assert_eq!( assert_eq!(
main_rule.allowed_origins.as_ref().unwrap(), &main_rule.allowed_methods,
&vec!["*".to_string()]
);
assert_eq!(
main_rule.allowed_methods.as_ref().unwrap(),
&vec!["GET".to_string(), "PUT".to_string()] &vec!["GET".to_string(), "PUT".to_string()]
); );
} }

View file

@ -15,6 +15,7 @@ hex.workspace = true
http.workspace = true http.workspace = true
log.workspace = true log.workspace = true
aws-sigv4.workspace = true aws-sigv4.workspace = true
aws-sdk-config.workspace = true
percent-encoding.workspace = true percent-encoding.workspace = true
hyper = { workspace = true, default-features = false, features = ["client", "http1", "http2"] } hyper = { workspace = true, default-features = false, features = ["client", "http1", "http2"] }
hyper-rustls.workspace = true hyper-rustls.workspace = true

View file

@ -27,7 +27,7 @@ pub enum Error {
#[error("deserialization error: {0}")] #[error("deserialization error: {0}")]
Deserialization(#[from] serde_json::Error), Deserialization(#[from] serde_json::Error),
#[error("invalid signature parameters: {0}")] #[error("invalid signature parameters: {0}")]
SignParameters(#[from] aws_sigv4::signing_params::BuildError), SignParameters(#[from] aws_sigv4::sign::v4::signing_params::BuildError),
#[error("could not sign request: {0}")] #[error("could not sign request: {0}")]
SignRequest(#[from] aws_sigv4::http_request::SigningError), SignRequest(#[from] aws_sigv4::http_request::SigningError),
#[error("request timed out")] #[error("request timed out")]

View file

@ -13,7 +13,9 @@ use hyper::{body::Bytes, Body};
use hyper::{client::connect::HttpConnector, Client as HttpClient}; use hyper::{client::connect::HttpConnector, Client as HttpClient};
use hyper_rustls::HttpsConnector; use hyper_rustls::HttpsConnector;
use aws_sigv4::http_request::{sign, SignableRequest, SigningParams, SigningSettings}; use aws_sdk_config::config::Credentials;
use aws_sigv4::http_request::{sign, SignableBody, SignableRequest, SigningSettings};
use aws_sigv4::sign::v4::SigningParams;
use serde::de::Error as DeError; use serde::de::Error as DeError;
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
@ -363,21 +365,37 @@ impl K2vClient {
// Sign request // Sign request
let signing_settings = SigningSettings::default(); let signing_settings = SigningSettings::default();
let identity = Credentials::new(
&self.config.aws_access_key_id,
&self.config.aws_secret_access_key,
None,
None,
"k2v-client",
)
.into();
let signing_params = SigningParams::builder() let signing_params = SigningParams::builder()
.access_key(&self.config.aws_access_key_id) .identity(&identity)
.secret_key(&self.config.aws_secret_access_key)
.region(&self.config.region) .region(&self.config.region)
.service_name(SERVICE) .name(SERVICE)
.time(SystemTime::now()) .time(SystemTime::now())
.settings(signing_settings) .settings(signing_settings)
.build()?; .build()?
.into();
// Convert the HTTP request into a signable request // Convert the HTTP request into a signable request
let signable_request = SignableRequest::from(&req); let signable_request = SignableRequest::new(
req.method().as_str(),
req.uri().to_string(),
// TODO: get rid of Unwrap
req.headers()
.iter()
.map(|(x, y)| (x.as_str(), y.to_str().unwrap())),
SignableBody::Bytes(req.body().as_ref()),
)?;
// Sign and then apply the signature to the request // Sign and then apply the signature to the request
let (signing_instructions, _signature) = let (signing_instructions, _signature) =
sign(signable_request, &signing_params)?.into_parts(); sign(signable_request, &signing_params)?.into_parts();
signing_instructions.apply_to_request(&mut req); signing_instructions.apply_to_request_http0x(&mut req);
// Send and wait for timeout // Send and wait for timeout
let res = tokio::select! { let res = tokio::select! {
@ -451,7 +469,11 @@ impl K2vClient {
} }
fn build_url<V: AsRef<str>>(&self, partition_key: Option<&str>, query: &[(&str, V)]) -> String { fn build_url<V: AsRef<str>>(&self, partition_key: Option<&str>, query: &[(&str, V)]) -> String {
let mut url = format!("{}/{}", self.config.endpoint, self.config.bucket); let mut url = format!(
"{}/{}",
self.config.endpoint.trim_end_matches('/'),
self.config.bucket
);
if let Some(pk) = partition_key { if let Some(pk) = partition_key {
url.push('/'); url.push('/');
url.extend(utf8_percent_encode(pk, &PATH_ENCODE_SET)); url.extend(utf8_percent_encode(pk, &PATH_ENCODE_SET));