diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac5fa1864..87b9466ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,7 @@ jobs: push: true tags: | ghcr.io/umccr/htsget-rs:latest + ## SOCI (Seekable OCI) support. Only enable when and if docker layers surpass 10MB in the future, see: # https://github.com/awslabs/soci-snapshotter/issues/100 # - name: Install aws SOCI diff --git a/Cargo.lock b/Cargo.lock index 4bb58e9b1..f1108cb39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" dependencies = [ - "bitflags 2.5.0", + "bitflags", "bytes", "futures-core", "futures-sink", @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "actix-cors" -version = "0.6.5" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0346d8c1f762b41b458ed3145eea914966bb9ad20b9be0d6d463b20d45586370" +checksum = "f9e772b3bcafe335042b5db010ab7c09013dad6eac4915c91d8d50902769f331" dependencies = [ "actix-utils", "actix-web", @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d223b13fd481fc0d1f83bb12659ae774d9e3601814c68a0bc539731698cca743" +checksum = "4eb9843d84c775696c37d9a418bbb01b932629d01870722c0f13eb3f95e2536d" dependencies = [ "actix-codec", "actix-rt", @@ -46,8 +46,8 @@ dependencies = [ "actix-tls", "actix-utils", "ahash", - "base64 0.21.7", - "bitflags 2.5.0", + "base64 0.22.1", + "bitflags", "brotli", "bytes", "bytestring", @@ -55,8 +55,8 @@ dependencies = [ "encoding_rs", "flate2", "futures-core", - "h2", - "http", + "h2 0.3.26", + "http 0.2.12", "httparse", "httpdate", "itoa", @@ -86,13 +86,15 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" +checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" dependencies = [ "bytestring", - "http", + "cfg-if", + "http 0.2.12", "regex", + "regex-lite", "serde", "tracing", ] @@ -137,9 +139,9 @@ dependencies = [ [[package]] name = "actix-tls" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cce60a2f2b477bc72e5cde0af1812a6e82d8fd85b5570a5dcf2a5bf2c5be5f" +checksum = "ac453898d866cdbecdbc2334fe1738c747b4eba14a677261f2b768ba05329389" dependencies = [ "actix-rt", "actix-service", @@ -147,11 +149,11 @@ dependencies = [ "futures-core", "impl-more", "pin-project-lite", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tracing", - "webpki-roots", ] [[package]] @@ -166,9 +168,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.5.1" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a6556ddebb638c2358714d853257ed226ece6023ef9364f23f0c70737ea984" +checksum = "b1cf67dadb19d7c95e5a299e2dda24193b89d5d4f33a3b9800888ede9e19aa32" dependencies = [ "actix-codec", "actix-http", @@ -196,6 +198,7 @@ dependencies = [ "once_cell", "pin-project-lite", "regex", + "regex-lite", "serde", "serde_json", "serde_urlencoded", @@ -269,6 +272,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -420,6 +429,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -428,75 +443,81 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-config" -version = "0.56.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6b3804dca60326e07205179847f17a4fce45af3a1106939177ad41ac08a6de" +checksum = "40ddbfb5db93d62521f47b3f223da0884a2f02741ff54cb9cda192a0e73ba08b" dependencies = [ "aws-credential-types", - "aws-http", + "aws-runtime", "aws-sdk-sso", + "aws-sdk-ssooidc", "aws-sdk-sts", "aws-smithy-async", - "aws-smithy-client", "aws-smithy-http", - "aws-smithy-http-tower", "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", "bytes", "fastrand", "hex", - "http", - "hyper", - "ring 0.16.20", + "http 0.2.12", + "hyper 0.14.28", + "ring", "time", "tokio", - "tower", "tracing", + "url", "zeroize", ] [[package]] name = "aws-credential-types" -version = "0.56.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a66ac8ef5fa9cf01c2d999f39d16812e90ec1467bd382cbbb74ba23ea86201" +checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" dependencies = [ "aws-smithy-async", + "aws-smithy-runtime-api", "aws-smithy-types", - "fastrand", - "tokio", - "tracing", "zeroize", ] [[package]] -name = "aws-http" -version = "0.56.1" +name = "aws-lc-rs" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e626370f9ba806ae4c439e49675fd871f5767b093075cdf4fef16cac42ba900" +checksum = "8487b59d62764df8231cb371c459314df895b41756df457a1fb1243d65c89195" dependencies = [ - "aws-credential-types", - "aws-smithy-http", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "http-body", - "lazy_static", - "percent-encoding", - "pin-project-lite", - "tracing", + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c15eb61145320320eb919d9bab524617a7aa4216c78d342fae3a758bc33073e4" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", ] [[package]] name = "aws-runtime" -version = "0.56.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ac5cf0ff19c1bca0cea7932e11b239d1025a45696a4f44f72ea86e2b8bdd07" +checksum = "75588e7ee5e8496eed939adac2035a6dbab9f7eb2acdd9ab2d31856dab6f3955" dependencies = [ "aws-credential-types", - "aws-http", "aws-sigv4", "aws-smithy-async", "aws-smithy-eventstream", @@ -504,26 +525,28 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", + "bytes", "fastrand", - "http", + "http 0.2.12", + "http-body 0.4.6", "percent-encoding", + "pin-project-lite", "tracing", "uuid", ] [[package]] name = "aws-sdk-s3" -version = "0.34.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f7a233b27af6e70094eafd43d9ee11da6e78eb2c1a31e5a7de737b782c627d" +checksum = "966646a69665bb0427460d78747204317f6639bdf5ec61305c4c5195af3dc086" dependencies = [ + "ahash", "aws-credential-types", - "aws-http", "aws-runtime", "aws-sigv4", "aws-smithy-async", "aws-smithy-checksums", - "aws-smithy-client", "aws-smithy-eventstream", "aws-smithy-http", "aws-smithy-json", @@ -533,27 +556,29 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", - "http", - "http-body", + "fastrand", + "hex", + "hmac", + "http 0.2.12", + "http-body 0.4.6", + "lru", "once_cell", "percent-encoding", - "regex", - "tokio-stream", + "regex-lite", + "sha2", "tracing", "url", ] [[package]] name = "aws-sdk-sso" -version = "0.30.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903f888ff190e64f6f5c83fb0f8d54f9c20481f1dc26359bb8896f5d99908949" +checksum = "fef2d9ca2b43051224ed326ed9960a85e277b7d554a2cd0397e57c0553d86e64" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-smithy-async", - "aws-smithy-client", "aws-smithy-http", "aws-smithy-json", "aws-smithy-runtime", @@ -561,23 +586,43 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http", - "regex", - "tokio-stream", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-ssooidc" +version = "1.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c869d1f5c4ee7437b79c3c1664ddbf7a60231e893960cf82b2b299a5ccf2cc5d" +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.12", + "once_cell", + "regex-lite", "tracing", ] [[package]] name = "aws-sdk-sts" -version = "0.30.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47ad6bf01afc00423d781d464220bf69fb6a674ad6629cbbcb06d88cdc2be82" +checksum = "9e2b4a632a59e4fab7abf1db0d94a3136ad7871aba46bebd1fdb95c7054afcdb" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-smithy-async", - "aws-smithy-client", "aws-smithy-http", "aws-smithy-json", "aws-smithy-query", @@ -586,49 +631,57 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "http", - "regex", + "http 0.2.12", + "once_cell", + "regex-lite", "tracing", ] [[package]] name = "aws-sigv4" -version = "0.56.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b28f4910bb956b7ab320b62e98096402354eca976c587d1eeccd523d9bac03" +checksum = "58b56f1cbe6fd4d0c2573df72868f20ab1c125ca9c9dbce17927a463433a2e57" dependencies = [ + "aws-credential-types", "aws-smithy-eventstream", "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", "bytes", + "crypto-bigint 0.5.5", "form_urlencoded", "hex", "hmac", - "http", + "http 0.2.12", + "http 1.1.0", "once_cell", + "p256", "percent-encoding", - "regex", + "ring", "sha2", + "subtle", "time", "tracing", + "zeroize", ] [[package]] name = "aws-smithy-async" -version = "0.56.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cdb73f85528b9d19c23a496034ac53703955a59323d581c06aa27b4e4e247af" +checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" dependencies = [ "futures-util", "pin-project-lite", "tokio", - "tokio-stream", ] [[package]] name = "aws-smithy-checksums" -version = "0.56.1" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb15946af1b8d3beeff53ad991d9bff68ac22426b6d40372b958a75fa61eaed" +checksum = "83fa43bc04a6b2441968faeab56e68da3812f978a670a5db32accbdcafddd12f" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -636,8 +689,8 @@ dependencies = [ "crc32c", "crc32fast", "hex", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "md-5", "pin-project-lite", "sha1", @@ -645,35 +698,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "aws-smithy-client" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27b2756264c82f830a91cb4d2d485b2d19ad5bea476d9a966e03d27f27ba59a" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-types", - "bytes", - "fastrand", - "http", - "http-body", - "hyper", - "hyper-rustls", - "lazy_static", - "pin-project-lite", - "rustls", - "tokio", - "tower", - "tracing", -] - [[package]] name = "aws-smithy-eventstream" -version = "0.56.1" +version = "0.60.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850233feab37b591b7377fd52063aa37af615687f5896807abe7f49bd4e1d25b" +checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" dependencies = [ "aws-smithy-types", "bytes", @@ -682,62 +711,45 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.56.1" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54cdcf365d8eee60686885f750a34c190e513677db58bbc466c44c588abf4199" +checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" dependencies = [ "aws-smithy-eventstream", + "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "bytes-utils", "futures-core", - "http", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", "once_cell", "percent-encoding", "pin-project-lite", "pin-utils", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "aws-smithy-http-tower" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822de399d0ce62829a69dfa8c5cd08efdbe61a7426b953e2268f8b8b52a607bd" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "http", - "http-body", - "pin-project-lite", - "tower", "tracing", ] [[package]] name = "aws-smithy-json" -version = "0.56.1" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1e7ab8fa7ad10c193af7ae56d2420989e9f4758bf03601a342573333ea34f" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-protocol-test" -version = "0.56.1" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30600c65e5a9bedccff93c75872731ddc8a38dafbf95a18ba752227ab04f8574" +checksum = "a31e8279cb24640c7349f2bda6ca818d5fcc85129386bd73c1d0999430d6ddf2" dependencies = [ "assert-json-diff", - "http", + "aws-smithy-runtime-api", + "http 0.2.12", "pretty_assertions", - "regex", + "regex-lite", "roxmltree", "serde_json", "thiserror", @@ -745,9 +757,9 @@ dependencies = [ [[package]] name = "aws-smithy-query" -version = "0.56.1" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28556a3902091c1f768a34f6c998028921bdab8d47d92586f363f14a4a32d047" +checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" dependencies = [ "aws-smithy-types", "urlencoding", @@ -755,23 +767,30 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "0.56.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745e096b3553e7e0f40622aa04971ce52765af82bebdeeac53aa6fc82fe801e6" +checksum = "c9ac79e9f3a4d576f3cd4a470a0275b138d9e7b11b1cd514a6858ae0a79dd5bb" dependencies = [ "aws-smithy-async", - "aws-smithy-client", "aws-smithy-http", "aws-smithy-protocol-test", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand", - "http", - "http-body", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "http-body 1.0.0", + "hyper 0.14.28", + "hyper-rustls 0.24.2", + "indexmap 2.2.6", "once_cell", "pin-project-lite", "pin-utils", + "rustls 0.21.12", + "serde", + "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -779,38 +798,52 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "0.56.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d0ae0c9cfd57944e9711ea610b48a963fb174a53aabacc08c5794a594b1d02" +checksum = "04ec42c2f5c0e7796a2848dde4d9f3bf8ce12ccbb3d5aa40c52fa0cdd61a1c47" dependencies = [ "aws-smithy-async", - "aws-smithy-http", "aws-smithy-types", "bytes", - "http", + "http 0.2.12", + "http 1.1.0", + "pin-project-lite", "tokio", "tracing", + "zeroize", ] [[package]] name = "aws-smithy-types" -version = "0.56.1" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d90dbc8da2f6be461fa3c1906b20af8f79d14968fe47f2b7d29d086f62a51728" +checksum = "baf98d97bba6ddaba180f1b1147e202d8fe04940403a95a3f826c790f931bbd1" dependencies = [ "base64-simd", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http 1.1.0", + "http-body 0.4.6", + "http-body 1.0.0", + "http-body-util", "itoa", "num-integer", + "pin-project-lite", + "pin-utils", "ryu", "serde", "time", + "tokio", + "tokio-util", ] [[package]] name = "aws-smithy-types-convert" -version = "0.56.1" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aec73ec67166b7bc64804aba0cf38808f5b2aecf05d353cad2e855aabce431a" +checksum = "7f280f434214856abace637b1f944d50ccca216814813acd195cdd7f206ce17f" dependencies = [ "aws-smithy-types", "time", @@ -818,39 +851,38 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.56.1" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01d2dedcdd8023043716cfeeb3c6c59f2d447fce365d8e194838891794b23b6" +checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "0.56.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85aa0451bf8af1bf22a4f028d5d28054507a14be43cb8ac0597a8471fba9edfe" +checksum = "a807d90cd50a969b3d95e4e7ad1491fcae13c6e83948d8728363ecc09d66343a" dependencies = [ "aws-credential-types", "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", + "aws-smithy-runtime-api", "aws-smithy-types", - "http", + "http 0.2.12", "rustc_version", "tracing", ] [[package]] name = "aws_lambda_events" -version = "0.12.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03611508dd1e514e311caec235b581c99a4cb66fa1771bd502819eed69894f12" +checksum = "7319a086b79c3ff026a33a61e80f04fd3885fbb73237981ea080d21944e1cb1c" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.0", "http-serde", "query_map", "serde", @@ -859,18 +891,19 @@ dependencies = [ [[package]] name = "axum" -version = "0.6.20" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", "itoa", "matchit", "memchr", @@ -882,28 +915,33 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -922,10 +960,10 @@ dependencies = [ ] [[package]] -name = "base64" -version = "0.20.0" +name = "base16ct" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] name = "base64" @@ -950,16 +988,39 @@ dependencies = [ ] [[package]] -name = "bit-vec" -version = "0.6.3" +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "bitflags" -version = "1.3.2" +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.61", + "which", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" @@ -978,9 +1039,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.5.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -989,9 +1050,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1091,6 +1152,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -1137,6 +1207,17 @@ dependencies = [ "half", ] +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.5.4" @@ -1177,12 +1258,27 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "convert_case" version = "0.4.0" @@ -1321,6 +1417,28 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[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]] name = "crypto-common" version = "0.1.6" @@ -1372,6 +1490,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1412,12 +1540,50 @@ dependencies = [ "subtle", ] +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[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]] name = "either" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +[[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]] name = "encoding_rs" version = "0.8.34" @@ -1461,6 +1627,16 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "figment" version = "0.10.18" @@ -1502,6 +1678,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.30" @@ -1618,6 +1800,23 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[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]] name = "h2" version = "0.3.26" @@ -1629,7 +1828,26 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", "indexmap 2.2.6", "slab", "tokio", @@ -1658,6 +1876,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -1696,6 +1918,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "htsget-actix" version = "0.6.0" @@ -1710,9 +1941,10 @@ dependencies = [ "htsget-http", "htsget-search", "htsget-test", - "http", + "http 0.2.12", + "http 1.1.0", "reqwest", - "rustls-pemfile", + "rustls-pemfile 2.1.2", "serde", "serde_json", "tempfile", @@ -1728,14 +1960,15 @@ dependencies = [ "async-trait", "clap", "figment", - "http", + "http 1.1.0", "http-serde", "noodles", "rcgen", "regex", "reqwest", - "rustls", - "rustls-pemfile", + "rustls 0.23.7", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "serde", "serde_json", "serde_regex", @@ -1756,7 +1989,7 @@ dependencies = [ "htsget-config", "htsget-search", "htsget-test", - "http", + "http 1.1.0", "serde", "thiserror", "tokio", @@ -1795,7 +2028,7 @@ dependencies = [ "aws-config", "aws-sdk-s3", "axum", - "base64 0.21.7", + "base64 0.22.1", "bytes", "criterion", "data-url", @@ -1803,17 +2036,18 @@ dependencies = [ "futures-util", "htsget-config", "htsget-test", - "http", - "hyper", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", "noodles", "pin-project-lite", "reqwest", - "rustls-pemfile", + "rustls-pemfile 2.1.2", "serde", "tempfile", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tower", "tower-http", @@ -1829,10 +2063,10 @@ dependencies = [ "aws-config", "aws-credential-types", "aws-sdk-s3", - "base64 0.21.7", + "base64 0.22.1", "futures", "htsget-config", - "http", + "http 1.1.0", "mime", "noodles", "rcgen", @@ -1858,6 +2092,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -1865,23 +2110,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", "pin-project-lite", ] [[package]] name = "http-range-header" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "http-serde" -version = "1.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f560b665ad9f1572cfcaf034f7fb84338a7ce945216d64a90fd81f046a3caee" +checksum = "1133cafcce27ea69d35e56b3a8772e265633e04de73c5f4e1afdffc1d19b5419" dependencies = [ - "http", + "http 1.1.0", "serde", ] @@ -1899,25 +2167,46 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.0", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] @@ -1928,13 +2217,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "log", - "rustls", + "rustls 0.21.12", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.22.4", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -2068,21 +2394,24 @@ dependencies = [ [[package]] name = "lambda_http" -version = "0.8.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2505c4a24f5a8d8ac66a87691215ec1f79736c5bc6e62bb921788dca9753f650" +checksum = "5ebde9aedfdf8c2bac4365d9adafae6ca6d631b0ea221734ac802595fcd141cb" dependencies = [ "aws_lambda_events", "base64 0.21.7", "bytes", "encoding_rs", "futures", - "http", - "http-body", - "hyper", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", "lambda_runtime", "mime", "percent-encoding", + "pin-project-lite", "serde", "serde_json", "serde_urlencoded", @@ -2092,38 +2421,51 @@ dependencies = [ [[package]] name = "lambda_runtime" -version = "0.8.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deca8f65d7ce9a8bfddebb49d7d91b22e788a59ca0c5190f26794ab80ed7a702" +checksum = "ae4606aea513f0e614497c0c4556d0e39f51a8434d9d97e592d32f9e615d4232" dependencies = [ "async-stream", - "base64 0.20.0", + "base64 0.22.1", "bytes", "futures", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", "http-serde", - "hyper", + "hyper 1.3.1", + "hyper-util", "lambda_runtime_api_client", + "pin-project", "serde", "serde_json", "serde_path_to_error", "tokio", "tokio-stream", "tower", + "tower-layer", "tracing", ] [[package]] name = "lambda_runtime_api_client" -version = "0.8.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "690c5ae01f3acac8c9c3348b556fc443054e9b7f1deaf53e9ebab716282bf0ed" +checksum = "c90a10f094475a34a04da2be11686c4dcfe214d93413162db9ffdff3d3af293a" dependencies = [ - "http", - "hyper", + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", "tokio", + "tower", "tower-service", + "tracing", + "tracing-subscriber", ] [[package]] @@ -2138,6 +2480,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "lexical-core" version = "0.8.5" @@ -2208,6 +2556,16 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.52.5", +] + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2247,6 +2605,15 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "lzma-sys" version = "0.1.20" @@ -2332,6 +2699,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "mutually_exclusive_features" version = "0.0.3" @@ -2350,9 +2723,9 @@ dependencies = [ [[package]] name = "noodles" -version = "0.65.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38db1833ba39368f7a855c5b9a8412729a61dd86b2563e1a3bdb02aecbe92a3c" +checksum = "8903a0299daf4f072f2e601c74c29c861abdfd2427366e727b8d8afbbde8cbcc" dependencies = [ "noodles-bam", "noodles-bcf", @@ -2362,6 +2735,7 @@ dependencies = [ "noodles-csi", "noodles-fasta", "noodles-fastq", + "noodles-gff", "noodles-sam", "noodles-tabix", "noodles-vcf", @@ -2369,9 +2743,9 @@ dependencies = [ [[package]] name = "noodles-bam" -version = "0.56.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3189e8ecee801ab5c3f4ea9908c4196b429137d8d35d733f00f6681f9188be7" +checksum = "3ede0b1e0b8e0e03f21c692ad38473dfe95c3650317650205c29c9a682c4a5a6" dependencies = [ "bit-vec", "bstr", @@ -2388,9 +2762,9 @@ dependencies = [ [[package]] name = "noodles-bcf" -version = "0.46.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1561dbba3a09a61020b805a598b3d7c50841491c915523e0e4987f67286886f1" +checksum = "924e8b050dc7d9b6e4933da612e45743aaf5450094dab069ed9cddb79700e193" dependencies = [ "byteorder", "futures", @@ -2404,9 +2778,9 @@ dependencies = [ [[package]] name = "noodles-bgzf" -version = "0.26.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8970db2e84adb1007377dd3988258d7a64e3fc4c05602ebf94e1f8cba207c030" +checksum = "13f54d4840fd26ed94103ded9524aa5fdd757255a556f24653d162c0a45c47e8" dependencies = [ "byteorder", "bytes", @@ -2420,18 +2794,21 @@ dependencies = [ [[package]] name = "noodles-core" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7336c3be652de4e05444c9b12a32331beb5ba3316e8872d92bfdd8ef3b06c282" +checksum = "c5a8c6b020d1205abef2b0fab4463a6c5ecc3c8f4d561ca8b0d1a42323376200" +dependencies = [ + "bstr", +] [[package]] name = "noodles-cram" -version = "0.56.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a70ebb5bc7ff2d07ce96c0568691e57be421c121103ebef10cf02a63d7d400" +checksum = "8e16052ef0d5da67e94e8372c18daf6bd288eebe4fc44654e9b944e3da9d8c7f" dependencies = [ "async-compression", - "bitflags 2.5.0", + "bitflags", "bstr", "byteorder", "bytes", @@ -2451,9 +2828,9 @@ dependencies = [ [[package]] name = "noodles-csi" -version = "0.30.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60dfe0919f7ecbd081a82eb1d32e8f89f9041932d035fe8309073c8c01277bf" +checksum = "beb1618ca2aa88662d387197a188686105d6b5e25f6959c52b766276cbfc4620" dependencies = [ "bit-vec", "byteorder", @@ -2465,9 +2842,9 @@ dependencies = [ [[package]] name = "noodles-fasta" -version = "0.33.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9e953e4e90e6c96e6a384598ebf2ab6d2f5add259ff05a194cf635e892c980" +checksum = "8bf9160022ada6c905f4e54aa27dd1ebde8d48faf6fb4dcd0f3ec423adc241ec" dependencies = [ "bytes", "memchr", @@ -2487,13 +2864,28 @@ dependencies = [ "tokio", ] +[[package]] +name = "noodles-gff" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578b6efaf5c3f029720af4c8590e34fd38e214666971d665a52e3566830170d0" +dependencies = [ + "futures", + "indexmap 2.2.6", + "noodles-bgzf", + "noodles-core", + "noodles-csi", + "percent-encoding", + "tokio", +] + [[package]] name = "noodles-sam" -version = "0.53.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f0d8e441368374f6e144989f823fd7c05e58cdaa3f97d22bb4d75b534327b87" +checksum = "0ec6452e8ed9f20ef043dce35e09ed58f1c34834cd941e987458a66e8fa66fa0" dependencies = [ - "bitflags 2.5.0", + "bitflags", "bstr", "futures", "indexmap 2.2.6", @@ -2507,9 +2899,9 @@ dependencies = [ [[package]] name = "noodles-tabix" -version = "0.36.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1ab29335a68d0c2bdf41460a67714ca69e23a1cbeb950ac5c38a9afa446a62" +checksum = "0cc110f78cb406f69f42c482d1986526c590b7295f37f0e37f1fc380413400ef" dependencies = [ "bit-vec", "byteorder", @@ -2522,9 +2914,9 @@ dependencies = [ [[package]] name = "noodles-vcf" -version = "0.49.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e1f2fa749afaccadc596ec55ccb7bdcd8101fa79f8382384223c0dbae3e245b" +checksum = "4df6e162ec2e898581b5ccf5e8972e376a7c41807061b66152280dea2c53a989" dependencies = [ "futures", "indexmap 2.2.6", @@ -2635,6 +3027,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] name = "parking_lot" version = "0.12.2" @@ -2753,6 +3156,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] name = "pkg-config" version = "0.3.30" @@ -2809,6 +3222,16 @@ dependencies = [ "yansi 0.5.1", ] +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.61", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2937,12 +3360,13 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.12.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48406db8ac1f3cbc7dcdb56ec355343817958a356ff430259bb07baf7607e1e1" +checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" dependencies = [ "pem", - "ring 0.17.8", + "ring", + "rustls-pki-types", "time", "yasna", ] @@ -2953,7 +3377,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.5.0", + "bitflags", ] [[package]] @@ -2988,6 +3412,12 @@ dependencies = [ "regex-syntax 0.8.3", ] +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -3002,20 +3432,21 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", - "encoding_rs", + "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-rustls 0.26.0", + "hyper-util", "ipnet", "js-sys", "log", @@ -3023,15 +3454,15 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", + "rustls 0.22.4", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 0.1.2", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-util", "tower-service", "url", @@ -3044,18 +3475,14 @@ dependencies = [ ] [[package]] -name = "ring" -version = "0.16.20" +name = "rfc6979" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", + "crypto-bigint 0.4.9", + "hmac", + "zeroize", ] [[package]] @@ -3068,8 +3495,8 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -3088,6 +3515,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.0" @@ -3103,7 +3536,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -3117,11 +3550,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.8", - "rustls-webpki", + "ring", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -3129,7 +3591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -3143,14 +3605,42 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -3167,9 +3657,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "s3s" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17419b26b83f810a49eb1087213e889da16b446f9cf5149aaad777c0b1e5f56f" +checksum = "67e6cdc8002708b435946eec39afa13c43e4288d1de6316a12816e4cfaaa6c2c" dependencies = [ "arrayvec", "async-trait", @@ -3182,9 +3672,10 @@ dependencies = [ "futures", "hex-simd", "hmac", - "http-body", + "http-body 1.0.0", + "http-body-util", "httparse", - "hyper", + "hyper 1.3.1", "itoa", "memchr", "mime", @@ -3207,30 +3698,27 @@ dependencies = [ [[package]] name = "s3s-aws" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355d5e4fc3dad032b0c719057b3632713caee110b4ea231f4d37b44287eee8ea" +checksum = "6de0d6542f9aa260bd219cf69caf4a5d16786114a4fd834df78d6ae85cfaf10f" dependencies = [ "async-trait", "aws-sdk-s3", - "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", "aws-smithy-types-convert", - "bytes", - "futures", - "hyper", + "hyper 1.3.1", "s3s", - "sync_wrapper", + "sync_wrapper 1.0.1", "tracing", "transform-stream", ] [[package]] name = "s3s-fs" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfed24ce7b786e2d8979f0468e7745482cc1f5114ed75dd214c71e5c5620d87e" +checksum = "12416a376cc964d0730718c8e03e2c0e414c1da48c20b1057ca4cad29059b308" dependencies = [ "async-trait", "base64-simd", @@ -3290,8 +3778,22 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", +] + +[[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]] @@ -3300,7 +3802,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -3457,6 +3959,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3466,6 +3974,16 @@ dependencies = [ "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]] name = "simdutf8" version = "0.1.4" @@ -3499,15 +4017,19 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spin" -version = "0.9.8" +name = "spki" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der", +] [[package]] name = "static_assertions" @@ -3562,25 +4084,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "sync_wrapper" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "tempfile" @@ -3716,7 +4223,29 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.7", + "rustls-pki-types", "tokio", ] @@ -3797,16 +4326,16 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.5.0", + "bitflags", "bytes", - "futures-core", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", "http-range-header", "httpdate", "mime", @@ -3990,12 +4519,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -4168,9 +4691,24 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] [[package]] name = "winapi" @@ -4362,9 +4900,9 @@ dependencies = [ [[package]] name = "winreg" -version = "0.50.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", diff --git a/htsget-actix/Cargo.toml b/htsget-actix/Cargo.toml index 45bb84cd3..3e5248a8b 100644 --- a/htsget-actix/Cargo.toml +++ b/htsget-actix/Cargo.toml @@ -2,7 +2,7 @@ name = "htsget-actix" version = "0.6.0" rust-version = "1.74" -authors = ["Daniel del Castillo de la Rosa ", "Marko Malenic "] +authors = ["Daniel del Castillo de la Rosa ", "Marko Malenic ", "Roman Valls Guimera "] edition = "2021" license = "MIT" description = "A webserver instance of htsget-rs configured using htsget-config." @@ -16,11 +16,12 @@ url-storage = ["htsget-config/url-storage", "htsget-search/url-storage", "htsget default = [] [dependencies] -actix-web = { version = "4", features = ["rustls-0_21"] } -actix-cors = "0.6" +actix-web = { version = "4", features = ["rustls-0_23"] } +actix-cors = "0.7" +http_1 = { package = "http", version = "1" } http = "0.2" -rustls-pemfile = "1.0" -serde = { version = "1.0", features = ["derive"] } +rustls-pemfile = "2" +serde = { version = "1", features = ["derive"] } serde_json = "1" futures-util = { version = "0.3" } htsget-http = { version = "0.4.13", path = "../htsget-http", default-features = false } @@ -28,7 +29,7 @@ htsget-search = { version = "0.7.0", path = "../htsget-search", default-features htsget-config = { version = "0.9.0", path = "../htsget-config", default-features = false } htsget-test = { version = "0.6.0", path = "../htsget-test", features = ["http"], default-features = false } futures = { version = "0.3" } -tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } tracing-actix-web = "0.7" tracing = "0.1" @@ -37,8 +38,8 @@ tracing = "0.1" async-trait = "0.1" criterion = { version = "0.5", features = ["async_tokio"] } -reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "rustls-tls"] } -tempfile = "3.5" +reqwest = { version = "0.12", default-features = false, features = ["json", "blocking", "rustls-tls"] } +tempfile = "3" [[bench]] name = "request-benchmarks" diff --git a/htsget-actix/src/handlers/mod.rs b/htsget-actix/src/handlers/mod.rs index edbe7014f..66d1d87c7 100644 --- a/htsget-actix/src/handlers/mod.rs +++ b/htsget-actix/src/handlers/mod.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use actix_web::web::{Path, Query}; use actix_web::{http::StatusCode, Either, HttpRequest, Responder}; -use http::HeaderMap as HttpHeaderMap; +use http::{HeaderMap as HttpHeaderMap, HeaderName, Method}; use htsget_config::types::{JsonResponse, Request}; use htsget_http::Result; @@ -37,7 +37,11 @@ fn handle_response(response: Result) -> Either { let (json, status_code) = error.to_json_representation(); - Either::Left(PrettyJson(json).customize().with_status(status_code)) + Either::Left( + PrettyJson(json) + .customize() + .with_status(HttpVersionCompat::status_code_1_to_0_2(status_code)), + ) } Ok(json) => Either::Right(PrettyJson(json).customize().with_status(StatusCode::OK)), } @@ -53,6 +57,47 @@ fn extract_request( Request::new( path.into_inner(), query, - HeaderMap::from(&http_request).into_inner(), + HttpVersionCompat::header_map_0_2_to_1(HeaderMap::from(&http_request).into_inner()), ) } + +// Todo, remove this when actix-web starts using http 1.0. +pub(crate) struct HttpVersionCompat; + +impl HttpVersionCompat { + pub(crate) fn header_names_1_to_0_2(header_name: Vec) -> Vec { + header_name + .iter() + .map(|name| name.as_str().parse().ok()) + .collect::>() + .unwrap_or_default() + } + + pub(crate) fn methods_0_2_to_1(method: Vec) -> Vec { + method + .iter() + .map(|method| method.as_str().parse().ok()) + .collect::>() + .unwrap_or_default() + } + + pub(crate) fn header_map_0_2_to_1(header_map: HttpHeaderMap) -> http_1::HeaderMap { + // Silently ignore incompatible headers. This isn't ideal but it shouldn't cause any errors. + header_map + .iter() + .map(|(name, value)| { + let name = name.as_str().parse().ok()?; + let value = value.to_str().ok()?.parse().ok()?; + + Some((name, value)) + }) + .collect::>>() + .map(FromIterator::from_iter) + .unwrap_or_default() + } + + pub(crate) fn status_code_1_to_0_2(status_code: http_1::StatusCode) -> StatusCode { + // Report an error if the status code is not convertible + StatusCode::from_u16(status_code.as_u16()).unwrap_or(StatusCode::INTERNAL_SERVER_ERROR) + } +} diff --git a/htsget-actix/src/lib.rs b/htsget-actix/src/lib.rs index 7e103db30..0bc2faadc 100644 --- a/htsget-actix/src/lib.rs +++ b/htsget-actix/src/lib.rs @@ -14,7 +14,7 @@ use htsget_search::htsget::from_storage::HtsGetFromStorage; use htsget_search::htsget::HtsGet; use htsget_search::storage::local::LocalStorage; -use crate::handlers::{get, post, reads_service_info, variants_service_info}; +use crate::handlers::{get, post, reads_service_info, variants_service_info, HttpVersionCompat}; pub mod handlers; @@ -78,7 +78,9 @@ pub fn configure_cors(cors: CorsConfig) -> Cors { .allow_headers() .apply_any(|cors_layer| cors_layer.allow_any_header(), cors_layer); cors_layer = cors.allow_headers().apply_list( - |cors_layer, headers| cors_layer.allowed_headers(headers.clone()), + |cors_layer, headers| { + cors_layer.allowed_headers(HttpVersionCompat::header_names_1_to_0_2(headers.clone())) + }, cors_layer, ); @@ -86,7 +88,9 @@ pub fn configure_cors(cors: CorsConfig) -> Cors { .allow_methods() .apply_any(|cors_layer| cors_layer.allow_any_method(), cors_layer); cors_layer = cors.allow_methods().apply_list( - |cors_layer, methods| cors_layer.allowed_methods(methods.clone()), + |cors_layer, methods| { + cors_layer.allowed_methods(HttpVersionCompat::methods_0_2_to_1(methods.clone())) + }, cors_layer, ); @@ -94,7 +98,9 @@ pub fn configure_cors(cors: CorsConfig) -> Cors { .expose_headers() .apply_any(|cors_layer| cors_layer.expose_any_header(), cors_layer); cors_layer = cors.expose_headers().apply_list( - |cors_layer, headers| cors_layer.expose_headers(headers.clone()), + |cors_layer, headers| { + cors_layer.expose_headers(HttpVersionCompat::header_names_1_to_0_2(headers.clone())) + }, cors_layer, ); @@ -131,7 +137,7 @@ pub fn run_server( } Some(tls) => { info!("using TLS ticket server"); - server.bind_rustls_021(addr, tls.into_inner())? + server.bind_rustls_0_23(addr, tls.into_inner())? } }; @@ -208,7 +214,7 @@ mod tests { let path = self.get_config().data_server().local_path().to_path_buf(); tokio::spawn(async move { server.serve(path).await.unwrap() }); - expected_url_path(self.get_config(), addr) + expected_url_path(self.get_config(), addr.unwrap()) } fn get_config(&self) -> &Config { @@ -232,10 +238,12 @@ mod tests { TestResponse::new( status, - headers - .drain() - .map(|(name, value)| (name.unwrap(), value)) - .collect(), + HttpVersionCompat::header_map_0_2_to_1( + headers + .drain() + .map(|(name, value)| (name.unwrap(), value)) + .collect(), + ), bytes, expected_path, ) diff --git a/htsget-config/Cargo.toml b/htsget-config/Cargo.toml index 42893e612..b71844ca8 100644 --- a/htsget-config/Cargo.toml +++ b/htsget-config/Cargo.toml @@ -2,7 +2,7 @@ name = "htsget-config" version = "0.9.0" rust-version = "1.74" -authors = ["Daniel del Castillo de la Rosa ", "Marko Malenic "] +authors = ["Daniel del Castillo de la Rosa ", "Marko Malenic ", "Roman Valls Guimera "] edition = "2021" description = "Used to configure htsget-rs by using a config file or reading environment variables." license = "MIT" @@ -12,33 +12,34 @@ repository = "https://github.com/umccr/htsget-rs" [features] s3-storage = [] -url-storage = ["reqwest"] +url-storage = ["dep:reqwest"] default = [] [dependencies] -thiserror = "1.0" +thiserror = "1" async-trait = "0.1" -noodles = { version = "0.65", features = ["core"] } -serde = { version = "1.0", features = ["derive"] } -serde_with = "3.0" -serde_regex = "1.1" -regex = "1.8" +noodles = { version = "0.74", features = ["core"] } +serde = { version = "1", features = ["derive"] } +serde_with = "3" +serde_regex = "1" +regex = "1" figment = { version = "0.10", features = ["env", "toml"] } -clap = { version = "4.3", features = ["derive", "env", "cargo"] } +clap = { version = "4", features = ["derive", "env", "cargo"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["registry", "env-filter", "ansi", "json"] } toml = "0.8" -http = "0.2" -http-serde = "1.1" -rustls-pemfile = "1.0" -rustls = "0.21" +http = "1" +http-serde = "2" +rustls-pemfile = "2" +rustls = "0.23" +rustls-pki-types = "1" # url-storage -reqwest = { version = "0.11", features = ["rustls-tls"], default-features = false, optional = true } +reqwest = { version = "0.12", features = ["rustls-tls"], default-features = false, optional = true } [dev-dependencies] -serde_json = "1.0" +serde_json = "1" figment = { version = "0.10", features = ["test"] } -tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] } -tempfile = "3.6" -rcgen = "0.12" +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } +tempfile = "3" +rcgen = { version = "0.13", features = ["pem"] } diff --git a/htsget-config/src/config/cors.rs b/htsget-config/src/config/cors.rs index a480682cc..75f0546b1 100644 --- a/htsget-config/src/config/cors.rs +++ b/htsget-config/src/config/cors.rs @@ -48,6 +48,18 @@ impl AllowType { } } + /// Apply a function to the builder when the type is a List returning a Result. + pub fn try_apply_list(&self, func: F, builder: U) -> Result + where + F: FnOnce(U, &Vec) -> Result, + { + if let Self::List(list) = self { + func(builder, list) + } else { + Ok(builder) + } + } + /// Apply a function to the builder when the type is tagged. pub fn apply_tagged(&self, func: F, builder: U, tagged_type: &Tagged) -> U where diff --git a/htsget-config/src/error.rs b/htsget-config/src/error.rs index b92c42e68..9c2d68f4c 100644 --- a/htsget-config/src/error.rs +++ b/htsget-config/src/error.rs @@ -26,3 +26,9 @@ impl From for io::Error { io::Error::new(io::ErrorKind::Other, error.to_string()) } } + +impl From for Error { + fn from(error: io::Error) -> Self { + Error::IoError(error.to_string()) + } +} diff --git a/htsget-config/src/tls/client.rs b/htsget-config/src/tls/client.rs index 2b1d80bec..7864543b0 100644 --- a/htsget-config/src/tls/client.rs +++ b/htsget-config/src/tls/client.rs @@ -1,10 +1,11 @@ //! TLS configuration related to HTTP clients. //! -use crate::error::Error; use crate::error::Error::IoError; +use crate::error::{Error, Result}; use crate::tls::RootCertStorePair; use crate::tls::{load_certs, read_bytes}; +use reqwest::{Certificate, Identity}; use serde::Deserialize; /// A certificate and key pair used for TLS. Serialization is not implemented because there @@ -12,18 +13,18 @@ use serde::Deserialize; #[derive(Deserialize, Debug, Clone, Default)] #[serde(try_from = "RootCertStorePair")] pub struct TlsClientConfig { - cert: Option>, - identity: Option, + cert: Option>, + identity: Option, } impl TlsClientConfig { /// Create a new TlsClientConfig. - pub fn new(cert: Option>, identity: Option) -> Self { + pub fn new(cert: Option>, identity: Option) -> Self { Self { cert, identity } } /// Get the inner client config. - pub fn into_inner(self) -> (Option>, Option) { + pub fn into_inner(self) -> (Option>, Option) { (self.cert, self.identity) } } @@ -31,7 +32,7 @@ impl TlsClientConfig { impl TryFrom for TlsClientConfig { type Error = Error; - fn try_from(root_store_pair: RootCertStorePair) -> crate::error::Result { + fn try_from(root_store_pair: RootCertStorePair) -> Result { let (key_pair, root_store) = root_store_pair.into_inner(); let cert = root_store @@ -42,10 +43,10 @@ impl TryFrom for TlsClientConfig { certs .into_iter() .map(|cert| { - reqwest::Certificate::from_der(&cert.0) + Certificate::from_der(&cert) .map_err(|err| IoError(format!("failed to read certificate from pem: {}", err))) }) - .collect::>>() + .collect::>>() }) .transpose()?; @@ -55,7 +56,7 @@ impl TryFrom for TlsClientConfig { let key = read_bytes(pair.key)?; let certs = read_bytes(pair.cert)?; - reqwest::Identity::from_pem(&[certs, key].concat()) + Identity::from_pem(&[certs, key].concat()) .map_err(|err| IoError(format!("failed to pkcs8 pem identity: {}", err))) }) .transpose()?; diff --git a/htsget-config/src/tls/mod.rs b/htsget-config/src/tls/mod.rs index 90c5881a6..30838140c 100644 --- a/htsget-config/src/tls/mod.rs +++ b/htsget-config/src/tls/mod.rs @@ -5,14 +5,17 @@ pub mod client; use std::fs::File; +use std::io; use std::io::{BufReader, Read}; use std::path::{Path, PathBuf}; -use rustls::{Certificate, PrivateKey, ServerConfig}; -use rustls_pemfile::read_one; +use rustls::ServerConfig; +use rustls_pemfile::Item::{Pkcs1Key, Pkcs8Key, Sec1Key}; +use rustls_pemfile::{certs, read_one}; +use rustls_pki_types::{CertificateDer, PrivateKeyDer}; use serde::{Deserialize, Serialize}; -use crate::error::Error::{IoError, ParseError}; +use crate::error::Error::ParseError; use crate::error::{Error, Result}; use crate::types::Scheme; use crate::types::Scheme::{Http, Https}; @@ -52,20 +55,20 @@ pub struct CertificateKeyPairPath { } /// The certificate and key pair used for TLS. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] pub struct CertificateKeyPair { - certs: Vec, - key: PrivateKey, + certs: Vec>, + key: PrivateKeyDer<'static>, } impl CertificateKeyPair { /// Create a new CertificateKeyPair. - pub fn new(certs: Vec, key: PrivateKey) -> Self { + pub fn new(certs: Vec>, key: PrivateKeyDer<'static>) -> Self { Self { certs, key } } /// Get the owned certificate and private key. - pub fn into_inner(self) -> (Vec, PrivateKey) { + pub fn into_inner(self) -> (Vec>, PrivateKeyDer<'static>) { (self.certs, self.key) } } @@ -141,51 +144,39 @@ impl KeyPairScheme for Option<&TlsServerConfig> { } } -/// Load a private key from a file. Supports RSA, PKCS8, and Sec1 encoded keys. -pub fn load_key>(key: P) -> Result { - let mut key_reader = BufReader::new( - File::open(key).map_err(|err| IoError(format!("failed to open key file: {}", err)))?, - ); +/// Loads the first private key from a file. Supports RSA, PKCS8, and Sec1 encoded EC keys. +pub fn load_key>(key_path: P) -> Result> { + let mut key_reader = BufReader::new(File::open(key_path)?); loop { - match read_one(&mut key_reader) - .map_err(|err| ParseError(format!("failed to parse private key: {}", err)))? - { - Some(rustls_pemfile::Item::RSAKey(key)) => return Ok(PrivateKey(key)), - Some(rustls_pemfile::Item::PKCS8Key(key)) => return Ok(PrivateKey(key)), - Some(rustls_pemfile::Item::ECKey(key)) => return Ok(PrivateKey(key)), + match read_one(&mut key_reader)? { + Some(Pkcs1Key(key)) => return Ok(PrivateKeyDer::from(key)), + Some(Pkcs8Key(key)) => return Ok(PrivateKeyDer::from(key)), + Some(Sec1Key(key)) => return Ok(PrivateKeyDer::from(key)), + // Silently disregard unknown private keys. + Some(_) => continue, None => break, - _ => {} } } - Err(ParseError("no key found in pem file".to_string())) + Err(ParseError("no keys found in pem file".to_string())) } /// Read byte data. pub fn read_bytes>(path: P) -> Result> { let mut bytes = vec![]; - File::open(path) - .map_err(|err| IoError(format!("failed to open certificate or key file: {}", err)))? - .read_to_end(&mut bytes) - .map_err(|err| IoError(format!("failed to read certificate or key bytes: {}", err)))?; + File::open(path)?.read_to_end(&mut bytes)?; Ok(bytes) } /// Load certificates from a file. -pub fn load_certs>(certs: P) -> Result> { - let mut cert_reader = BufReader::new( - File::open(certs).map_err(|err| IoError(format!("failed to open cert file: {}", err)))?, - ); - - let certs: Vec = rustls_pemfile::certs(&mut cert_reader) - .map_err(|err| ParseError(format!("failed to parse certificates: {}", err)))? - .into_iter() - .map(Certificate) - .collect(); +pub fn load_certs>(certs_path: P) -> Result>> { + let mut cert_reader = BufReader::new(File::open(certs_path)?); + let certs: Vec = + certs(&mut cert_reader).collect::>>()?; if certs.is_empty() { - return Err(ParseError("no certificates found in pem file".to_string())); + return Err(ParseError("no certificates found in .pem file".to_string())); } Ok(certs) @@ -196,7 +187,6 @@ pub fn tls_server_config(key_pair: CertificateKeyPair) -> Result { let (certs, key) = key_pair.into_inner(); let mut config = ServerConfig::builder() - .with_safe_defaults() .with_no_client_auth() .with_single_cert(certs, key) .map_err(|err| ParseError(err.to_string()))?; @@ -253,7 +243,7 @@ pub(crate) mod tests { pub(crate) fn with_test_certificates(test: F) where - F: FnOnce(&Path, PrivateKey, Certificate), + F: FnOnce(&Path, PrivateKeyDer<'static>, CertificateDer<'static>), { let tmp_dir = TempDir::new().unwrap(); @@ -262,26 +252,19 @@ pub(crate) mod tests { let cert = generate_simple_self_signed(vec!["localhost".to_string()]).unwrap(); - let key = cert.serialize_private_key_pem(); - let cert = cert.serialize_pem().unwrap(); + let key = cert.key_pair.serialize_pem(); + let cert = cert.cert.pem(); write(key_path, &key).unwrap(); write(cert_path, &cert).unwrap(); - let key = PrivateKey( - pkcs8_private_keys(&mut Cursor::new(key)) - .unwrap() - .into_iter() + let key = PrivateKeyDer::from( + pkcs8_private_keys(&mut Cursor::new(key.clone())) .next() - .unwrap(), - ); - let cert = Certificate( - certs(&mut Cursor::new(cert)) .unwrap() - .into_iter() - .next() .unwrap(), ); + let cert = certs(&mut Cursor::new(cert)).next().unwrap().unwrap(); test(tmp_dir.path(), key, cert); } diff --git a/htsget-http/Cargo.toml b/htsget-http/Cargo.toml index 985c1de7a..f0da5a7ca 100644 --- a/htsget-http/Cargo.toml +++ b/htsget-http/Cargo.toml @@ -2,7 +2,7 @@ name = "htsget-http" version = "0.4.13" rust-version = "1.74" -authors = ["Daniel del Castillo de la Rosa ", "Marko Malenic "] +authors = ["Daniel del Castillo de la Rosa ", "Marko Malenic ", "Roman Valls Guimera "] edition = "2021" license = "MIT" description = "Crate for handling HTTP in htsget-rs." @@ -16,12 +16,12 @@ url-storage = ["htsget-config/url-storage", "htsget-search/url-storage", "htsget default = [] [dependencies] -thiserror = "1.0" -serde = { version = "1.0", features = ["derive"] } -http = "0.2" +thiserror = "1" +serde = { version = "1", features = ["derive"] } +http = "1" htsget-search = { version = "0.7.0", path = "../htsget-search", default-features = false } htsget-config = { version = "0.9.0", path = "../htsget-config", default-features = false } htsget-test = { version = "0.6.0", path = "../htsget-test", default-features = false } futures = { version = "0.3" } -tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } tracing = "0.1" diff --git a/htsget-lambda/Cargo.toml b/htsget-lambda/Cargo.toml index 0e0cdad78..156ad2b0c 100644 --- a/htsget-lambda/Cargo.toml +++ b/htsget-lambda/Cargo.toml @@ -16,23 +16,23 @@ url-storage = ["htsget-config/url-storage", "htsget-search/url-storage", "htsget default = [] [dependencies] -tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] } -tower-http = { version = "0.4", features = ["cors"] } -lambda_http = { version = "0.8" } -lambda_runtime = { version = "0.8" } +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } +tower-http = { version = "0.5", features = ["cors"] } +lambda_http = { version = "0.11" } +lambda_runtime = { version = "0.11" } htsget-config = { version = "0.9.0", path = "../htsget-config", default-features = false } htsget-search = { version = "0.7.0", path = "../htsget-search", default-features = false } htsget-http = { version = "0.4.13", path = "../htsget-http", default-features = false } htsget-test = { version = "0.6.0", path = "../htsget-test", features = ["http"], default-features = false } -serde = { version = "1.0" } -serde_json = "1.0" +serde = { version = "1" } +serde_json = "1" mime = "0.3" -regex = "1.8" +regex = "1" tracing = "0.1" tracing-subscriber = "0.3" -bytes = "1.4" +bytes = "1" [dev-dependencies] async-trait = "0.1" query_map = { version = "0.7", features = ["url-query"] } -tempfile = "3.6" +tempfile = "3" diff --git a/htsget-lambda/src/lib.rs b/htsget-lambda/src/lib.rs index a18657ea7..452aa0630 100644 --- a/htsget-lambda/src/lib.rs +++ b/htsget-lambda/src/lib.rs @@ -711,7 +711,7 @@ mod tests { let path = config.data_server().local_path().to_path_buf(); tokio::spawn(async move { server.serve(path).await.unwrap() }); - expected_url_path(config, addr) + expected_url_path(config, addr.unwrap()) } async fn endpoint_from_file(file_path: &str, class: Class, config: &Config) { diff --git a/htsget-search/Cargo.toml b/htsget-search/Cargo.toml index fb6e30b2c..9693ce37b 100644 --- a/htsget-search/Cargo.toml +++ b/htsget-search/Cargo.toml @@ -15,15 +15,15 @@ s3-storage = [ "dep:bytes", "dep:aws-sdk-s3", "dep:aws-config", + "dep:pin-project-lite", "htsget-config/s3-storage", "htsget-test/s3-storage", "htsget-test/aws-mocks" ] url-storage = [ "dep:bytes", - "hyper/client", - "reqwest", - "pin-project-lite", + "dep:reqwest", + "dep:pin-project-lite", "htsget-config/url-storage", "htsget-test/url-storage" ] @@ -31,48 +31,49 @@ default = [] [dependencies] # Axum server -url = "2.3" -hyper = { version = "0.14", features = ["http1", "http2", "server"] } -tower-http = { version = "0.4", features = ["trace", "cors", "fs"] } -http = "0.2" -axum = "0.6" -rustls-pemfile = "1.0" +url = "2" +hyper = { version = "1", features = ["http1", "http2", "server"] } +hyper-util = "0.1" +tower-http = { version = "0.5", features = ["trace", "cors", "fs"] } +http = "1" +axum = "0.7" +rustls-pemfile = "2" tower = { version = "0.4", features = ["make"] } # Async -tokio-rustls = "0.24" -tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] } +tokio-rustls = "0.26" +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } tokio-util = { version = "0.7", features = ["io", "compat"] } futures = { version = "0.3" } futures-util = "0.3" async-trait = "0.1" # Noodles -noodles = { version = "0.65", features = ["async", "core", "bgzf", "bam", "bcf", "cram", "csi", "sam", "tabix", "vcf"] } +noodles = { version = "0.74", features = ["async", "core", "bgzf", "bam", "bcf", "cram", "csi", "sam", "tabix", "vcf"] } # Amazon S3 -bytes = { version = "1.4", optional = true } -aws-sdk-s3 = { version = "0.34", optional = true } -aws-config = { version = "0.56", optional = true } +bytes = { version = "1", optional = true } +aws-sdk-s3 = { version = "1", optional = true } +aws-config = { version = "1", optional = true } # Url storage -reqwest = { version = "0.11", features = ["rustls-tls", "stream"], default-features = false, optional = true } +reqwest = { version = "0.12", features = ["rustls-tls", "stream"], default-features = false, optional = true } pin-project-lite = { version = "0.2", optional = true } # Error control, tracing, config -thiserror = "1.0" +thiserror = "1" htsget-config = { version = "0.9.0", path = "../htsget-config", default-features = false } htsget-test = { version = "0.6.0", path = "../htsget-test", features = ["http"], default-features = false } tracing = "0.1" -base64 = "0.21" -serde = "1.0" +base64 = "0.22" +serde = "1" [dev-dependencies] -tempfile = "3.6" +tempfile = "3" data-url = "0.3" # Axum server -reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] } +reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] } criterion = { version = "0.5", features = ["async_tokio"] } diff --git a/htsget-search/src/htsget/bam_search.rs b/htsget-search/src/htsget/bam_search.rs index 7aa17c65a..56afc1393 100644 --- a/htsget-search/src/htsget/bam_search.rs +++ b/htsget-search/src/htsget/bam_search.rs @@ -64,12 +64,12 @@ where .with_class(Body)]) } - async fn read_bytes(_header: &Header, reader: &mut AsyncReader) -> Option { + async fn read_bytes(reader: &mut AsyncReader) -> Option { reader.read_record(&mut Default::default()).await.ok() } fn virtual_position(&self, reader: &AsyncReader) -> VirtualPosition { - reader.virtual_position() + reader.get_ref().virtual_position() } } diff --git a/htsget-search/src/htsget/bcf_search.rs b/htsget-search/src/htsget/bcf_search.rs index 545e5a7f3..8017563bc 100644 --- a/htsget-search/src/htsget/bcf_search.rs +++ b/htsget-search/src/htsget/bcf_search.rs @@ -17,7 +17,6 @@ use tokio::io::AsyncRead; use tracing::{instrument, trace}; use crate::htsget::search::{find_first, BgzfSearch, Search}; -use crate::htsget::ParsedHeader; use crate::storage::{BytesPosition, Storage}; use crate::{Format, Query, Result}; @@ -35,12 +34,12 @@ where S: Storage + Send + Sync + 'static, ReaderType: AsyncRead + Unpin + Send + Sync, { - async fn read_bytes(_header: &Header, reader: &mut AsyncReader) -> Option { - reader.read_lazy_record(&mut Default::default()).await.ok() + async fn read_bytes(reader: &mut AsyncReader) -> Option { + reader.read_record(&mut Default::default()).await.ok() } fn virtual_position(&self, reader: &AsyncReader) -> VirtualPosition { - reader.virtual_position() + reader.get_ref().virtual_position() } } @@ -57,15 +56,7 @@ where } async fn read_header(reader: &mut AsyncReader) -> io::Result
{ - reader.read_file_format().await?; - - Ok( - reader - .read_header() - .await? - .parse::>()? - .into_inner(), - ) + reader.read_header().await } async fn read_index_inner(inner: T) -> io::Result { diff --git a/htsget-search/src/htsget/cram_search.rs b/htsget-search/src/htsget/cram_search.rs index 49fa286fc..32a9bde7c 100644 --- a/htsget-search/src/htsget/cram_search.rs +++ b/htsget-search/src/htsget/cram_search.rs @@ -72,7 +72,6 @@ where async fn get_byte_ranges_for_header( &self, index: &Index, - _header: &Header, _reader: &mut AsyncReader, _query: &Query, ) -> Result { diff --git a/htsget-search/src/htsget/search.rs b/htsget-search/src/htsget/search.rs index 88fc56d9a..b93a38465 100644 --- a/htsget-search/src/htsget/search.rs +++ b/htsget-search/src/htsget/search.rs @@ -82,7 +82,6 @@ where async fn get_byte_ranges_for_header( &self, index: &Index, - header: &Header, reader: &mut Reader, query: &Query, ) -> Result; @@ -265,7 +264,7 @@ where byte_ranges.push( self - .get_byte_ranges_for_header(&index, &header, &mut reader, &query) + .get_byte_ranges_for_header(&index, &mut reader, &query) .await?, ); @@ -293,10 +292,10 @@ where let index = self.read_index(&query).await?; let header_end = self.get_header_end_offset(&index).await?; - let (header, mut reader) = self.get_header(&query, header_end).await?; + let (_, mut reader) = self.get_header(&query, header_end).await?; let header_byte_ranges = self - .get_byte_ranges_for_header(&index, &header, &mut reader, &query) + .get_byte_ranges_for_header(&index, &mut reader, &query) .await?; self @@ -548,7 +547,7 @@ where } /// Get the virtual position of the underlying reader. - async fn read_bytes(header: &Header, reader: &mut Reader) -> Option; + async fn read_bytes(reader: &mut Reader) -> Option; /// Get the virtual position of the underlying reader. fn virtual_position(&self, reader: &Reader) -> VirtualPosition; @@ -593,7 +592,6 @@ where async fn get_byte_ranges_for_header( &self, index: &Index, - header: &Header, reader: &mut Reader, query: &Query, ) -> Result { @@ -603,7 +601,7 @@ where current_block_index.compressed() } else { loop { - let bytes_read = Self::read_bytes(header, reader).await.unwrap_or_default(); + let bytes_read = Self::read_bytes(reader).await.unwrap_or_default(); let actual_block_index = self.virtual_position(reader).compressed(); if bytes_read == 0 || actual_block_index > current_block_index.compressed() { diff --git a/htsget-search/src/htsget/vcf_search.rs b/htsget-search/src/htsget/vcf_search.rs index 08a391a6a..db4acfe35 100644 --- a/htsget-search/src/htsget/vcf_search.rs +++ b/htsget-search/src/htsget/vcf_search.rs @@ -38,15 +38,12 @@ where S: Storage + Send + Sync + 'static, ReaderType: AsyncRead + Unpin + Send + Sync, { - async fn read_bytes(header: &Header, reader: &mut AsyncReader) -> Option { - reader - .read_record(header, &mut Default::default()) - .await - .ok() + async fn read_bytes(reader: &mut AsyncReader) -> Option { + reader.read_record(&mut Default::default()).await.ok() } fn virtual_position(&self, reader: &AsyncReader) -> VirtualPosition { - reader.virtual_position() + reader.get_ref().virtual_position() } } diff --git a/htsget-search/src/storage/data_server.rs b/htsget-search/src/storage/data_server.rs index 03192dabb..43cd31e47 100644 --- a/htsget-search/src/storage/data_server.rs +++ b/htsget-search/src/storage/data_server.rs @@ -4,21 +4,22 @@ //! This is the code that replies to the url tickets generated by [HtsGet], in the case of [LocalStorage]. //! +use axum::extract::Request; use std::net::{AddrParseError, SocketAddr}; use std::path::Path; -use std::pin::Pin; use std::sync::Arc; use axum::Router; -use futures_util::future::poll_fn; -use hyper::server::accept::Accept; -use hyper::server::conn::{AddrIncoming, Http}; +use hyper::body::Incoming; +use hyper::service::service_fn; +use hyper_util::rt::{TokioExecutor, TokioIo}; +use hyper_util::server::conn::auto::Builder; use tokio::net::TcpListener; use tokio_rustls::TlsAcceptor; -use tower::MakeService; +use tower::Service; use tower_http::services::ServeDir; use tower_http::trace::TraceLayer; -use tracing::instrument; +use tracing::{error, instrument, warn}; use tracing::{info, trace}; use htsget_config::config::cors::CorsConfig; @@ -85,7 +86,7 @@ impl BindDataServer { self.cors.clone(), ) .await?; - self.addr = server.local_addr(); + self.addr = server.local_addr()?; Ok(server) } @@ -119,7 +120,7 @@ impl From for StorageError { /// The local storage static http server. #[derive(Debug)] pub struct DataServer { - listener: AddrIncoming, + listener: TcpListener, serve_at: String, cert_key_pair: Option, cors: CorsConfig, @@ -137,7 +138,6 @@ impl DataServer { let listener = TcpListener::bind(addr) .await .map_err(|err| IoError("binding data server addr".to_string(), err))?; - let listener = AddrIncoming::from_listener(listener)?; info!(address = ?listener.local_addr(), "data server address bound to"); Ok(Self { @@ -150,38 +150,42 @@ impl DataServer { /// Run the actual server, using the provided path, key and certificate. #[instrument(level = "trace", skip_all)] - pub async fn serve>(mut self, path: P) -> Result<()> { - let mut app = Router::new() + pub async fn serve>(self, path: P) -> Result<()> { + let app = Router::new() .nest_service(&self.serve_at, ServeDir::new(path)) .layer(configure_cors(self.cors)?) - .layer(TraceLayer::new_for_http()) - .into_make_service_with_connect_info::(); + .layer(TraceLayer::new_for_http()); - // TODO write using new axum functions. match self.cert_key_pair { - None => axum::Server::builder(self.listener) - .serve(app) + None => axum::serve(self.listener, app) .await .map_err(|err| ServerError(err.to_string())), Some(tls) => { - let acceptor = TlsAcceptor::from(Arc::new(tls.into_inner())); + let tls_acceptor = TlsAcceptor::from(Arc::new(tls.into_inner())); loop { - let stream = poll_fn(|cx| Pin::new(&mut self.listener).poll_accept(cx)) - .await - .ok_or_else(|| ServerError("poll accept failed".to_string()))? - .map_err(|err| ServerError(err.to_string()))?; - let acceptor = acceptor.clone(); - - let app = app - .make_service(&stream) - .await - .map_err(|err| ServerError(err.to_string()))?; - - trace!(stream = ?stream, "accepting stream"); + let tower_service = app.clone(); + let tls_acceptor = tls_acceptor.clone(); + + trace!("accepting connection"); + let (cnx, addr) = self.listener.accept().await.unwrap(); + tokio::spawn(async move { - if let Ok(stream) = acceptor.accept(stream).await { - let _ = Http::new().serve_connection(stream, app).await; + let Ok(stream) = tls_acceptor.accept(cnx).await else { + error!("error during tls handshake connection from {}", addr); + return; + }; + + let stream = TokioIo::new(stream); + let hyper_service = + service_fn(move |request: Request| tower_service.clone().call(request)); + + let ret = Builder::new(TokioExecutor::new()) + .serve_connection_with_upgrades(stream, hyper_service) + .await; + + if let Err(err) = ret { + warn!("error serving connection from {}: {}", addr, err); } }); } @@ -190,8 +194,8 @@ impl DataServer { } /// Get the local address the server has bound to. - pub fn local_addr(&self) -> SocketAddr { - self.listener.local_addr() + pub fn local_addr(&self) -> Result { + Ok(self.listener.local_addr()?) } } @@ -356,7 +360,7 @@ mod tests { "/data".to_string(), ); let server = formatter.bind_data_server().await.unwrap(); - assert_eq!(formatter.get_addr(), server.local_addr()); + assert_eq!(formatter.get_addr(), server.local_addr().unwrap()); } #[tokio::test] @@ -406,7 +410,7 @@ mod tests { let server = DataServer::bind_addr(addr, "/data", cert_key_pair, default_cors_config()) .await .unwrap(); - let port = server.local_addr().port(); + let port = server.local_addr().unwrap().port(); tokio::spawn(async move { server.serve(path).await.unwrap() }); port diff --git a/htsget-search/src/storage/mod.rs b/htsget-search/src/storage/mod.rs index 812061481..d4e0e5d51 100644 --- a/htsget-search/src/storage/mod.rs +++ b/htsget-search/src/storage/mod.rs @@ -1,5 +1,6 @@ //! Module providing the abstractions needed to read files from an storage //! + use std::cmp::Ordering; use std::fmt::{Debug, Display, Formatter}; use std::io; @@ -199,6 +200,12 @@ impl From for io::Error { } } +impl From for StorageError { + fn from(error: io::Error) -> Self { + Self::IoError("io error".to_string(), error) + } +} + /// A DataBlock is either a range of bytes, or a data blob that gets transformed into a data uri. #[derive(Debug, PartialEq, Eq)] pub enum DataBlock { diff --git a/htsget-search/src/storage/s3.rs b/htsget-search/src/storage/s3.rs index a2bb89414..67ced38b1 100644 --- a/htsget-search/src/storage/s3.rs +++ b/htsget-search/src/storage/s3.rs @@ -4,25 +4,29 @@ use std::fmt::Debug; use std::io; use std::io::ErrorKind::Other; +use std::pin::Pin; +use std::task::{Context, Poll}; use std::time::Duration; use async_trait::async_trait; +use aws_config::BehaviorVersion; use aws_sdk_s3::error::{DisplayErrorContext, SdkError}; use aws_sdk_s3::operation::get_object::builders::GetObjectFluentBuilder; use aws_sdk_s3::operation::get_object::GetObjectError; use aws_sdk_s3::operation::head_object::{HeadObjectError, HeadObjectOutput}; use aws_sdk_s3::presigning::PresigningConfig; -use aws_sdk_s3::primitives::{ByteStream, SdkBody}; +use aws_sdk_s3::primitives::ByteStream; use aws_sdk_s3::types::StorageClass; use aws_sdk_s3::Client; use bytes::Bytes; -use http::Response; +use futures::Stream; +use pin_project_lite::pin_project; use tokio_util::io::StreamReader; use tracing::instrument; use tracing::{debug, warn}; use crate::storage::s3::Retrieval::{Delayed, Immediate}; -use crate::storage::StorageError::{AwsS3Error, KeyNotFound}; +use crate::storage::StorageError::{AwsS3Error, IoError, KeyNotFound}; use crate::storage::{BytesPosition, HeadOptions, StorageError}; use crate::storage::{BytesRange, Storage}; use crate::Url; @@ -58,7 +62,7 @@ impl S3Storage { endpoint: Option, path_style: bool, ) -> Self { - let sdk_config = aws_config::load_from_env().await; + let sdk_config = aws_config::load_defaults(BehaviorVersion::latest()).await; let mut s3_config_builder = aws_sdk_s3::config::Builder::from(&sdk_config); s3_config_builder.set_endpoint_url(endpoint); // For local S3 storage, i.e: Minio s3_config_builder.set_force_path_style(Some(path_style)); @@ -189,14 +193,16 @@ impl S3Storage { &self, key: K, options: GetOptions<'_>, - ) -> Result> { - let response = self.get_content(key, options).await?; - Ok(StreamReader::new(response)) + ) -> Result> { + Ok(StreamReader::new(S3Stream::new( + self.get_content(key, options).await?, + ))) } - fn map_get_error(key: K, error: SdkError>) -> StorageError + fn map_get_error(key: K, error: SdkError) -> StorageError where K: AsRef + Send, + T: Debug + Send + Sync + 'static, { warn!("S3 error: {}", DisplayErrorContext(&error)); @@ -209,9 +215,36 @@ impl S3Storage { } } +pin_project! { + /// A wrapper around a `ByteStream` in order to implement `Stream`. + pub struct S3Stream { + #[pin] + inner: ByteStream + } +} + +impl S3Stream { + /// Create a new S3Stream. + pub fn new(inner: ByteStream) -> Self { + S3Stream { inner } + } +} + +impl Stream for S3Stream { + type Item = Result; + + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self + .project() + .inner + .poll_next(cx) + .map_err(|err| IoError("io error".to_string(), err.into())) + } +} + #[async_trait] impl Storage for S3Storage { - type Streamable = StreamReader; + type Streamable = StreamReader; /// Gets the actual s3 object as a buffered reader. #[instrument(level = "trace", skip(self))] @@ -252,8 +285,13 @@ impl Storage for S3Storage { let key = key.as_ref(); let head = self.s3_head(key).await?; - let len = u64::try_from(head.content_length).map_err(|err| { - StorageError::IoError( + + let content_length = head + .content_length() + .ok_or_else(|| AwsS3Error("unknown content length".to_string(), key.to_string()))?; + + let len = u64::try_from(content_length).map_err(|err| { + IoError( "failed to convert file length to `u64`".to_string(), io::Error::new(Other, err), ) diff --git a/htsget-search/src/storage/url.rs b/htsget-search/src/storage/url.rs index 2ac418cba..6de59c807 100644 --- a/htsget-search/src/storage/url.rs +++ b/htsget-search/src/storage/url.rs @@ -260,17 +260,18 @@ impl Storage for UrlStorage { #[cfg(test)] mod tests { use std::future::Future; - use std::net::TcpListener; use std::path::Path; use std::str::FromStr; use std::{result, vec}; + use axum::body::Body; use axum::middleware::Next; use axum::response::Response; use axum::{middleware, Router}; use http::header::{AUTHORIZATION, HOST}; use http::{HeaderName, HeaderValue, Request, StatusCode}; use tokio::io::AsyncReadExt; + use tokio::net::TcpListener; use tower_http::services::ServeDir; use htsget_config::types::Headers; @@ -594,10 +595,7 @@ mod tests { with_test_server(base_path.path(), test).await; } - async fn test_auth( - request: Request, - next: Next, - ) -> result::Result { + async fn test_auth(request: Request, next: Next) -> result::Result { let auth_header = request .headers() .get(AUTHORIZATION) @@ -619,14 +617,10 @@ mod tests { .route_layer(middleware::from_fn(test_auth)); // TODO fix this in htsget-test to bind and return tcp listener. - let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); let addr = listener.local_addr().unwrap(); - tokio::spawn( - axum::Server::from_tcp(listener) - .unwrap() - .serve(router.into_make_service()), - ); + tokio::spawn(async move { axum::serve(listener, router.into_make_service()).await }); test(format!("http://{}", addr)).await; } diff --git a/htsget-test/Cargo.toml b/htsget-test/Cargo.toml index 22a0b3ae0..73c2f0236 100644 --- a/htsget-test/Cargo.toml +++ b/htsget-test/Cargo.toml @@ -2,7 +2,7 @@ name = "htsget-test" version = "0.6.0" rust-version = "1.74" -authors = ["Marko Malenic "] +authors = ["Marko Malenic ", "Roman Valls Guimera "] edition = "2021" license = "MIT" description = "Common test functions and utilities used by htsget-rs." @@ -42,26 +42,26 @@ default = [] # Server tests dependencies htsget-config = { version = "0.9.0", path = "../htsget-config", default-features = false, optional = true } -noodles = { version = "0.65", optional = true, features = ["async", "bgzf", "vcf", "cram", "bcf", "bam", "fasta"] } +noodles = { version = "0.74", optional = true, features = ["async", "bgzf", "vcf", "cram", "bcf", "bam", "fasta"] } -reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"], optional = true } +reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"], optional = true } tokio = { version = "1", features = ["rt-multi-thread", "fs"], optional = true } futures = { version = "0.3", optional = true } async-trait = { version = "0.1", optional = true } -http = { version = "0.2", optional = true } +http = { version = "1", optional = true } mime = { version = "0.3", optional = true } -serde_json = { version = "1.0", features = ["preserve_order"], optional = true } +serde_json = { version = "1", features = ["preserve_order"], optional = true } serde = { version = "1", optional = true } -base64 = { version = "0.21", optional = true } +base64 = { version = "0.22", optional = true } -tempfile = { version = "3.3", optional = true } -aws-sdk-s3 = { version = "0.34", features = ["test-util"], optional = true } -aws-config = { version = "0.56", optional = true } -aws-credential-types = { version = "0.56", features = ["test-util"], optional = true } -s3s = { version = "0.8", optional = true } -s3s-fs = { version = "0.8", optional = true } -s3s-aws = { version = "0.8", optional = true } +tempfile = { version = "3", optional = true } +aws-sdk-s3 = { version = "1", features = ["test-util"], optional = true } +aws-config = { version = "1", optional = true } +aws-credential-types = { version = "1", features = ["test-util"], optional = true } +s3s = { version = "0.10", optional = true } +s3s-fs = { version = "0.10", optional = true } +s3s-aws = { version = "0.10", optional = true } # Default dependencies -rcgen = "0.12" -thiserror = "1.0" +rcgen = "0.13" +thiserror = "1" diff --git a/htsget-test/src/aws_mocks.rs b/htsget-test/src/aws_mocks.rs index 38d5cda53..a70a0cc18 100644 --- a/htsget-test/src/aws_mocks.rs +++ b/htsget-test/src/aws_mocks.rs @@ -1,7 +1,7 @@ use aws_config::SdkConfig; use aws_credential_types::provider::SharedCredentialsProvider; use aws_credential_types::Credentials; -use aws_sdk_s3::config::Region; +use aws_sdk_s3::config::{BehaviorVersion, Region}; use aws_sdk_s3::Client; use s3s::auth::SimpleAuth; use s3s::service::S3ServiceBuilder; @@ -27,7 +27,7 @@ pub async fn run_s3_test_server( { let cred = Credentials::for_tests(); - let conn = { + let client = { let fs = FileSystem::new(server_base_path).unwrap(); let auth = SimpleAuth::from_single(cred.access_key_id(), cred.secret_access_key()); @@ -36,14 +36,15 @@ pub async fn run_s3_test_server( service.set_auth(auth); service.set_base_domain(domain_name); - s3s_aws::Connector::from(service.build().into_shared()) + s3s_aws::Client::from(service.build().into_shared()) }; let sdk_config = SdkConfig::builder() .credentials_provider(SharedCredentialsProvider::new(cred)) - .http_connector(conn) + .http_client(client) .region(Region::new(region)) .endpoint_url(format!("http://{domain_name}")) + .behavior_version(BehaviorVersion::latest()) .build(); test(Client::new(&sdk_config), server_base_path.to_path_buf()).await; diff --git a/htsget-test/src/http/concat.rs b/htsget-test/src/http/concat.rs index c6e900e22..77c7eb65c 100644 --- a/htsget-test/src/http/concat.rs +++ b/htsget-test/src/http/concat.rs @@ -216,19 +216,15 @@ impl ReadRecords { let mut reader = vcf::AsyncReader::new(bgzf::AsyncReader::new(self.merged_bytes.as_slice())); let header = reader.read_header().await.map_err(TestError::read_record)?; - println!("{header}"); + println!("{:#?}", header); - self.iterate_records(reader.records(&header)).await + self.iterate_records(reader.records()).await } Format::Bcf => { let mut reader = bcf::AsyncReader::new(self.merged_bytes.as_slice()); - reader - .read_file_format() - .await - .map_err(TestError::read_record)?; reader.read_header().await.map_err(TestError::read_record)?; - self.iterate_records(reader.lazy_records()).await + self.iterate_records(reader.records()).await } } } diff --git a/htsget-test/src/util.rs b/htsget-test/src/util.rs index 2aec3bce0..50ffd5ac8 100644 --- a/htsget-test/src/util.rs +++ b/htsget-test/src/util.rs @@ -12,8 +12,8 @@ pub fn generate_test_certificates>( let cert_path = in_path.as_ref().join(cert_name); let cert = generate_simple_self_signed(vec!["localhost".to_string()]).unwrap(); - fs::write(&key_path, cert.serialize_private_key_pem()).unwrap(); - fs::write(&cert_path, cert.serialize_pem().unwrap()).unwrap(); + fs::write(&key_path, cert.key_pair.serialize_pem()).unwrap(); + fs::write(&cert_path, cert.cert.pem()).unwrap(); (key_path, cert_path) }