debbugs-0.1.5/.cargo_vcs_info.json0000644000000001360000000000100124520ustar { "git": { "sha1": "e2fd5c053e49f2fc0a9f85c57430e6634a3cc1da" }, "path_in_vcs": "" }debbugs-0.1.5/.github/CODEOWNERS000064400000000000000000000000121046102023000141660ustar 00000000000000* @jelmer debbugs-0.1.5/.github/FUNDING.yml000064400000000000000000000000171046102023000144150ustar 00000000000000github: jelmer debbugs-0.1.5/.github/dependabot.yml000064400000000000000000000006251046102023000154350ustar 00000000000000# Please see the documentation for all configuration options: # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "cargo" directory: "/" schedule: interval: "weekly" rebase-strategy: "disabled" - package-ecosystem: "github-actions" directory: "/" schedule: interval: weekly debbugs-0.1.5/.github/workflows/rust.yml000064400000000000000000000005721046102023000163630ustar 00000000000000name: Rust on: push: pull_request: env: CARGO_TERM_COLOR: always jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false steps: - uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose debbugs-0.1.5/.gitignore000064400000000000000000000000331046102023000132260ustar 00000000000000/target examples/all.rs *~ debbugs-0.1.5/Cargo.lock0000644000001164240000000000100104350ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "addr2line" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstream" version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", ] [[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", ] [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "shlex", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "charset" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1f927b07c74ba84c7e5fe4db2baeb3e996ab2688992e39ac68ce3220a677c7e" dependencies = [ "base64", "encoding_rs", ] [[package]] name = "colorchoice" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[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-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "data-encoding" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "debbugs" version = "0.1.5" dependencies = [ "debversion", "env_logger", "lazy-regex", "log", "mailparse", "maplit", "reqwest", "tokio", "xmltree", ] [[package]] name = "debversion" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b6c96844ac16a110ee3ea355b7e511ffe0221242caebb2cc5e1bbfd285744cf" dependencies = [ "lazy-regex", ] [[package]] name = "encoding_rs" version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] [[package]] name = "env_filter" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", ] [[package]] name = "env_logger" version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", "env_filter", "humantime", "log", ] [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "fastrand" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[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 = "form_urlencoded" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", ] [[package]] name = "futures-core" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-io" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", "futures-sink", "futures-task", "memchr", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", "wasi", ] [[package]] name = "gimli" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "h2" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", "http", "indexmap", "slab", "tokio", "tokio-util", "tracing", ] [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hermit-abi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[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 = "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.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", "http", "http-body", "pin-project-lite", ] [[package]] name = "httparse" version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", "futures-util", "h2", "http", "http-body", "httparse", "itoa", "pin-project-lite", "smallvec", "tokio", "want", ] [[package]] name = "hyper-rustls" version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http", "hyper", "hyper-util", "rustls", "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.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", "futures-util", "http", "http-body", "hyper", "pin-project-lite", "socket2", "tokio", "tower", "tower-service", "tracing", ] [[package]] name = "idna" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "ipnet" version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is_terminal_polyfill" version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy-regex" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" dependencies = [ "lazy-regex-proc_macros", "once_cell", "regex", ] [[package]] name = "lazy-regex-proc_macros" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" dependencies = [ "proc-macro2", "quote", "regex", "syn", ] [[package]] name = "libc" version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "linux-raw-sys" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] [[package]] name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "mailparse" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3da03d5980411a724e8aaf7b61a7b5e386ec55a7fb49ee3d0ff79efc7e5e7c7e" dependencies = [ "charset", "data-encoding", "quoted_printable", ] [[package]] name = "maplit" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", ] [[package]] name = "native-tls" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ "libc", "log", "openssl", "openssl-probe", "openssl-sys", "schannel", "security-framework", "security-framework-sys", "tempfile", ] [[package]] name = "object" version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" 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.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "parking_lot" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", "windows-targets", ] [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "pin-project-lite" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[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.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "proc-macro2" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "quoted_printable" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "640c9bd8497b02465aeef5375144c26062e0dcd5939dfcbb0f5db76cb8c17c73" [[package]] name = "redox_syscall" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags", ] [[package]] name = "regex" version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", "encoding_rs", "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", "native-tls", "once_cell", "percent-encoding", "pin-project-lite", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "windows-registry", ] [[package]] name = "ring" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", "getrandom", "libc", "spin", "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls" version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "once_cell", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-pemfile" version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring", "rustls-pki-types", "untrusted", ] [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "serde" version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", "ryu", "serde", ] [[package]] name = "serde_urlencoded" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", "ryu", "serde", ] [[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[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.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" dependencies = [ "futures-core", ] [[package]] name = "system-configuration" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "tempfile" version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", "once_cell", "rustix", "windows-sys 0.59.0", ] [[package]] name = "tinyvec" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", "syn", ] [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-util" version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "tower" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", "pin-project", "pin-project-lite", "tokio", "tower-layer", "tower-service", ] [[package]] name = "tower-layer" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[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.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 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-bidi" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[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.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result", "windows-strings", "windows-targets", ] [[package]] name = "windows-result" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ "windows-targets", ] [[package]] name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ "windows-result", "windows-targets", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[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_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[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_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[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_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "xml-rs" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" [[package]] name = "xmltree" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b619f8c85654798007fb10afa5125590b43b088c225a25fc2fec100a9fad0fc6" dependencies = [ "xml-rs", ] [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" debbugs-0.1.5/Cargo.toml0000644000000031410000000000100104470ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "debbugs" version = "0.1.5" authors = ["Jelmer Vernooij "] description = "Debian Bugtracking System API client" readme = "README.md" license = "Apache-2.0" repository = "https://github.com/jelmer/debbugs-rs" [[example]] name = "newest" required-features = ["tokio"] [[example]] name = "get_bug_log" required-features = ["tokio"] [[example]] name = "get_bugs" required-features = ["tokio"] [[example]] name = "get_usertag" required-features = ["tokio"] [[example]] name = "wnpp_bugs" required-features = ["tokio"] [dependencies.debversion] version = "0.4" [dependencies.env_logger] version = ">=0.10.0" optional = true [dependencies.lazy-regex] version = ">=2" [dependencies.log] version = ">=0.4" [dependencies.mailparse] version = "0.15" optional = true [dependencies.maplit] version = "1" [dependencies.reqwest] version = ">=0.11" [dependencies.tokio] version = "1" features = ["full"] optional = true [dependencies.xmltree] version = "0.11" [features] blocking = ["reqwest/blocking"] default = [ "blocking", "tokio", "mailparse", ] mailparse = ["dep:mailparse"] tokio = ["dep:tokio"] debbugs-0.1.5/Cargo.toml.orig000064400000000000000000000020251046102023000141300ustar 00000000000000[[example]] name = "newest" required-features = [ "tokio",] [[example]] name = "get_bug_log" required-features = [ "tokio",] [[example]] name = "get_bugs" required-features = [ "tokio",] [[example]] name = "get_usertag" required-features = [ "tokio",] [[example]] name = "wnpp_bugs" required-features = [ "tokio",] [package] name = "debbugs" version = "0.1.5" edition = "2021" authors = [ "Jelmer Vernooij ",] repository = "https://github.com/jelmer/debbugs-rs" description = "Debian Bugtracking System API client" readme = "README.md" license = "Apache-2.0" [dependencies] lazy-regex = ">=2" log = ">=0.4" maplit = "1" reqwest = ">=0.11" xmltree = "0.11" debversion = "0.4" [features] blocking = [ "reqwest/blocking",] default = [ "blocking", "tokio", "mailparse",] tokio = [ "dep:tokio",] mailparse = [ "dep:mailparse",] [dependencies.mailparse] version = "0.15" optional = true [dependencies.env_logger] version = ">=0.10.0" optional = true [dependencies.tokio] version = "1" optional = true features = [ "full",] debbugs-0.1.5/LICENSE000064400000000000000000000261361046102023000122570ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. debbugs-0.1.5/README.md000064400000000000000000000007661046102023000125320ustar 00000000000000Client for the Debian bug tracking system ========================================= This crate hosts a simple rust wrapper around the [SOAP API for the Debian bug tracking system](https://wiki.debian.org/DebbugsSoapInterface). Example: ```rust let client = debbugs::Debbugs::default(); // Connect to default instance println!("Lastest 10 bugs: {:?}", client.newest_bugs(10)); ``` There are two separate interfaces, one in debbugs::Debbugs, which is async - and one in debbugs::blocking::Debbugs. debbugs-0.1.5/TODO000064400000000000000000000000331046102023000117260ustar 00000000000000- get_usertag - search_est debbugs-0.1.5/disperse.conf000064400000000000000000000001261046102023000137260ustar 00000000000000timeout_days: 5 tag_name: "v$VERSION" github_url: "https://github.com/jelmer/debbugs" debbugs-0.1.5/examples/get_bug_log.rs000064400000000000000000000003701046102023000157030ustar 00000000000000#[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); let report = debbugs.get_bug_log(1000).await.unwrap(); println!("{:#?}", report); } debbugs-0.1.5/examples/get_bugs.rs000064400000000000000000000006221046102023000152250ustar 00000000000000#[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); let query = debbugs::SearchQuery { package: Some("samba"), status: Some(debbugs::BugStatus::Open), ..Default::default() }; let report = debbugs.get_bugs(&query).await.unwrap(); println!("{:#?}", report); } debbugs-0.1.5/examples/get_status.rs000064400000000000000000000004041046102023000156060ustar 00000000000000#[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); let reports = debbugs.get_status(&[42343, 10432]).await.unwrap(); println!("{:#?}", reports); } debbugs-0.1.5/examples/get_usertag.rs000064400000000000000000000005551046102023000157440ustar 00000000000000#[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); let usertags = debbugs .get_usertag( "debian-science@lists.debian.org", &["field..physics", "field..astronomy"], ) .await; println!("{:?}", usertags); } debbugs-0.1.5/examples/newest.rs000064400000000000000000000003231046102023000147310ustar 00000000000000#[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); println!("{:?}", debbugs.newest_bugs(10).await); } debbugs-0.1.5/examples/wnpp_bugs.rs000064400000000000000000000010671046102023000154360ustar 00000000000000#[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); let query = debbugs::SearchQuery { package: Some("wnpp"), ..Default::default() }; for ids in debbugs.get_bugs(&query).await.unwrap().chunks(50) { for (id, report) in debbugs.get_status(ids).await.unwrap() { println!( "{}: {}", id, report.subject.unwrap_or("".to_string()) ); } } } debbugs-0.1.5/src/async.rs000064400000000000000000000062361046102023000135230ustar 00000000000000use crate::soap; use crate::{BugId, BugLog, Error, SearchQuery, SoapResponse, DEFAULT_URL}; use log::debug; impl Debbugs { async fn send_soap_request(&self, request: &xmltree::Element, action: &str) -> SoapResponse { let mut body = Vec::new(); request.write(&mut body).expect("failed to generate xml"); debug!("SOAP Request: {}", String::from_utf8_lossy(body.as_slice())); let req = self .client .post(&self.url) .body(body) .header("Content-Type", "text/xml") .header("SOAPAction", action); let res = req.send().await?; let status = res.status(); if status.is_client_error() || status.is_server_error() { let txt = res.text().await.unwrap(); debug!("SOAP Response: {}", txt); let fault = soap::parse_fault(&txt).map_err(Error::XmlError)?; return Err(Error::Fault(fault)); } debug!("SOAP Status: {}", status); let txt = res.text().await.unwrap_or_default(); debug!("SOAP Response: {}", txt); Ok((status, txt)) } } impl Default for Debbugs { fn default() -> Self { Self::new(DEFAULT_URL) } } impl Debbugs { pub fn new(url: &str) -> Self { Debbugs { client: reqwest::Client::new(), url: url.to_string(), } } } pub struct Debbugs { client: reqwest::Client, url: String, } impl Debbugs { pub async fn newest_bugs(&self, amount: i32) -> Result, Error> { let request = soap::newest_bugs_request(amount); let (_status, response) = self.send_soap_request(&request, "newest_bugs").await?; soap::parse_newest_bugs_response(&response).map_err(Error::XmlError) } pub async fn get_bug_log(&self, bug_id: BugId) -> Result, Error> { let request = soap::get_bug_log_request(bug_id); let (_status, response) = self.send_soap_request(&request, "get_bug_log").await?; soap::parse_get_bug_log_response(&response).map_err(Error::XmlError) } pub async fn get_bugs(&self, query: &SearchQuery<'_>) -> Result, Error> { let request = soap::get_bugs_request(query); let (_status, response) = self.send_soap_request(&request, "get_bugs").await?; soap::parse_get_bugs_response(&response).map_err(Error::XmlError) } pub async fn get_status( &self, bug_ids: &[BugId], ) -> Result, Error> { let request = crate::soap::get_status_request(bug_ids); let (_status, response) = self.send_soap_request(&request, "get_status").await?; crate::soap::parse_get_status_response(&response).map_err(Error::XmlError) } pub async fn get_usertag( &self, email: &str, usertags: &[&str], ) -> Result>, Error> { let request = crate::soap::get_usertag_request(email, usertags); let (_status, response) = self.send_soap_request(&request, "get_usertag").await?; crate::soap::parse_get_usertag_response(&response).map_err(Error::XmlError) } } debbugs-0.1.5/src/blocking.rs000064400000000000000000000062121046102023000141700ustar 00000000000000use log::debug; use crate::{BugId, Error, SoapResponse}; impl Debbugs { fn send_soap_request(&self, request: &xmltree::Element, action: &str) -> SoapResponse { let mut body = Vec::new(); request.write(&mut body).expect("failed to generate xml"); debug!("SOAP Request: {}", String::from_utf8_lossy(&body)); let req = self .client .post(&self.url) .body(body) .header("Content-Type", "text/xml") .header("Soapaction", action); let res = req.send()?; let status = res.status(); if status.is_client_error() || status.is_server_error() { let txt = res.text().unwrap(); debug!("SOAP Response: {}", txt); let fault = crate::soap::parse_fault(&txt).map_err(Error::XmlError)?; return Err(Error::Fault(fault)); } debug!("SOAP Status: {}", status); let txt = res.text().unwrap_or_default(); debug!("SOAP Response: {}", txt); Ok((status, txt)) } } impl Default for Debbugs { fn default() -> Self { Self::new(crate::DEFAULT_URL) } } impl Debbugs { pub fn new(url: &str) -> Self { Debbugs { client: reqwest::blocking::Client::new(), url: url.to_string(), } } } /// Blocking client for debbugs pub struct Debbugs { client: reqwest::blocking::Client, url: String, } impl Debbugs { pub fn newest_bugs(&self, amount: i32) -> Result, Error> { let request = crate::soap::newest_bugs_request(amount); let (_status, response) = self.send_soap_request(&request, "newest_bugs")?; crate::soap::parse_newest_bugs_response(&response).map_err(Error::XmlError) } pub fn get_bug_log(&self, bug_id: BugId) -> Result, Error> { let request = crate::soap::get_bug_log_request(bug_id); let (_status, response) = self.send_soap_request(&request, "get_bug_log")?; crate::soap::parse_get_bug_log_response(&response).map_err(Error::XmlError) } pub fn get_bugs(&self, query: &crate::SearchQuery) -> Result, Error> { let request = crate::soap::get_bugs_request(query); let (_status, response) = self.send_soap_request(&request, "get_bugs")?; crate::soap::parse_get_bugs_response(&response).map_err(Error::XmlError) } pub fn get_status( &self, bug_ids: &[BugId], ) -> Result, Error> { let request = crate::soap::get_status_request(bug_ids); let (_status, response) = self.send_soap_request(&request, "get_status")?; crate::soap::parse_get_status_response(&response).map_err(Error::XmlError) } pub fn get_usertag( &self, email: &str, usertags: &[&str], ) -> Result>, Error> { let request = crate::soap::get_usertag_request(email, usertags); let (_status, response) = self.send_soap_request(&request, "get_usertag")?; crate::soap::parse_get_usertag_response(&response).map_err(Error::XmlError) } } debbugs-0.1.5/src/lib.rs000064400000000000000000000077461046102023000131630ustar 00000000000000//! Rust client interface for the Debian Bug Tracking System (Debbugs) //! //! # Examples //! ```no_run //! use debbugs::blocking::Debbugs; //! let debbugs = Debbugs::default(); //! println!("{:?}", debbugs.newest_bugs(10).unwrap()); //!``` //! //! See https://wiki.debian.org/DebbugsSoapInterface for more information on the Debbugs SOAP //! interface. mod soap; pub use soap::{BugLog, BugReport}; const DEFAULT_URL: &str = "https://bugs.debian.org/cgi-bin/soap.cgi"; #[derive(Debug)] pub enum Error { SoapError(String), XmlError(String), ReqwestError(reqwest::Error), Fault(soap::Fault), } impl From for Error { fn from(err: reqwest::Error) -> Self { Error::ReqwestError(err) } } #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum BugStatus { Done, Forwarded, Open, } impl std::str::FromStr for BugStatus { type Err = Error; fn from_str(s: &str) -> Result { match s { "done" => Ok(BugStatus::Done), "forwarded" => Ok(BugStatus::Forwarded), "open" => Ok(BugStatus::Open), _ => Err(Error::SoapError(format!("Unknown status: {}", s))), } } } impl std::fmt::Display for BugStatus { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { BugStatus::Done => f.write_str("done"), BugStatus::Forwarded => f.write_str("forwarded"), BugStatus::Open => f.write_str("open"), } } } #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum Pending { Pending, PendingFixed, Fixed, Done, Forwarded, } impl std::str::FromStr for Pending { type Err = Error; fn from_str(s: &str) -> Result { match s { "pending" => Ok(Pending::Pending), "pending-fixed" => Ok(Pending::PendingFixed), "fixed" => Ok(Pending::Fixed), "done" => Ok(Pending::Done), "forwarded" => Ok(Pending::Forwarded), _ => Err(Error::SoapError(format!("Unknown pending: {}", s))), } } } impl std::fmt::Display for Pending { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Pending::Pending => f.write_str("pending"), Pending::PendingFixed => f.write_str("pending-fixed"), Pending::Done => f.write_str("done"), Pending::Forwarded => f.write_str("forwarded"), Pending::Fixed => f.write_str("fixed"), } } } #[derive(Debug, PartialEq, Eq, Default, Clone, Copy)] pub enum Archived { Archived, #[default] NotArchived, Both, } impl std::str::FromStr for Archived { type Err = Error; fn from_str(s: &str) -> Result { match s { "1" | "archived" => Ok(Archived::Archived), "0" | "unarchived" => Ok(Archived::NotArchived), "both" => Ok(Archived::Both), _ => Err(Error::SoapError(format!("Unknown archived: {}", s))), } } } impl std::fmt::Display for Archived { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Archived::Archived => f.write_str("archived"), Archived::NotArchived => f.write_str("unarchived"), Archived::Both => f.write_str("both"), } } } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match &self { Error::SoapError(err) => write!(f, "SOAP Error: {}", err), Error::XmlError(err) => write!(f, "XML Error: {}", err), Error::ReqwestError(err) => write!(f, "Reqwest Error: {}", err), Error::Fault(err) => write!(f, "Fault: {}", err), } } } impl std::error::Error for Error {} pub type SoapResponse = Result<(reqwest::StatusCode, String), Error>; /// A bug ID type BugId = i32; pub use soap::SearchQuery; #[cfg(feature = "blocking")] pub mod blocking; mod r#async; pub use r#async::Debbugs; debbugs-0.1.5/src/soap.rs000064400000000000000000000722261046102023000133520ustar 00000000000000use debversion::Version; use lazy_regex::regex_is_match; use maplit::hashmap; use crate::BugId; use std::collections::HashMap; use xmltree::{Element, XMLNode}; #[allow(dead_code)] pub const XMLNS_SOAP: &str = "http://xml.apache.org/xml-soap"; pub const XMLNS_SOAPENV: &str = "http://schemas.xmlsoap.org/soap/envelope/"; pub const XMLNS_SOAPENC: &str = "http://schemas.xmlsoap.org/soap/encoding/"; pub const XMLNS_XSI: &str = "http://www.w3.org/1999/XMLSchema-instance"; pub const XMLNS_XSD: &str = "http://www.w3.org/1999/XMLSchema"; pub const XMLNS_DEBBUGS: &str = "Debbugs/SOAP"; #[derive(Debug, PartialEq)] pub struct Fault { pub faultcode: String, pub faultstring: String, pub faultactor: Option, pub detail: Option, } impl std::fmt::Display for Fault { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!( f, "{{ faultcode: {}, faultstring: {}, faultactor: {:?}, detail: {:?} }}", self.faultcode, self.faultstring, self.faultactor, self.detail ) } } fn parse_bool(s: &str) -> Result { match s { "1" => Ok(true), "0" => Ok(false), _ => Err(format!("Invalid boolean value: {}", s)), } } pub(crate) fn parse_fault(input: &str) -> Result { // Parse the input XML string into an Element let root = Element::parse(input.as_bytes()).map_err(|e| e.to_string())?; if root.name != "Envelope" || root.namespace.as_deref() != Some(XMLNS_SOAPENV) { return Err("Root element is not a valid soap:Envelope".into()); } let body_elem = root.get_child("Body").ok_or("soap:Body not found")?; if body_elem.namespace.as_deref() != Some(XMLNS_SOAPENV) { return Err(format!( "Namespace for soap:Body is incorrect: {:?}", body_elem.namespace )); } let fault = body_elem.get_child("Fault").ok_or("soap:Fault not found")?; let faultcode = fault.get_child("faultcode").ok_or("faultcode not found")?; let faultstring = fault .get_child("faultstring") .ok_or("faultstring not found")?; let faultactor = fault.get_child("faultactor"); let detail = fault.get_child("detail"); Ok(Fault { faultcode: faultcode.get_text().unwrap().to_string(), faultstring: faultstring.get_text().unwrap().to_string(), faultactor: faultactor.and_then(|s| s.get_text()).map(|s| s.to_string()), detail: detail.and_then(|s| s.get_text()).map(|s| s.to_string()), }) } fn build_request_envelope(name: &str, arguments: Vec) -> xmltree::Element { let mut namespace = xmltree::Namespace::empty(); namespace.put("soap", XMLNS_SOAPENV); namespace.put("xsi", XMLNS_XSI); namespace.put("xsd", XMLNS_XSD); Element { name: "Envelope".to_string(), prefix: Some("soap".to_string()), namespaces: Some(namespace.clone()), namespace: Some(XMLNS_SOAPENV.to_string()), attributes: hashmap! {}, children: vec![ XMLNode::Element(Element { name: "Header".to_string(), prefix: Some("soap".to_string()), namespaces: Some(namespace.clone()), namespace: Some(XMLNS_SOAPENV.to_string()), attributes: hashmap![], children: vec![], }), XMLNode::Element(Element { name: "Body".to_string(), prefix: Some("soap".to_string()), namespaces: Some(namespace.clone()), namespace: Some(XMLNS_SOAPENV.to_string()), attributes: hashmap![], children: vec![XMLNode::Element(Element { name: name.to_string(), namespaces: None, children: arguments.into_iter().map(XMLNode::Element).collect(), prefix: None, namespace: None, attributes: hashmap! {}, })], }), ], } } pub(crate) fn newest_bugs_request(amount: i32) -> xmltree::Element { build_request_envelope( "newest_bugs", vec![Element { name: "amount".to_string(), namespaces: None, children: vec![XMLNode::Text(amount.to_string())], prefix: None, namespace: None, attributes: hashmap! {}, }], ) } pub(crate) fn get_bug_log_request(bugid: i32) -> xmltree::Element { let mut namespace = xmltree::Namespace::empty(); namespace.put("xsi", XMLNS_XSI); namespace.put("xsd", XMLNS_XSD); build_request_envelope( "get_bug_log", vec![Element { name: "bugnumber".to_string(), namespaces: Some(namespace.clone()), children: vec![XMLNode::Text(bugid.to_string())], prefix: None, namespace: None, attributes: hashmap! { "xsi:type".into() => "xsd:int".into(), }, }], ) } #[test] fn test_newest_bugs_request_serialize() { let request = newest_bugs_request(10); assert_eq!(request.name, "Envelope"); assert_eq!(request.namespace.as_deref(), Some(XMLNS_SOAPENV)); assert_eq!(request.children.len(), 2); let header = request.children[0].as_element().unwrap(); assert_eq!(header.name, "Header"); let body = request.children[1].as_element().unwrap(); assert_eq!(body.name, "Body"); assert_eq!(body.namespace.as_deref(), Some(XMLNS_SOAPENV)); assert_eq!(body.children.len(), 1); let newest_bugs = body.children[0].as_element().unwrap(); assert_eq!(newest_bugs.name, "newest_bugs"); assert_eq!(newest_bugs.namespace, None); assert_eq!(newest_bugs.children.len(), 1); let amount = newest_bugs.children[0].as_element().unwrap(); assert_eq!(amount.name, "amount"); assert_eq!(amount.namespace, None); assert_eq!(amount.children.len(), 1); assert_eq!(amount.children[0].as_text().unwrap(), "10"); } fn parse_response_envelope(input: &str, name: &str) -> Result { // Parse the input XML string into an Element let root = Element::parse(input.as_bytes()).map_err(|e| e.to_string())?; if root.name != "Envelope" || root.namespace.as_deref() != Some(XMLNS_SOAPENV) { return Err("Root element is not a valid soap:Envelope".into()); } let body_elem = root.get_child("Body").ok_or("soap:Body not found")?; if body_elem.namespace.as_deref() != Some(XMLNS_SOAPENV) { return Err(format!( "Namespace for soap:Body is incorrect: {:?}", body_elem.namespace )); } let elem_name = format!("{}Response", name); body_elem .get_child(elem_name.as_str()) .ok_or(format!("{} not found", elem_name)) .cloned() } pub(crate) fn parse_newest_bugs_response(input: &str) -> Result, String> { let response_elem = parse_response_envelope(input, "newest_bugs")?; let array_elem = response_elem .get_child("Array") .ok_or("soapenc:Array not found")?; if array_elem.namespace.as_deref() != Some(XMLNS_SOAPENC) { return Err(format!( "Namespace for soapenc:Array is incorrect: {:?}", array_elem.namespace )); } match array_elem.attributes.get("arrayType") { None => return Err("soapenc:Array does not have soapenc:arrayType attribute".to_string()), Some(value) => { if !regex_is_match!(r"xsd:int\[[0-9]+\]", value) && value != "xsd:anyType[0]" { return Err(format!( "soapenc:Array has incorrect soapenc:arrayType attribute: {}", value )); } } } // Extract the integers from the item elements let mut integers = Vec::new(); for item in array_elem.children.iter() { if let xmltree::XMLNode::Element(e) = item { if e.name == "item" { if let Some(text) = e.get_text() { if let Ok(num) = text.parse() { integers.push(num); } } } } } Ok(integers) } #[test] fn test_parse_newest_bugs_response() { let text = r###"66320663216632266323663246632566326663276632866329"###; let integers = parse_newest_bugs_response(text).unwrap(); assert_eq!( integers, vec![66320, 66321, 66322, 66323, 66324, 66325, 66326, 66327, 66328, 66329] ); } #[derive(Debug)] pub struct BugReport { pub pending: Option, pub msgid: Option, pub owner: Option, #[deprecated = "Use tags instead"] pub keywords: Option, pub affects: Option, /// Has the bug been unrarchived and can be archived again pub unarchived: Option, pub forwarded: Option, pub summary: Option, /// The bugnumber pub bug_num: Option, /// The bug is archived or not pub archived: Option, pub found_versions: Option>, pub done: Option, /// Severity of the bugreport pub severity: Option, /// Package of the bugreport pub package: Option, pub fixed_versions: Option, Option)>>, pub originator: Option, pub blocks: Option, #[deprecated(note = "empty for now")] pub found_date: Option>, pub outlook: Option, #[deprecated(note = "use bug_num")] pub id: Option, pub found: bool, pub fixed: bool, pub last_modified: Option, pub tags: Option, /// Subject/Title of the bugreport pub subject: Option, pub location: Option, /// The bugs this bug was merged with pub mergedwith: Option>, pub blockedby: Option, #[deprecated(note = "empty for now")] pub fixed_date: Option>, pub log_modified: Option, pub source: Option, } impl std::fmt::Display for BugReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { if let Some(bug_num) = self.bug_num { write!(f, "Bug #{}", bug_num)?; } else { write!(f, "Bug #?")?; } if let Some(package) = &self.package { write!(f, " in {}", package)?; } if let Some(summary) = &self.summary { write!(f, ": {}", summary)?; } Ok(()) } } fn parse_version(input: &str) -> (Option, Option) { match input.split_once('/') { None => (None, input.parse().ok()), Some((package, version)) => (Some(package.to_string()), version.parse().ok()), } } // Hide the deprecated warnings, since we intentionally still populate the deprecated fields #[allow(deprecated)] impl From<&xmltree::Element> for BugReport { fn from(item: &xmltree::Element) -> Self { Self { pending: item .get_child("pending") .map(|e| e.get_text().unwrap().parse().unwrap()), msgid: item .get_child("msgid") .and_then(|e| e.get_text()) .map(|s| s.to_string()), owner: item .get_child("owner") .and_then(|e| e.get_text()) .map(|s| s.to_string()), keywords: item .get_child("keywords") .and_then(|e| e.get_text()) .map(|s| s.to_string()), affects: item .get_child("affects") .and_then(|e| e.get_text()) .map(|s| s.to_string()), unarchived: item .get_child("unarchived") .and_then(|e| e.get_text()) .as_ref() .and_then(|s| parse_bool(s).ok()), blocks: item .get_child("blocks") .and_then(|e| e.get_text()) .map(|s| s.to_string()), found_date: item.get_child("found_date").map(|e| { e.children .iter() .filter_map(|c| c.as_element()) .filter_map(|c| { if c.name == "item" { Some(c.get_text().unwrap().parse().unwrap()) } else { None } }) .collect::>() }), fixed_versions: item.get_child("fixed_versions").map(|f| { f.children .iter() .filter_map(|c| { c.as_element() .and_then(|c| if c.name == "item" { Some(c) } else { None }) }) .map(|d| parse_version(d.get_text().unwrap().as_ref())) .collect::>() }), outlook: item .get_child("outlook") .and_then(|e| e.get_text()) .map(|s| s.to_string()), done: item .get_child("done") .and_then(|e| e.get_text()) .map(|t| t.to_string()), forwarded: item .get_child("forwarded") .and_then(|e| e.get_text()) .map(|s| s.to_string()), summary: item .get_child("summary") .and_then(|e| e.get_text()) .map(|s| s.to_string()), bug_num: item .get_child("bug_num") .map(|e| e.get_text().unwrap().parse().unwrap()), id: item .get_child("id") .map(|e| e.get_text().unwrap().parse().unwrap()), archived: item .get_child("archived") .and_then(|e| e.get_text()) .as_ref() .map(|t| parse_bool(t).unwrap()), found_versions: item.get_child("found_versions").map(|f| { f.children .iter() .filter_map(|c| { c.as_element() .and_then(|c| if c.name == "item" { Some(c) } else { None }) }) .filter_map(|d| d.get_text().and_then(|v| v.parse::().ok())) .collect::>() }), found: item.get_child("found").is_some(), fixed: item.get_child("fixed").is_some(), last_modified: item .get_child("last_modified") .map(|e| e.get_text().unwrap().parse().unwrap()), tags: item .get_child("tags") .and_then(|e| e.get_text()) .map(|s| s.to_string()), subject: item .get_child("subject") .and_then(|e| e.get_text()) .map(|s| s.to_string()), source: item .get_child("source") .and_then(|e| e.get_text()) .map(|s| s.to_string()), originator: item .get_child("originator") .and_then(|e| e.get_text()) .map(|s| s.to_string()), package: item .get_child("package") .and_then(|e| e.get_text()) .map(|s| s.to_string()), location: item .get_child("location") .and_then(|e| e.get_text()) .map(|s| s.to_string()), log_modified: item .get_child("log_modified") .map(|e| e.get_text().unwrap().parse().unwrap()), mergedwith: item .get_child("mergedwith") .and_then(|e| e.get_text()) .map(|s| s.split_whitespace().map(|i| i.parse().unwrap()).collect()), severity: item .get_child("severity") .and_then(|e| e.get_text()) .map(|s| s.to_string()), blockedby: item .get_child("blockedby") .and_then(|e| e.get_text()) .map(|s| s.to_string()), fixed_date: item.get_child("fixed_date").map(|e| { e.children .iter() .filter_map(|c| c.as_element()) .filter_map(|c| { if c.name == "item" { Some(c.get_text().unwrap().parse().unwrap()) } else { None } }) .collect::>() }), } } } #[derive(Debug, Clone)] pub struct BugLog { pub header: String, pub msgnum: BugId, pub body: String, } impl BugLog { #[cfg(feature = "mailparse")] pub fn headers(&self) -> Result, mailparse::MailParseError> { let (headers, _ix_body) = mailparse::parse_headers(self.header.as_bytes())?; Ok(headers) } } fn parse_buglog(item: &xmltree::Element) -> Result { let mut header = None; let mut msgnum = None; let mut body = None; for child in item.children.iter() { if let xmltree::XMLNode::Element(e) = child { match e.name.as_str() { "header" => { header = Some(e.get_text().unwrap().to_string()); } "msg_num" => { msgnum = Some(e.get_text().unwrap().parse().unwrap()); } "body" => { body = Some(e.get_text().unwrap().to_string()); } "attachments" => { if !e.children.is_empty() { panic!("Attachments not supported yet"); } } n => { panic!("Unknown element: {}", n) } } } } Ok(BugLog { header: header.unwrap(), msgnum: msgnum.unwrap(), body: body.unwrap(), }) } pub(crate) fn parse_get_bug_log_response(input: &str) -> Result, String> { let response_elem = parse_response_envelope(input, "get_bug_log")?; let array_elem = response_elem .get_child("Array") .ok_or("soapenc:Array not found")?; if array_elem.namespace.as_deref() != Some(XMLNS_SOAPENC) { return Err(format!( "Namespace for soapenc:Array is incorrect: {:?}", array_elem.namespace )); } match array_elem.attributes.get("arrayType") { None => return Err("soapenc:Array does not have soapenc:arrayType attribute".to_string()), Some(value) => { if !regex_is_match!(r"xsd:ur-type\[[0-9]+\]", value) && value != "xsd:anyType[0]" { return Err(format!( "soapenc:Array has incorrect soapenc:arrayType attribute: {}", value )); } } } if array_elem.attributes.get("type") != Some(&"soapenc:Array".to_string()) { return Err(format!( "soapenc:Array does not have xsi:type attribute: {:?}", array_elem.attributes.get("type") )); } let mut ret = vec![]; for item in array_elem.children.iter() { if let xmltree::XMLNode::Element(e) = item { if e.name == "item" { ret.push(parse_buglog(e)?); } } } Ok(ret) } trait ToArgXml { fn to_arg_xml(&self, name: String) -> xmltree::Element; } impl ToArgXml for &str { fn to_arg_xml(&self, name: String) -> xmltree::Element { xmltree::Element { prefix: None, namespace: None, namespaces: None, name, attributes: HashMap::new(), children: vec![xmltree::XMLNode::Text(self.to_string())], } } } impl ToArgXml for &[&str] { fn to_arg_xml(&self, name: String) -> xmltree::Element { let mut namespace = xmltree::Namespace::empty(); namespace.put("xsi", XMLNS_XSI); namespace.put("soapenc", XMLNS_SOAPENC); namespace.put("xsd", XMLNS_XSD); let mut children = Vec::new(); for s in self.iter() { children.push(xmltree::Element { prefix: None, namespace: None, namespaces: None, name: "item".to_string(), attributes: hashmap! { "xsi:type".to_string() => "xsd:string".to_string(), }, children: vec![xmltree::XMLNode::Text(s.to_string())], }); } xmltree::Element { prefix: None, namespace: None, namespaces: Some(namespace), name, attributes: hashmap! { "xsi:type".to_string() => "soapenc:Array".to_string(), "soapenc:arrayType".to_string() => "xsd:string[]".to_string(), }, children: children .into_iter() .map(xmltree::XMLNode::Element) .collect(), } } } impl ToArgXml for &[BugId] { fn to_arg_xml(&self, name: String) -> xmltree::Element { let mut namespace = xmltree::Namespace::empty(); namespace.put("xsi", XMLNS_XSI); namespace.put("soapenc", XMLNS_SOAPENC); namespace.put("xsd", XMLNS_XSD); let mut children = Vec::new(); for bug_id in self.iter() { children.push(xmltree::Element { prefix: None, namespace: None, namespaces: None, name: "item".to_string(), attributes: hashmap! { "xsi:type".to_string() => "xsd:int".to_string(), }, children: vec![xmltree::XMLNode::Text(bug_id.to_string())], }); } xmltree::Element { prefix: None, namespace: None, namespaces: Some(namespace), name, attributes: hashmap! { "xsi:type".to_string() => "soapenc:Array".to_string(), "soapenc:arrayType".to_string() => format!("xsd:int[{}]", self.len()), }, children: children .into_iter() .map(xmltree::XMLNode::Element) .collect(), } } } fn add_arg_xml(params: &mut Vec, arg: T) { params.push(arg.to_arg_xml(format!("arg{}", params.len()))); } #[derive(Debug, Default, Clone)] pub struct SearchQuery<'a> { pub package: Option<&'a str>, pub bug_ids: Option<&'a [BugId]>, pub submitter: Option<&'a str>, pub maintainer: Option<&'a str>, pub src: Option<&'a str>, pub severity: Option<&'a str>, pub status: Option, pub owner: Option<&'a str>, pub correspondent: Option<&'a str>, pub archive: Option, pub tag: Option<&'a [&'a str]>, } pub(crate) fn get_bugs_request(query: &SearchQuery) -> xmltree::Element { let mut params = Vec::new(); if let Some(package) = query.package { add_arg_xml(&mut params, "package"); add_arg_xml(&mut params, package); } if let Some(bug_ids) = query.bug_ids { add_arg_xml(&mut params, "bugs"); add_arg_xml(&mut params, bug_ids); } if let Some(submitter) = query.submitter { add_arg_xml(&mut params, "submitter"); add_arg_xml(&mut params, submitter); } if let Some(maintainer) = query.maintainer { add_arg_xml(&mut params, "maint"); add_arg_xml(&mut params, maintainer); } if let Some(src) = query.src { add_arg_xml(&mut params, "src"); add_arg_xml(&mut params, src); } if let Some(severity) = query.severity { add_arg_xml(&mut params, "severity"); add_arg_xml(&mut params, severity); } if let Some(status) = query.status { add_arg_xml(&mut params, "status"); add_arg_xml(&mut params, status.to_string().as_str()); } if let Some(owner) = query.owner { add_arg_xml(&mut params, "owner"); add_arg_xml(&mut params, owner); } if let Some(correspondent) = query.correspondent { add_arg_xml(&mut params, "correspondent"); add_arg_xml(&mut params, correspondent); } if let Some(archive) = query.archive { add_arg_xml(&mut params, "archive"); add_arg_xml(&mut params, archive.to_string().as_str()); } if let Some(tag) = query.tag { add_arg_xml(&mut params, "tag"); add_arg_xml(&mut params, tag); } build_request_envelope("get_bugs", params) } pub(crate) fn parse_get_bugs_response(input: &str) -> Result, String> { let response_elem = parse_response_envelope(input, "get_bugs")?; let array_elem = response_elem .get_child("Array") .ok_or("soapenc:Array not found")?; if array_elem.namespace.as_deref() != Some(XMLNS_SOAPENC) { return Err(format!( "Namespace for soapenc:Array is incorrect: {:?}", array_elem.namespace )); } match array_elem.attributes.get("arrayType") { None => return Err("soapenc:Array does not have soapenc:arrayType attribute".to_string()), Some(value) => { if !regex_is_match!(r"xsd:int\[[0-9]+\]", value) && value != "xsd:anyType[0]" { return Err(format!( "soapenc:Array has incorrect soapenc:arrayType attribute: {}", value )); } } } // Extract the integers from the item elements let mut integers = Vec::new(); for item in array_elem.children.iter() { if let xmltree::XMLNode::Element(e) = item { if e.name == "item" { if let Some(text) = e.get_text() { if let Ok(num) = text.parse() { integers.push(num); } } } } } Ok(integers) } pub(crate) fn get_status_request(bug_ids: &[BugId]) -> xmltree::Element { let mut params = Vec::new(); add_arg_xml(&mut params, bug_ids); build_request_envelope("get_status", params) } pub(crate) fn parse_get_status_response(input: &str) -> Result, String> { let response_elem = parse_response_envelope(input, "get_status")?; if response_elem.namespace.as_deref() != Some(XMLNS_DEBBUGS) { return Err(format!( "Namespace for get_statusResponse is incorrect: {:?}", response_elem.namespace )); } let container = response_elem .get_child("s-gensym3") .ok_or("s-gensym3 not found")?; let mut ret = HashMap::new(); for item in container.children.iter() { if let xmltree::XMLNode::Element(e) = item { if e.name == "item" { if e.namespace.as_deref() != Some(XMLNS_DEBBUGS) { return Err(format!( "Namespace for item is incorrect: {:?}", e.namespace )); } let key = e .get_child("key") .ok_or("key not found")? .get_text() .ok_or("key has no text")? .parse::() .unwrap(); let value = BugReport::from(e.get_child("value").ok_or("value not found")?); ret.insert(key, value); } } } Ok(ret) } pub(crate) fn get_usertag_request(email: &str, tags: &[&str]) -> xmltree::Element { let mut params = Vec::new(); add_arg_xml(&mut params, email); for tag in tags { add_arg_xml(&mut params, *tag); } build_request_envelope("get_usertag", params) } pub(crate) fn parse_get_usertag_response( input: &str, ) -> Result>, String> { let response_elem = parse_response_envelope(input, "get_usertag")?; let container = response_elem .get_child("s-gensym3") .ok_or("s-gensym3 not found")?; let mut ret = HashMap::new(); for child in container.children.iter() { if let Some(e) = child.as_element() { let mut ids = vec![]; for item in e.children.iter() { if let xmltree::XMLNode::Element(e) = item { if e.name == "item" { ids.push(e.get_text().unwrap().parse::().unwrap()); } } } ret.insert(e.name.clone(), ids); } } Ok(ret) }