diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..62a725a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1219 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aws-lc-rs" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c953fe1ba023e6b7730c0d4b031d06f267f23a46167dcbd40316644b10a17ba" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfd150b5dbdb988bcc8fb1fe787eb6b7ee6180ca24da683b61ea5405f3d43ff" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2352e5597e9c544d5e6d9c95190d5d27738ade584fa8db0a16e130e5c2b5296e" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +dependencies = [ + "cc", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-custom-cert" +version = "0.1.0" +dependencies = [ + "hyper-rustls", + "hyper-tls", + "native-tls", + "rustls-pemfile", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "log", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "io-uring" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jobserver" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.3", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework 2.11.1", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "openssl" +version = "0.10.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "prettyplease" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61789d7719defeb74ea5fe81f2fdfdbd28a803847077cecce2ff14e1472f6f1" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.60.2", +] + +[[package]] +name = "rustls" +version = "0.23.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.3.0", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc3fcb250e53458e712715cf74285c1f889686520d79294a9ef3bd7aa1fc619" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix 1.0.8", + "windows-sys 0.59.0", +] + +[[package]] +name = "tokio" +version = "1.47.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +dependencies = [ + "backtrace", + "io-uring", + "libc", + "mio", + "pin-project-lite", + "slab", + "socket2", + "windows-sys 0.59.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.44", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/crates/hyper-custom-cert/src/lib.rs b/crates/hyper-custom-cert/src/lib.rs index f3a7d4a..147dba6 100644 --- a/crates/hyper-custom-cert/src/lib.rs +++ b/crates/hyper-custom-cert/src/lib.rs @@ -33,7 +33,9 @@ use std::collections::HashMap; use std::error::Error as StdError; use std::fmt; +#[cfg(feature = "rustls")] use std::fs; +#[cfg(feature = "rustls")] use std::path::Path; use std::time::Duration; @@ -265,15 +267,19 @@ impl HttpClientBuilder { /// ``` #[cfg(feature = "rustls")] pub fn with_root_ca_file>(mut self, path: P) -> Self { - let pem_bytes = fs::read(path.as_ref()) - .unwrap_or_else(|e| panic!("Failed to read CA certificate file '{}': {}", - path.as_ref().display(), e)); + let pem_bytes = fs::read(path.as_ref()).unwrap_or_else(|e| { + panic!( + "Failed to read CA certificate file '{}': {}", + path.as_ref().display(), + e + ) + }); self.root_ca_pem = Some(pem_bytes); self } /// Configure certificate pinning using SHA256 fingerprints for additional security. - /// + /// /// Certificate pinning provides an additional layer of security beyond CA validation /// by verifying that the server's certificate matches one of the provided fingerprints. /// This helps protect against compromised CAs and man-in-the-middle attacks. @@ -303,7 +309,7 @@ impl HttpClientBuilder { /// 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, /// 0xa1, 0xb2, 0xc3, 0xd4, 0xe5, 0xf6, 0x07, 0x18 /// ]; - /// + /// /// let pin2: [u8; 32] = [ /// 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87, /// 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f, @@ -397,7 +403,7 @@ mod tests { // Create a temporary file with test certificate content let temp_dir = std::env::temp_dir(); let cert_file = temp_dir.join("test-ca.pem"); - + let test_cert = b"-----BEGIN CERTIFICATE----- MIICxjCCAa4CAQAwDQYJKoZIhvcNAQELBQAwEjEQMA4GA1UEAwwHVGVzdCBDQTAe Fw0yNTA4MTQwMDAwMDBaFw0yNjA4MTQwMDAwMDBaMBIxEDAOBgNVBAMMB1Rlc3Qg @@ -407,13 +413,12 @@ Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTest... // Write test certificate to temporary file { let mut file = fs::File::create(&cert_file).expect("Failed to create temp cert file"); - file.write_all(test_cert).expect("Failed to write cert to temp file"); + file.write_all(test_cert) + .expect("Failed to write cert to temp file"); } // Test that the builder can read the certificate file - let client = HttpClient::builder() - .with_root_ca_file(&cert_file) - .build(); + let client = HttpClient::builder().with_root_ca_file(&cert_file).build(); // Verify the certificate was loaded assert!(client.root_ca_pem.is_some()); diff --git a/crates/hyper-custom-cert/tests/default_features.rs b/crates/hyper-custom-cert/tests/default_features.rs index 8725110..f6951ef 100644 --- a/crates/hyper-custom-cert/tests/default_features.rs +++ b/crates/hyper-custom-cert/tests/default_features.rs @@ -1,39 +1,35 @@ //! Integration tests for default features (native-tls only) -//! +//! //! These tests verify that the library works correctly with only the default //! features enabled (native-tls backend using OS trust store). -use hyper_custom_cert::{HttpClient, HttpClientBuilder}; +use hyper_custom_cert::HttpClient; use std::collections::HashMap; use std::time::Duration; #[test] fn default_client_creation() { // Test that we can create a client with default features - let client = HttpClient::new(); - + let _client = HttpClient::new(); + // Basic smoke test - the client should be created successfully // In a real scenario, this would make an actual HTTP request - assert!(true); // Placeholder - client creation succeeded } #[test] fn default_client_from_builder() { // Test builder pattern with default features - let client = HttpClient::builder().build(); - + let _client = HttpClient::builder().build(); + // Verify builder works with default features - assert!(true); // Placeholder - builder succeeded } #[test] fn builder_with_timeout() { // Test timeout configuration with default features - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(30)) .build(); - - assert!(true); // Placeholder - timeout configuration succeeded } #[test] @@ -42,12 +38,8 @@ fn builder_with_headers() { let mut headers = HashMap::new(); headers.insert("User-Agent".to_string(), "test-agent".to_string()); headers.insert("Accept".to_string(), "application/json".to_string()); - - let client = HttpClient::builder() - .with_default_headers(headers) - .build(); - - assert!(true); // Placeholder - header configuration succeeded + + let _client = HttpClient::builder().with_default_headers(headers).build(); } #[test] @@ -55,25 +47,22 @@ fn builder_combined_configuration() { // Test combining multiple configuration options with default features let mut headers = HashMap::new(); headers.insert("Custom-Header".to_string(), "custom-value".to_string()); - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(45)) .with_default_headers(headers) .build(); - - assert!(true); // Placeholder - combined configuration succeeded } #[cfg(feature = "native-tls")] #[test] fn native_tls_specific_functionality() { // Test functionality that's specific to native-tls backend - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(10)) .build(); - + // This test should only run when native-tls feature is enabled - assert!(true); // Placeholder - native-tls specific test } // Test that methods requiring other features are not available @@ -82,29 +71,28 @@ fn rustls_methods_not_available() { // This is a compile-time test - if rustls feature is not enabled, // rustls-specific methods should not be available let _builder = HttpClient::builder(); - + // The following would cause compilation errors if rustls feature is not enabled: // builder.with_root_ca_pem(b"test"); // builder.with_root_ca_file("test.pem"); // builder.with_pinned_cert_sha256(vec![[0u8; 32]]); - - assert!(true); // If this compiles, the test passes + + // If this compiles, the test passes } #[test] fn insecure_methods_not_available() { // Test that insecure methods are not available without the feature let _builder = HttpClient::builder(); - + // The following would cause compilation errors if insecure-dangerous feature is not enabled: // builder.insecure_accept_invalid_certs(true); - - assert!(true); // If this compiles, the test passes + + // If this compiles, the test passes } #[test] fn default_client_static_method() { // Test the static convenience method - let client = HttpClient::default(); - assert!(true); // Placeholder - default() method succeeded -} \ No newline at end of file + let _client = HttpClient::default(); +} diff --git a/crates/hyper-custom-cert/tests/feature_combinations.rs b/crates/hyper-custom-cert/tests/feature_combinations.rs index 8bdd430..9a12a63 100644 --- a/crates/hyper-custom-cert/tests/feature_combinations.rs +++ b/crates/hyper-custom-cert/tests/feature_combinations.rs @@ -1,14 +1,21 @@ //! Integration tests for various feature combinations -//! +//! //! These tests verify that the library works correctly with different //! combinations of features enabled/disabled, ensuring proper conditional //! compilation and feature interactions. -use hyper_custom_cert::{HttpClient, HttpClientBuilder}; +use hyper_custom_cert::HttpClient; +#[cfg(any( + all(feature = "rustls", feature = "insecure-dangerous"), + all(feature = "native-tls", feature = "insecure-dangerous"), + not(any(feature = "rustls", feature = "insecure-dangerous")), + all(feature = "native-tls", feature = "rustls", feature = "insecure-dangerous") +))] use std::collections::HashMap; use std::time::Duration; // Test CA certificate for combination tests +#[allow(dead_code)] const TEST_CA_PEM: &[u8] = b"-----BEGIN CERTIFICATE----- MIIDXTCCAkWgAwIBAgIJAKoK/heBjcOuMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX @@ -23,32 +30,31 @@ CgKCAQEAuuExKtKjKEw91uR8gqyUZx+wW3qZjUHq3oLe+RxbEUVFWApwrKE3XxKJ #[test] fn rustls_and_insecure_combination() { // Test combining rustls custom CA with insecure certificate acceptance - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_root_ca_pem(TEST_CA_PEM) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - rustls + insecure combination + + // Test passes if compilation succeeds } #[cfg(all(feature = "rustls", feature = "insecure-dangerous"))] #[test] fn rustls_pinning_and_insecure_combination() { // Test combining certificate pinning with insecure mode (unusual but valid) - let pins = vec![ - [0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, - 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, - 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08], - ]; - - let client = HttpClient::builder() + let pins = vec![[ + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, + ]]; + + let _client = HttpClient::builder() .with_pinned_cert_sha256(pins) .insecure_accept_invalid_certs(true) .with_timeout(Duration::from_secs(30)) .build(); - - assert!(true); // Placeholder - pinning + insecure combination + + // Test passes if compilation succeeds } #[cfg(all(feature = "rustls", feature = "insecure-dangerous"))] @@ -57,10 +63,10 @@ fn full_rustls_insecure_configuration() { // Test using all rustls and insecure features together let mut headers = HashMap::new(); headers.insert("X-Custom".to_string(), "test".to_string()); - + let pins = vec![[0u8; 32]]; - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(45)) .with_default_headers(headers) .with_root_ca_pem(TEST_CA_PEM) @@ -68,8 +74,8 @@ fn full_rustls_insecure_configuration() { .with_pinned_cert_sha256(pins) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - full rustls + insecure configuration + + // Test passes if compilation succeeds } // Test with native-tls + insecure-dangerous (default + insecure) @@ -77,12 +83,12 @@ fn full_rustls_insecure_configuration() { #[test] fn native_tls_and_insecure_combination() { // Test combining native-tls (default) with insecure mode - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(20)) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - native-tls + insecure combination + + // Test passes if compilation succeeds } #[cfg(all(feature = "native-tls", feature = "insecure-dangerous"))] @@ -92,13 +98,13 @@ fn native_tls_insecure_with_headers() { let mut headers = HashMap::new(); headers.insert("Authorization".to_string(), "Bearer test".to_string()); headers.insert("Content-Type".to_string(), "application/json".to_string()); - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_default_headers(headers) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - native-tls + insecure with headers + + // Test passes if compilation succeeds } // Test with no optional features (base functionality only) @@ -106,11 +112,11 @@ fn native_tls_insecure_with_headers() { #[test] fn minimal_feature_set() { // Test with only the default native-tls feature - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(30)) .build(); - - assert!(true); // Placeholder - minimal feature set + + // Test passes if compilation succeeds } #[cfg(not(any(feature = "rustls", feature = "insecure-dangerous")))] @@ -119,46 +125,54 @@ fn minimal_with_headers_only() { // Test minimal feature set with headers configuration let mut headers = HashMap::new(); headers.insert("User-Agent".to_string(), "minimal-client".to_string()); - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_default_headers(headers) .with_timeout(Duration::from_millis(5000)) .build(); - - assert!(true); // Placeholder - minimal with headers + + // Test passes if compilation succeeds } // Test with all features enabled -#[cfg(all(feature = "native-tls", feature = "rustls", feature = "insecure-dangerous"))] +#[cfg(all( + feature = "native-tls", + feature = "rustls", + feature = "insecure-dangerous" +))] #[test] fn all_features_enabled() { // Test when all features are available let mut headers = HashMap::new(); headers.insert("X-All-Features".to_string(), "enabled".to_string()); - + let pins = vec![[0x42; 32]]; - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(60)) .with_default_headers(headers) .with_root_ca_pem(TEST_CA_PEM) .with_pinned_cert_sha256(pins) .insecure_accept_invalid_certs(false) // Safe default even with insecure available .build(); - - assert!(true); // Placeholder - all features enabled + + // Test passes if compilation succeeds } -#[cfg(all(feature = "native-tls", feature = "rustls", feature = "insecure-dangerous"))] +#[cfg(all( + feature = "native-tls", + feature = "rustls", + feature = "insecure-dangerous" +))] #[test] fn all_features_insecure_enabled() { // Test all features with insecure mode actually enabled - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_root_ca_pem(TEST_CA_PEM) // Use PEM instead of file for CI/CD compatibility .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - all features with insecure enabled + + // Test passes if compilation succeeds } // Test feature availability at compile time @@ -166,27 +180,24 @@ fn all_features_insecure_enabled() { fn feature_availability_check() { // This test documents which features are available at compile time let _client = HttpClient::builder(); - + // Always available (default) let _default_client = HttpClient::new(); - let _builder = HttpClient::builder() - .with_timeout(Duration::from_secs(10)); - + let _builder = HttpClient::builder().with_timeout(Duration::from_secs(10)); + #[cfg(feature = "rustls")] { // rustls features should be available - let _rustls_client = HttpClient::builder() - .with_root_ca_pem(TEST_CA_PEM); + let _rustls_client = HttpClient::builder().with_root_ca_pem(TEST_CA_PEM); } - + #[cfg(feature = "insecure-dangerous")] { // insecure features should be available - let _insecure_client = HttpClient::builder() - .insecure_accept_invalid_certs(true); + let _insecure_client = HttpClient::builder().insecure_accept_invalid_certs(true); } - - assert!(true); // Feature availability test completed + + // Test passes if compilation succeeds } // Test builder method chaining with different feature combinations @@ -195,13 +206,13 @@ fn feature_availability_check() { fn rustls_method_chaining() { // Test method chaining with rustls features // Note: Using only PEM method to avoid file I/O in tests - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(30)) .with_root_ca_pem(TEST_CA_PEM) .with_root_ca_pem(TEST_CA_PEM) // Chain multiple PEM calls instead of file .build(); - - assert!(true); // Placeholder - rustls method chaining + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] @@ -210,25 +221,25 @@ fn insecure_method_chaining() { // Test method chaining with insecure features let mut headers = HashMap::new(); headers.insert("Test".to_string(), "chaining".to_string()); - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_timeout(Duration::from_millis(1000)) .with_default_headers(headers) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure method chaining + + // Test passes if compilation succeeds } // Test error conditions with different feature combinations #[test] fn basic_error_handling() { // Test basic error handling regardless of features - let client = HttpClient::new(); - + let _client = HttpClient::new(); + // This would test actual error scenarios in a real implementation // For now, just verify the client was created successfully - assert!(true); // Placeholder - basic error handling + // Test passes if compilation succeeds } #[cfg(all(feature = "rustls", feature = "insecure-dangerous"))] @@ -238,7 +249,7 @@ fn complex_configuration_order() { let pins = vec![[1u8; 32], [2u8; 32]]; let mut headers = HashMap::new(); headers.insert("Order".to_string(), "test".to_string()); - + // Configuration in one order let client1 = HttpClient::builder() .insecure_accept_invalid_certs(true) @@ -247,7 +258,7 @@ fn complex_configuration_order() { .with_timeout(Duration::from_secs(15)) .with_default_headers(headers.clone()) .build(); - + // Configuration in different order let client2 = HttpClient::builder() .with_default_headers(headers) @@ -256,6 +267,6 @@ fn complex_configuration_order() { .with_root_ca_pem(TEST_CA_PEM) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - configuration order test -} \ No newline at end of file + + // Test passes if compilation succeeds +} diff --git a/crates/hyper-custom-cert/tests/insecure_dangerous_features.rs b/crates/hyper-custom-cert/tests/insecure_dangerous_features.rs index d62ba10..e9e820b 100644 --- a/crates/hyper-custom-cert/tests/insecure_dangerous_features.rs +++ b/crates/hyper-custom-cert/tests/insecure_dangerous_features.rs @@ -1,47 +1,45 @@ //! Integration tests for insecure-dangerous features -//! +//! //! These tests verify that the library works correctly with the insecure-dangerous //! feature enabled. This feature should ONLY be used for development and testing. -//! +//! //! ⚠️ WARNING: The insecure-dangerous feature disables important security checks. //! Never use this in production environments! -use hyper_custom_cert::{HttpClient, HttpClientBuilder}; -use std::collections::HashMap; -use std::time::Duration; +use hyper_custom_cert::HttpClient; #[cfg(feature = "insecure-dangerous")] #[test] fn insecure_accept_invalid_certs_enabled() { // Test enabling insecure certificate acceptance (development only!) - let client = HttpClient::builder() + let _client = HttpClient::builder() .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure mode enabled + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] #[test] fn insecure_accept_invalid_certs_disabled() { // Test explicitly disabling insecure certificate acceptance - let client = HttpClient::builder() + let _client = HttpClient::builder() .insecure_accept_invalid_certs(false) .build(); - - assert!(true); // Placeholder - insecure mode disabled + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] #[test] fn insecure_with_timeout_configuration() { // Test insecure mode combined with timeout configuration - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(30)) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure mode with timeout + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] @@ -51,13 +49,13 @@ fn insecure_with_headers_configuration() { let mut headers = HashMap::new(); headers.insert("X-Test-Header".to_string(), "test-value".to_string()); headers.insert("Accept".to_string(), "application/json".to_string()); - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_default_headers(headers) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure mode with headers + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] @@ -66,14 +64,14 @@ fn insecure_combined_configuration() { // Test insecure mode with multiple configuration options let mut headers = HashMap::new(); headers.insert("User-Agent".to_string(), "test-insecure-client".to_string()); - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(60)) .with_default_headers(headers) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure combined configuration + + // Test passes if compilation succeeds } #[cfg(all(feature = "insecure-dangerous", feature = "rustls"))] @@ -88,13 +86,13 @@ MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAuuExKtKjKEw91uR8gqyUZx+wW3qZjUHq3oLe+RxbEUVFWApwrKE3XxKJ -----END CERTIFICATE-----"; - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_root_ca_pem(TEST_CA_PEM) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure with rustls CA + + // Test passes if compilation succeeds } #[cfg(all(feature = "insecure-dangerous", feature = "rustls"))] @@ -102,22 +100,22 @@ CgKCAQEAuuExKtKjKEw91uR8gqyUZx+wW3qZjUHq3oLe+RxbEUVFWApwrKE3XxKJ fn insecure_with_certificate_pinning() { // Test insecure mode with certificate pinning (unusual but possible combination) let pins = vec![[0u8; 32]]; // Test pin - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_pinned_cert_sha256(pins) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - insecure with cert pinning + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] #[test] fn insecure_static_convenience_method() { // Test the static convenience method for self-signed certs - let client = HttpClient::with_self_signed_certs(); - - assert!(true); // Placeholder - static insecure method + let _client = HttpClient::with_self_signed_certs(); + + // Test passes if compilation succeeds } #[cfg(feature = "insecure-dangerous")] @@ -127,17 +125,17 @@ fn insecure_multiple_configurations() { let client1 = HttpClient::builder() .insecure_accept_invalid_certs(true) .build(); - + let client2 = HttpClient::builder() .insecure_accept_invalid_certs(false) .build(); - + let client3 = HttpClient::builder() .with_timeout(Duration::from_secs(10)) .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Placeholder - multiple insecure configurations + + // Test passes if compilation succeeds } // Test that runs only when insecure-dangerous feature is NOT enabled @@ -146,14 +144,14 @@ fn insecure_multiple_configurations() { fn insecure_methods_not_available_without_feature() { // This test should only compile and run when insecure-dangerous feature is disabled let _builder = HttpClient::builder(); - + // The following would cause compilation errors if insecure-dangerous feature is not enabled: // builder.insecure_accept_invalid_certs(true); - + // The static method should also not be available: // let _client = HttpClient::with_self_signed_certs(); - - assert!(true); // If this compiles without insecure-dangerous, the test passes + + // Test passes if compilation succeeds } #[cfg(not(feature = "insecure-dangerous"))] @@ -161,12 +159,12 @@ fn insecure_methods_not_available_without_feature() { fn insecure_static_method_not_available() { // Verify that the static convenience method is not available without the feature // HttpClient::with_self_signed_certs(); // This should cause a compilation error - + // Instead, we can only use the safe default methods let _client = HttpClient::new(); let _client2 = HttpClient::default(); - - assert!(true); // Safe methods are available + + // Test passes if compilation succeeds } // Documentation test to ensure proper feature gating @@ -174,20 +172,20 @@ fn insecure_static_method_not_available() { #[test] fn insecure_feature_documentation_reminder() { // This test serves as a documentation reminder about the dangers of this feature - + // ⚠️ CRITICAL SECURITY WARNING ⚠️ // The insecure-dangerous feature should NEVER be used in production! // It disables certificate validation and makes connections vulnerable to // man-in-the-middle attacks. - + // This feature is only intended for: // - Local development with self-signed certificates // - Testing environments where security is not a concern // - Debugging TLS connection issues - + let _client = HttpClient::builder() .insecure_accept_invalid_certs(true) .build(); - - assert!(true); // Documentation test passes -} \ No newline at end of file + + // Test passes if compilation succeeds +} diff --git a/crates/hyper-custom-cert/tests/rustls_features.rs b/crates/hyper-custom-cert/tests/rustls_features.rs index 3e9ff00..d19b91e 100644 --- a/crates/hyper-custom-cert/tests/rustls_features.rs +++ b/crates/hyper-custom-cert/tests/rustls_features.rs @@ -1,13 +1,16 @@ //! Integration tests for rustls features -//! +//! //! These tests verify that the library works correctly with the rustls feature //! enabled, including custom CA certificate support and certificate pinning. -use hyper_custom_cert::{HttpClient, HttpClientBuilder}; +use hyper_custom_cert::HttpClient; +#[cfg(feature = "rustls")] use std::collections::HashMap; +#[cfg(feature = "rustls")] use std::time::Duration; // Sample PEM certificate for testing (self-signed test cert) +#[allow(dead_code)] const TEST_CA_PEM: &[u8] = b"-----BEGIN CERTIFICATE----- MIIDXTCCAkWgAwIBAgIJAKoK/heBjcOuMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX @@ -21,21 +24,19 @@ CgKCAQEAuuExKtKjKEw91uR8gqyUZx+wW3qZjUHq3oLe+RxbEUVFWApwrKE3XxKJ #[test] fn rustls_client_creation() { // Test that we can create a client with rustls feature - let client = HttpClient::new(); - + let _client = HttpClient::new(); + // Basic smoke test - the client should be created successfully - assert!(true); // Placeholder - client creation succeeded + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] #[test] fn builder_with_root_ca_pem() { // Test adding custom CA certificate via PEM bytes - let client = HttpClient::builder() - .with_root_ca_pem(TEST_CA_PEM) - .build(); - - assert!(true); // Placeholder - CA PEM configuration succeeded + let _client = HttpClient::builder().with_root_ca_pem(TEST_CA_PEM).build(); + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] @@ -45,11 +46,11 @@ fn builder_with_root_ca_file() { // Note: In actual usage, this would read from a real file // For CI/CD compatibility, we test method availability without file I/O let _builder = HttpClient::builder(); - + // This demonstrates the API is available when rustls feature is enabled // In real usage: client = builder.with_root_ca_file("ca.pem").build(); - - assert!(true); // Placeholder - CA file method availability verified + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] @@ -57,21 +58,21 @@ fn builder_with_root_ca_file() { fn builder_with_pinned_cert_sha256() { // Test certificate pinning functionality let pins = vec![ - [0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, - 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, - 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08], - [0x87, 0x65, 0x43, 0x21, 0xfe, 0xdc, 0xba, 0x98, - 0x76, 0x54, 0x32, 0x10, 0xef, 0xcd, 0xab, 0x89, - 0x67, 0x45, 0x23, 0x01, 0xff, 0xee, 0xdd, 0xcc, - 0xbb, 0xaa, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44], + [ + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + ], + [ + 0x87, 0x65, 0x43, 0x21, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0xef, 0xcd, + 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa, 0x99, 0x88, + 0x77, 0x66, 0x55, 0x44, + ], ]; - - let client = HttpClient::builder() - .with_pinned_cert_sha256(pins) - .build(); - - assert!(true); // Placeholder - certificate pinning configuration succeeded + + let _client = HttpClient::builder().with_pinned_cert_sha256(pins).build(); + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] @@ -80,34 +81,32 @@ fn builder_rustls_combined_configuration() { // Test combining rustls features with other configuration options let mut headers = HashMap::new(); headers.insert("Authorization".to_string(), "Bearer token".to_string()); - + let pins = vec![[0u8; 32]]; // Single test pin - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_timeout(Duration::from_secs(60)) .with_default_headers(headers) .with_root_ca_pem(TEST_CA_PEM) .with_pinned_cert_sha256(pins) .build(); - - assert!(true); // Placeholder - combined rustls configuration succeeded + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] #[test] fn rustls_with_multiple_ca_certificates() { // Test adding multiple CA certificates - let client1 = HttpClient::builder() - .with_root_ca_pem(TEST_CA_PEM) - .build(); - + let _client1 = HttpClient::builder().with_root_ca_pem(TEST_CA_PEM).build(); + // In practice, you could chain multiple with_root_ca_pem calls - let client2 = HttpClient::builder() + let _client2 = HttpClient::builder() .with_root_ca_pem(TEST_CA_PEM) .with_root_ca_pem(TEST_CA_PEM) // Same cert twice for testing .build(); - - assert!(true); // Placeholder - multiple CA configuration succeeded + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] @@ -115,12 +114,12 @@ fn rustls_with_multiple_ca_certificates() { fn rustls_ca_file_and_pem_combination() { // Test combining multiple PEM-based CA loading (simulating file + PEM combination) // For CI/CD compatibility, we use multiple PEM calls instead of file I/O - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_root_ca_pem(TEST_CA_PEM) // Simulates file-based CA .with_root_ca_pem(TEST_CA_PEM) // Additional PEM-based CA .build(); - - assert!(true); // Placeholder - multiple CA combination succeeded + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] @@ -128,24 +127,24 @@ fn rustls_ca_file_and_pem_combination() { fn rustls_empty_pin_list() { // Test with empty certificate pin list let empty_pins: Vec<[u8; 32]> = vec![]; - - let client = HttpClient::builder() + + let _client = HttpClient::builder() .with_pinned_cert_sha256(empty_pins) .build(); - - assert!(true); // Placeholder - empty pins configuration succeeded + + // Test passes if compilation succeeds } #[cfg(feature = "rustls")] -#[test] +#[test] fn rustls_with_timeout_and_ca() { // Test rustls-specific functionality with timeout - let client = HttpClient::builder() + let _client = HttpClient::builder() .with_timeout(Duration::from_millis(500)) .with_root_ca_pem(TEST_CA_PEM) .build(); - - assert!(true); // Placeholder - rustls with timeout succeeded + + // Test passes if compilation succeeds } // Test that runs only when rustls feature is NOT enabled @@ -154,11 +153,11 @@ fn rustls_with_timeout_and_ca() { fn rustls_methods_not_available_without_feature() { // This test should only compile and run when rustls feature is disabled let _builder = HttpClient::builder(); - + // The following would cause compilation errors if rustls feature is not enabled: // builder.with_root_ca_pem(TEST_CA_PEM); // builder.with_root_ca_file("test.pem"); // builder.with_pinned_cert_sha256(vec![[0u8; 32]]); - - assert!(true); // If this compiles without rustls, the test passes -} \ No newline at end of file + + // Test passes if compilation succeeds +}