debbugs-0.1.8/.cargo_vcs_info.json0000644000000001360000000000100124550ustar { "git": { "sha1": "d9ee8bc0cc79e259adc5f99686c2fd813df5bf46" }, "path_in_vcs": "" }debbugs-0.1.8/.codespellrc000064400000000000000000000000461046102023000135450ustar 00000000000000[codespell] ignore-words-list = crate debbugs-0.1.8/.github/CODEOWNERS000064400000000000000000000000121046102023000141710ustar 00000000000000* @jelmer debbugs-0.1.8/.github/FUNDING.yml000064400000000000000000000000171046102023000144200ustar 00000000000000github: jelmer debbugs-0.1.8/.github/dependabot.yml000064400000000000000000000006251046102023000154400ustar 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.8/.github/workflows/auto-merge.yml000064400000000000000000000011341046102023000174310ustar 00000000000000name: Dependabot auto-merge on: pull_request_target permissions: pull-requests: write contents: write jobs: dependabot: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v2 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} debbugs-0.1.8/.github/workflows/disperse.yml000064400000000000000000000002741046102023000172060ustar 00000000000000--- name: Disperse configuration "on": - push jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: jelmer/action-disperse-validate@v2 debbugs-0.1.8/.github/workflows/rust.yml000064400000000000000000000016501046102023000163640ustar 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@v5 - name: Build run: cargo build --verbose env: RUSTFLAGS: -Dwarnings - name: Run tests run: cargo test --verbose env: RUSTFLAGS: -Dwarnings minimal-versions: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Install stable Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - name: Install cargo-minimal-versions and cargo-hack run: cargo install cargo-minimal-versions cargo-hack - name: Run tests with minimal versions run: cargo minimal-versions --direct test --verbose env: RUSTFLAGS: -Dwarnings debbugs-0.1.8/.gitignore000064400000000000000000000000331046102023000132310ustar 00000000000000/target examples/all.rs *~ debbugs-0.1.8/CODE_OF_CONDUCT.md000064400000000000000000000125451046102023000140530ustar 00000000000000 # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations debbugs-0.1.8/Cargo.lock0000644000001377450000000000100104510ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "aho-corasick" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] [[package]] name = "anstream" version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", "once_cell_polyfill", "windows-sys 0.60.2", ] [[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.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "bumpalo" version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[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.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "739eb0f94557554b3ca9a86d2d37bebd49c5e6d0c1d2bda35ba5bdac830befc2" dependencies = [ "find-msvc-tools", "shlex", ] [[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[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 = "chrono" version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ "num-traits", ] [[package]] name = "colorchoice" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[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.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debbugs" version = "0.1.8" dependencies = [ "debversion", "env_logger", "lazy-regex", "log", "mailparse", "maplit", "reqwest", "tokio", "xmltree", ] [[package]] name = "debversion" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4f5cc9ce1d5067bee8060dd75208525dd0133ffea0b2960fef64ab85d58c4c5" dependencies = [ "chrono", "lazy-regex", "num-bigint", ] [[package]] name = "displaydoc" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "env_filter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" dependencies = [ "log", "regex", ] [[package]] name = "env_logger" version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", "env_filter", "jiff", "log", ] [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", "windows-sys 0.61.2", ] [[package]] name = "fastrand" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" [[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.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", ] [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-sink" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[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-io", "futures-sink", "futures-task", "memchr", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "getrandom" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", "wasi", ] [[package]] name = "getrandom" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", "r-efi", "wasip2", ] [[package]] name = "h2" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", "http", "indexmap", "slab", "tokio", "tokio-util", "tracing", ] [[package]] name = "hashbrown" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" [[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.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", "h2", "http", "http-body", "httparse", "itoa", "pin-project-lite", "pin-utils", "smallvec", "tokio", "want", ] [[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", "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.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ "base64", "bytes", "futures-channel", "futures-core", "futures-util", "http", "http-body", "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", "socket2", "system-configuration", "tokio", "tower-service", "tracing", "windows-registry", ] [[package]] name = "icu_collections" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_locale_core" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", "tinystr", "writeable", "zerovec", ] [[package]] name = "icu_normalizer" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", "zerovec", ] [[package]] name = "icu_normalizer_data" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" dependencies = [ "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" [[package]] name = "icu_provider" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", "writeable", "yoke", "zerofrom", "zerotrie", "zerovec", ] [[package]] name = "idna" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", "utf8_iter", ] [[package]] name = "idna_adapter" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "indexmap" version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" dependencies = [ "memchr", "serde", ] [[package]] name = "is_terminal_polyfill" version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", "serde", ] [[package]] name = "jiff-static" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "js-sys" version = "0.3.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" dependencies = [ "once_cell", "wasm-bindgen", ] [[package]] name = "lazy-regex" version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "191898e17ddee19e60bccb3945aa02339e81edd4a8c50e21fd4d48cdecda7b29" dependencies = [ "lazy-regex-proc_macros", "once_cell", "regex", ] [[package]] name = "lazy-regex-proc_macros" version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c35dc8b0da83d1a9507e12122c80dea71a9c7c613014347392483a83ea593e04" dependencies = [ "proc-macro2", "quote", "regex", "syn", ] [[package]] name = "libc" version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "linux-raw-sys" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ "scopeguard", ] [[package]] name = "log" version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "mailparse" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60819a97ddcb831a5614eb3b0174f3620e793e97e09195a395bfa948fd68ed2f" 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.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mio" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", "wasi", "windows-sys 0.61.2", ] [[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", "security-framework-sys", "tempfile", ] [[package]] name = "num-bigint" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", ] [[package]] name = "num-integer" version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ "num-traits", ] [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openssl" version = "0.10.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654" 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.110" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "parking_lot" version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", "windows-link 0.2.1", ] [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[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 = "portable-atomic" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portable-atomic-util" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" dependencies = [ "portable-atomic", ] [[package]] name = "potential_utf" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ "zerovec", ] [[package]] name = "proc-macro2" version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" 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 = "r-efi" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] [[package]] name = "regex" version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" version = "0.12.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" 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", "js-sys", "log", "mime", "native-tls", "percent-encoding", "pin-project-lite", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", "tokio-native-tls", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", ] [[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 = "rustix" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys 0.61.2", ] [[package]] name = "rustls" version = "0.23.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7" dependencies = [ "once_cell", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-pki-types" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a" dependencies = [ "zeroize", ] [[package]] name = "rustls-webpki" version = "0.103.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ "ring", "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ "windows-sys 0.61.2", ] [[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.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "serde" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", ] [[package]] name = "serde_core" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", "serde_core", ] [[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.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", "windows-sys 0.60.2", ] [[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[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.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] [[package]] name = "synstructure" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", "syn", ] [[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.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", "getrandom 0.3.4", "once_cell", "rustix", "windows-sys 0.61.2", ] [[package]] name = "tinystr" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", ] [[package]] name = "tokio" version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ "bytes", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" 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.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", ] [[package]] name = "tokio-util" version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "tower" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", "sync_wrapper", "tokio", "tower-layer", "tower-service", ] [[package]] name = "tower-http" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ "bitflags", "bytes", "futures-util", "http", "http-body", "iri-string", "pin-project-lite", "tower", "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.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.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[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.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", "serde", ] [[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[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.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" dependencies = [ "cfg-if", "js-sys", "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" dependencies = [ "bumpalo", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" version = "0.3.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "windows-link" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-registry" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ "windows-link 0.1.3", "windows-result", "windows-strings", ] [[package]] name = "windows-result" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ "windows-link 0.1.3", ] [[package]] name = "windows-strings" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ "windows-link 0.1.3", ] [[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.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ "windows-targets 0.53.5", ] [[package]] name = "windows-sys" version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link 0.2.1", ] [[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.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ "windows-link 0.2.1", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", "windows_i686_gnullvm 0.53.1", "windows_i686_msvc 0.53.1", "windows_x86_64_gnu 0.53.1", "windows_x86_64_gnullvm 0.53.1", "windows_x86_64_msvc 0.53.1", ] [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "wit-bindgen" version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "xml-rs" version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" [[package]] name = "xmltree" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b619f8c85654798007fb10afa5125590b43b088c225a25fc2fec100a9fad0fc6" dependencies = [ "xml-rs", ] [[package]] name = "yoke" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ "stable_deref_trait", "yoke-derive", "zerofrom", ] [[package]] name = "yoke-derive" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zerofrom" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" dependencies = [ "displaydoc", "yoke", "zerofrom", ] [[package]] name = "zerovec" version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", "zerovec-derive", ] [[package]] name = "zerovec-derive" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", "syn", ] debbugs-0.1.8/Cargo.toml0000644000000043750000000000100104640ustar # 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.8" authors = ["Jelmer Vernooij "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Debian Bugtracking System API client" documentation = "https://docs.rs/debbugs" readme = "README.md" keywords = [ "debian", "bugs", "api", "soap", ] categories = [ "api-bindings", "development-tools", ] license = "Apache-2.0" repository = "https://github.com/jelmer/debbugs-rs" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", ] [features] blocking = ["reqwest/blocking"] default = [ "blocking", "tokio", "mailparse", ] mailparse = ["dep:mailparse"] tokio = ["dep:tokio"] [lib] name = "debbugs" path = "src/lib.rs" [[example]] name = "get_bug_log" path = "examples/get_bug_log.rs" required-features = ["tokio"] [[example]] name = "get_bugs" path = "examples/get_bugs.rs" required-features = ["tokio"] [[example]] name = "get_status" path = "examples/get_status.rs" [[example]] name = "get_usertag" path = "examples/get_usertag.rs" required-features = ["tokio"] [[example]] name = "newest" path = "examples/newest.rs" required-features = ["tokio"] [[example]] name = "wnpp_bugs" path = "examples/wnpp_bugs.rs" required-features = ["tokio"] [dependencies.debversion] version = ">=0.4,<0.6" [dependencies.env_logger] version = ">=0.11, <0.12" optional = true [dependencies.lazy-regex] version = ">=2.3, <4" [dependencies.log] version = "0.4.8" [dependencies.mailparse] version = "0.16" optional = true [dependencies.maplit] version = "1" [dependencies.reqwest] version = ">=0.11, <0.13" [dependencies.tokio] version = "1.13" features = ["full"] optional = true [dependencies.xmltree] version = ">=0.10,<0.12" debbugs-0.1.8/Cargo.toml.orig000064400000000000000000000024261046102023000141400ustar 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.8" 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" documentation = "https://docs.rs/debbugs" keywords = ["debian", "bugs", "api", "soap"] categories = ["api-bindings", "development-tools"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] lazy-regex = ">=2.3, <4" log = "0.4.8" maplit = "1" reqwest = ">=0.11, <0.13" xmltree = ">=0.10,<0.12" debversion = ">=0.4,<0.6" [features] blocking = [ "reqwest/blocking",] default = [ "blocking", "tokio", "mailparse",] tokio = [ "dep:tokio",] mailparse = [ "dep:mailparse",] [dependencies.mailparse] version = "0.16" optional = true [dependencies.env_logger] version = ">=0.11, <0.12" optional = true [dependencies.tokio] version = "1.13" optional = true features = [ "full",] debbugs-0.1.8/LICENSE000064400000000000000000000261361046102023000122620ustar 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.8/README.md000064400000000000000000000060201046102023000125220ustar 00000000000000# debbugs-rs A Rust client library for the [Debian Bug Tracking System (Debbugs)](https://wiki.debian.org/DebbugsSoapInterface). This crate provides a simple wrapper around the SOAP API for the Debian bug tracking system, allowing you to query bug reports, search for bugs, and retrieve detailed information programmatically. ## Features - **Async and blocking interfaces**: Choose between `debbugs::Debbugs` (async) and `debbugs::blocking::Debbugs` (blocking) - **Comprehensive bug data**: Access bug reports, logs, and metadata - **Search functionality**: Search bugs by package, status, severity, and more - **Mail parsing**: Optional mail parsing support with the `mailparse` feature ## Installation Add this to your `Cargo.toml`: ```toml [dependencies] debbugs = "0.1" ``` ### Feature Flags - `blocking` (default): Enables the blocking client interface - `tokio` (default): Enables the async client interface - `mailparse` (default): Enables parsing of email messages in bug logs ## Usage ### Async Interface ```rust use debbugs::Debbugs; #[tokio::main] async fn main() -> Result<(), Box> { let client = Debbugs::default(); // Get the 10 newest bugs let bugs = client.newest_bugs(10).await?; println!("Latest bugs: {:?}", bugs); // Get detailed status for specific bugs let reports = client.get_status(&[12345, 67890]).await?; for report in reports { println!("Bug #{}: {}", report.bugnumber, report.subject); } // Search for bugs in a specific package let search = debbugs::SearchQuery { package: Some("rust-debbugs".to_string()), ..Default::default() }; let found_bugs = client.get_bugs(search).await?; println!("Found {} bugs in package", found_bugs.len()); Ok(()) } ``` ### Blocking Interface ```rust use debbugs::blocking::Debbugs; fn main() -> Result<(), Box> { let client = Debbugs::default(); // Get the 10 newest bugs let bugs = client.newest_bugs(10)?; println!("Latest bugs: {:?}", bugs); // Get bug logs with messages let logs = client.get_bug_log(12345)?; for log in logs { println!("Message: {}", log.header); } Ok(()) } ``` ### Custom Server ```rust use debbugs::Debbugs; let client = Debbugs::new("https://custom-debbugs.example.com/soap.cgi"); ``` ## Examples The repository includes several examples in the `examples/` directory: - `newest.rs` - Fetch the newest bugs - `get_status.rs` - Get detailed status for specific bugs - `get_bugs.rs` - Search for bugs matching criteria - `get_bug_log.rs` - Retrieve bug logs and messages - `wnpp_bugs.rs` - Find Work-Needing and Prospective Packages (WNPP) bugs - `all.rs` - Fetch all bugs (use with caution!) Run an example with: ```bash cargo run --example newest --features tokio ``` ## Documentation - [API Documentation](https://docs.rs/debbugs) - [Debian Debbugs SOAP Interface](https://wiki.debian.org/DebbugsSoapInterface) ## License Licensed under the Apache License, Version 2.0. debbugs-0.1.8/TODO000064400000000000000000000000331046102023000117310ustar 00000000000000- get_usertag - search_est debbugs-0.1.8/disperse.toml000064400000000000000000000001371046102023000137610ustar 00000000000000tag-name = "v$VERSION" release-timeout = 5 [github] url = "https://github.com/jelmer/debbugs" debbugs-0.1.8/examples/get_bug_log.rs000064400000000000000000000003701046102023000157060ustar 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.8/examples/get_bugs.rs000064400000000000000000000021551046102023000152330ustar 00000000000000//! Search for bugs matching specific criteria //! //! This example demonstrates how to search for bugs using the SearchQuery //! interface. In this case, we're searching for all open bugs in the //! "samba" package. //! //! Run with: cargo run --example get_bugs --features tokio #[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::{BugStatus, Debbugs, SearchQuery}; let debbugs = Debbugs::default(); // Search for all open bugs in the samba package let query = SearchQuery { package: Some("samba"), status: Some(BugStatus::Open), ..Default::default() }; match debbugs.get_bugs(&query).await { Ok(bugs) => { println!("Found {} open bugs in samba package:", bugs.len()); for bug_id in bugs.iter().take(10) { // Show first 10 println!(" Bug #{}", bug_id); } if bugs.len() > 10 { println!(" ... and {} more", bugs.len() - 10); } } Err(e) => eprintln!("Error searching for bugs: {}", e), } } debbugs-0.1.8/examples/get_status.rs000064400000000000000000000025731046102023000156220ustar 00000000000000//! Retrieve detailed status information for specific bugs //! //! This example demonstrates how to get comprehensive bug reports //! for specific bug IDs. The status includes title, severity, package, //! current state, and much more metadata. //! //! Run with: cargo run --example get_status --features tokio #[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); // Get detailed status for specific bug IDs let bug_ids = [42343, 10432]; match debbugs.get_status(&bug_ids).await { Ok(reports) => { println!("Retrieved status for {} bugs:", reports.len()); for (bug_id, report) in reports { println!("\nBug #{}:", bug_id); if let Some(subject) = &report.subject { println!(" Subject: {}", subject); } if let Some(package) = &report.package { println!(" Package: {}", package); } if let Some(severity) = &report.severity { println!(" Severity: {}", severity); } if let Some(tags) = &report.tags { println!(" Tags: {}", tags); } } } Err(e) => eprintln!("Error fetching bug status: {}", e), } } debbugs-0.1.8/examples/get_usertag.rs000064400000000000000000000005551046102023000157470ustar 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.8/examples/newest.rs000064400000000000000000000013441046102023000147400ustar 00000000000000//! Fetch the 10 newest bugs from the Debian bug tracking system //! //! This example demonstrates how to use the async client to retrieve //! the most recently reported bugs. The result is a list of bug IDs //! ordered from newest to oldest. //! //! Run with: cargo run --example newest --features tokio #[tokio::main] async fn main() { #[cfg(feature = "env_logger")] env_logger::init(); use debbugs::Debbugs; let debbugs = Debbugs::default(); match debbugs.newest_bugs(10).await { Ok(bugs) => { println!("Latest 10 bugs:"); for bug_id in bugs { println!(" Bug #{}", bug_id); } } Err(e) => eprintln!("Error fetching bugs: {}", e), } } debbugs-0.1.8/examples/wnpp_bugs.rs000064400000000000000000000010671046102023000154410ustar 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.8/src/async.rs000064400000000000000000000204021046102023000135150ustar 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 { /// Creates a new Debbugs client connected to the default Debian instance /// /// Uses the official Debian bug tracking system at bugs.debian.org fn default() -> Self { Self::new(DEFAULT_URL) } } impl Debbugs { /// Creates a new Debbugs client for a custom server /// /// # Arguments /// /// * `url` - The URL of the Debbugs SOAP endpoint /// /// # Examples /// /// ```no_run /// use debbugs::Debbugs; /// /// let client = Debbugs::new("https://custom-debbugs.example.com/soap.cgi"); /// ``` pub fn new>(url: S) -> Self { Debbugs { client: reqwest::Client::new(), url: url.into(), } } } /// Async client for the Debian Bug Tracking System (Debbugs) /// /// This client provides an async interface to query bug reports, search for bugs, /// and retrieve detailed information from a Debbugs instance. /// /// # Examples /// /// ```no_run /// use debbugs::Debbugs; /// /// #[tokio::main] /// async fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let bugs = client.newest_bugs(10).await?; /// println!("Found {} newest bugs", bugs.len()); /// Ok(()) /// } /// ``` pub struct Debbugs { client: reqwest::Client, url: String, } impl Debbugs { /// Retrieves the newest bugs from the bug tracking system /// /// Returns a list of bug IDs, ordered from newest to oldest. /// /// # Arguments /// /// * `amount` - The maximum number of bug IDs to retrieve /// /// # Examples /// /// ```no_run /// use debbugs::Debbugs; /// /// #[tokio::main] /// async fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let bugs = client.newest_bugs(5).await?; /// println!("Latest 5 bugs: {:?}", bugs); /// Ok(()) /// } /// ``` 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) } /// Retrieves the complete log of messages for a specific bug /// /// Returns all messages (emails) that have been sent regarding this bug, /// including the initial bug report and all subsequent correspondence. /// /// # Arguments /// /// * `bug_id` - The ID of the bug to retrieve logs for /// /// # Examples /// /// ```no_run /// use debbugs::Debbugs; /// /// #[tokio::main] /// async fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let logs = client.get_bug_log(12345).await?; /// for log in logs { /// println!("Message: {}", log.header); /// } /// Ok(()) /// } /// ``` 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) } /// Searches for bugs matching the specified criteria /// /// Returns a list of bug IDs that match the search query. Use `SearchQuery` /// to specify search parameters like package, severity, status, etc. /// /// # Arguments /// /// * `query` - Search criteria for finding bugs /// /// # Examples /// /// ```no_run /// use debbugs::{Debbugs, SearchQuery}; /// /// #[tokio::main] /// async fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let search = SearchQuery { /// package: Some("rust-debbugs"), /// severity: Some("serious"), /// ..Default::default() /// }; /// let bugs = client.get_bugs(&search).await?; /// println!("Found {} serious bugs in rust-debbugs", bugs.len()); /// Ok(()) /// } /// ``` 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) } /// Retrieves detailed status information for specific bugs /// /// Returns a map of bug IDs to their detailed bug reports, including /// information like title, severity, status, package, and more. /// /// # Arguments /// /// * `bug_ids` - A slice of bug IDs to retrieve status for /// /// # Examples /// /// ```no_run /// use debbugs::Debbugs; /// /// #[tokio::main] /// async fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let reports = client.get_status(&[12345, 67890]).await?; /// for (bug_id, report) in reports { /// println!("Bug #{}: {} ({})", /// bug_id, /// report.subject.as_deref().unwrap_or("No subject"), /// report.severity.as_deref().unwrap_or("No severity") /// ); /// } /// Ok(()) /// } /// ``` 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) } /// Retrieves user tags for a specific email address /// /// User tags allow users to categorize bugs with custom labels. /// This method returns bugs tagged by a specific user. /// /// # Arguments /// /// * `email` - The email address of the user whose tags to retrieve /// * `usertags` - A slice of specific tag names to filter by (empty slice for all tags) /// /// # Returns /// /// A map where keys are tag names and values are lists of bug IDs with that tag. /// /// # Examples /// /// ```no_run /// use debbugs::Debbugs; /// /// #[tokio::main] /// async fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let tags = client.get_usertag("user@example.com", &[]).await?; /// for (tag, bugs) in tags { /// println!("Tag '{}' has {} bugs", tag, bugs.len()); /// } /// Ok(()) /// } /// ``` 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.8/src/blocking.rs000064400000000000000000000201631046102023000141740ustar 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 { /// Creates a new blocking Debbugs client connected to the default Debian instance /// /// Uses the official Debian bug tracking system at bugs.debian.org fn default() -> Self { Self::new(crate::DEFAULT_URL) } } impl Debbugs { /// Creates a new blocking Debbugs client for a custom server /// /// # Arguments /// /// * `url` - The URL of the Debbugs SOAP endpoint /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// /// let client = Debbugs::new("https://custom-debbugs.example.com/soap.cgi"); /// ``` pub fn new>(url: S) -> Self { Debbugs { client: reqwest::blocking::Client::new(), url: url.into(), } } } /// Blocking client for the Debian Bug Tracking System (Debbugs) /// /// This client provides a synchronous interface to query bug reports, search for bugs, /// and retrieve detailed information from a Debbugs instance. /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// /// fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let bugs = client.newest_bugs(10)?; /// println!("Found {} newest bugs", bugs.len()); /// Ok(()) /// } /// ``` pub struct Debbugs { client: reqwest::blocking::Client, url: String, } impl Debbugs { /// Retrieves the newest bugs from the bug tracking system /// /// Returns a list of bug IDs, ordered from newest to oldest. /// /// # Arguments /// /// * `amount` - The maximum number of bug IDs to retrieve /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// /// fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let bugs = client.newest_bugs(5)?; /// println!("Latest 5 bugs: {:?}", bugs); /// Ok(()) /// } /// ``` 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) } /// Retrieves the complete log of messages for a specific bug /// /// Returns all messages (emails) that have been sent regarding this bug, /// including the initial bug report and all subsequent correspondence. /// /// # Arguments /// /// * `bug_id` - The ID of the bug to retrieve logs for /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// /// fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let logs = client.get_bug_log(12345)?; /// for log in logs { /// println!("Message: {}", log.header); /// } /// Ok(()) /// } /// ``` 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) } /// Searches for bugs matching the specified criteria /// /// Returns a list of bug IDs that match the search query. Use `SearchQuery` /// to specify search parameters like package, severity, status, etc. /// /// # Arguments /// /// * `query` - Search criteria for finding bugs /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// use debbugs::SearchQuery; /// /// fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let search = SearchQuery { /// package: Some("rust-debbugs"), /// severity: Some("serious"), /// ..Default::default() /// }; /// let bugs = client.get_bugs(&search)?; /// println!("Found {} serious bugs in rust-debbugs", bugs.len()); /// Ok(()) /// } /// ``` 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) } /// Retrieves detailed status information for specific bugs /// /// Returns a map of bug IDs to their detailed bug reports, including /// information like title, severity, status, package, and more. /// /// # Arguments /// /// * `bug_ids` - A slice of bug IDs to retrieve status for /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// /// fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let reports = client.get_status(&[12345, 67890])?; /// for (bug_id, report) in reports { /// println!("Bug #{}: {} ({})", /// bug_id, /// report.subject.as_deref().unwrap_or("No subject"), /// report.severity.as_deref().unwrap_or("No severity") /// ); /// } /// Ok(()) /// } /// ``` 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) } /// Retrieves user tags for a specific email address /// /// User tags allow users to categorize bugs with custom labels. /// This method returns bugs tagged by a specific user. /// /// # Arguments /// /// * `email` - The email address of the user whose tags to retrieve /// * `usertags` - A slice of specific tag names to filter by (empty slice for all tags) /// /// # Returns /// /// A map where keys are tag names and values are lists of bug IDs with that tag. /// /// # Examples /// /// ```no_run /// use debbugs::blocking::Debbugs; /// /// fn main() -> Result<(), Box> { /// let client = Debbugs::default(); /// let tags = client.get_usertag("user@example.com", &[])?; /// for (tag, bugs) in tags { /// println!("Tag '{}' has {} bugs", tag, bugs.len()); /// } /// Ok(()) /// } /// ``` 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.8/src/lib.rs000064400000000000000000000273651046102023000131650ustar 00000000000000//! Rust client interface for the Debian Bug Tracking System (Debbugs) //! //! This crate provides both async and blocking interfaces to interact with Debbugs instances, //! allowing you to search for bugs, retrieve bug reports, and access detailed bug information. //! //! # Features //! //! - **blocking** (default): Enables the synchronous `debbugs::blocking::Debbugs` client //! - **tokio** (default): Enables the asynchronous `debbugs::Debbugs` client //! - **mailparse** (default): Enables parsing of email headers in bug logs //! //! # Examples //! //! ## Async Interface //! ```no_run //! use debbugs::Debbugs; //! //! #[tokio::main] //! async fn main() -> Result<(), Box> { //! let client = Debbugs::default(); //! let bugs = client.newest_bugs(10).await?; //! println!("Latest bugs: {:?}", bugs); //! Ok(()) //! } //! ``` //! //! ## Blocking Interface //! ```no_run //! use debbugs::blocking::Debbugs; //! //! fn main() -> Result<(), Box> { //! let client = Debbugs::default(); //! let bugs = client.newest_bugs(10)?; //! println!("Latest bugs: {:?}", bugs); //! Ok(()) //! } //! ``` //! //! See the [Debian Debbugs SOAP Interface](https://wiki.debian.org/DebbugsSoapInterface) //! documentation for more information about the underlying API. mod soap; pub use soap::{BugLog, BugReport}; const DEFAULT_URL: &str = "https://bugs.debian.org/cgi-bin/soap.cgi"; /// Errors that can occur when interacting with the Debbugs API #[derive(Debug)] pub enum Error { /// SOAP protocol related errors /// /// This occurs when there are issues with the SOAP request/response format /// or when the server returns an unexpected SOAP structure. SoapError(String), /// XML parsing errors /// /// This occurs when the XML response from the server cannot be parsed, /// typically due to malformed XML or unexpected structure. XmlError(String), /// HTTP request errors /// /// This occurs when there are network issues, connection failures, /// timeouts, or other HTTP-level problems communicating with the server. ReqwestError(reqwest::Error), /// SOAP fault responses /// /// This occurs when the server returns a SOAP fault, indicating /// an error in processing the request (e.g., invalid parameters, /// server-side errors, or authentication issues). Fault(soap::Fault), } impl From for Error { fn from(err: reqwest::Error) -> Self { Error::ReqwestError(err) } } /// The status of a bug report #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum BugStatus { /// Bug has been resolved/fixed Done, /// Bug has been forwarded to upstream maintainers Forwarded, /// Bug is still open and unresolved 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"), } } } /// The pending status of a bug report #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum Pending { /// Bug is pending action Pending, /// Bug is pending but has been fixed PendingFixed, /// Bug has been fixed Fixed, /// Bug is done/closed Done, /// Bug has been forwarded 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"), } } } /// Whether to search archived bugs #[derive(Debug, PartialEq, Eq, Default, Clone, Copy)] pub enum Archived { /// Only archived bugs Archived, /// Only non-archived bugs (default) #[default] NotArchived, /// Both archived and non-archived bugs 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 used to uniquely identify bugs in the tracking system pub type BugId = i32; pub use soap::SearchQuery; #[cfg(feature = "blocking")] pub mod blocking; mod r#async; pub use r#async::Debbugs; #[cfg(test)] mod tests { use super::*; use std::str::FromStr; #[test] fn test_bug_status_from_str() { assert_eq!(BugStatus::from_str("done").unwrap(), BugStatus::Done); assert_eq!( BugStatus::from_str("forwarded").unwrap(), BugStatus::Forwarded ); assert_eq!(BugStatus::from_str("open").unwrap(), BugStatus::Open); } #[test] fn test_bug_status_from_str_invalid() { assert!(BugStatus::from_str("invalid").is_err()); assert!(BugStatus::from_str("").is_err()); assert!(BugStatus::from_str("DONE").is_err()); assert!(BugStatus::from_str("Done").is_err()); } #[test] fn test_bug_status_display() { assert_eq!(BugStatus::Done.to_string(), "done"); assert_eq!(BugStatus::Forwarded.to_string(), "forwarded"); assert_eq!(BugStatus::Open.to_string(), "open"); } #[test] fn test_bug_status_roundtrip() { let statuses = vec![BugStatus::Done, BugStatus::Forwarded, BugStatus::Open]; for status in statuses { let s = status.to_string(); let parsed = BugStatus::from_str(&s).unwrap(); assert_eq!(status, parsed); } } #[test] fn test_pending_from_str() { assert_eq!(Pending::from_str("pending").unwrap(), Pending::Pending); assert_eq!( Pending::from_str("pending-fixed").unwrap(), Pending::PendingFixed ); assert_eq!(Pending::from_str("fixed").unwrap(), Pending::Fixed); assert_eq!(Pending::from_str("done").unwrap(), Pending::Done); assert_eq!(Pending::from_str("forwarded").unwrap(), Pending::Forwarded); } #[test] fn test_pending_from_str_invalid() { assert!(Pending::from_str("invalid").is_err()); assert!(Pending::from_str("").is_err()); assert!(Pending::from_str("PENDING").is_err()); assert!(Pending::from_str("pending_fixed").is_err()); } #[test] fn test_pending_display() { assert_eq!(Pending::Pending.to_string(), "pending"); assert_eq!(Pending::PendingFixed.to_string(), "pending-fixed"); assert_eq!(Pending::Fixed.to_string(), "fixed"); assert_eq!(Pending::Done.to_string(), "done"); assert_eq!(Pending::Forwarded.to_string(), "forwarded"); } #[test] fn test_pending_roundtrip() { let pendings = vec![ Pending::Pending, Pending::PendingFixed, Pending::Fixed, Pending::Done, Pending::Forwarded, ]; for pending in pendings { let s = pending.to_string(); let parsed = Pending::from_str(&s).unwrap(); assert_eq!(pending, parsed); } } #[test] fn test_archived_from_str() { assert_eq!(Archived::from_str("1").unwrap(), Archived::Archived); assert_eq!(Archived::from_str("archived").unwrap(), Archived::Archived); assert_eq!(Archived::from_str("0").unwrap(), Archived::NotArchived); assert_eq!( Archived::from_str("unarchived").unwrap(), Archived::NotArchived ); assert_eq!(Archived::from_str("both").unwrap(), Archived::Both); } #[test] fn test_archived_from_str_invalid() { assert!(Archived::from_str("invalid").is_err()); assert!(Archived::from_str("").is_err()); assert!(Archived::from_str("2").is_err()); assert!(Archived::from_str("ARCHIVED").is_err()); assert!(Archived::from_str("not-archived").is_err()); } #[test] fn test_archived_display() { assert_eq!(Archived::Archived.to_string(), "archived"); assert_eq!(Archived::NotArchived.to_string(), "unarchived"); assert_eq!(Archived::Both.to_string(), "both"); } #[test] fn test_archived_roundtrip() { let archiveds = vec![Archived::Archived, Archived::NotArchived, Archived::Both]; for archived in archiveds { let s = archived.to_string(); // Note: from_str accepts both numeric and string forms, but display uses string form let parsed = Archived::from_str(&s).unwrap(); assert_eq!(archived, parsed); } } #[test] fn test_archived_default() { assert_eq!(Archived::default(), Archived::NotArchived); } #[test] fn test_error_display() { let soap_err = Error::SoapError("test error".to_string()); assert_eq!(soap_err.to_string(), "SOAP Error: test error"); let xml_err = Error::XmlError("xml parse failed".to_string()); assert_eq!(xml_err.to_string(), "XML Error: xml parse failed"); // We can't easily create a real reqwest::Error in tests, so we'll skip testing // the exact error message format for ReqwestError let fault = soap::Fault { faultcode: "Client".to_string(), faultstring: "Invalid request".to_string(), faultactor: None, detail: Some("Missing required parameter".to_string()), }; let fault_err = Error::Fault(fault); assert_eq!(fault_err.to_string(), "Fault: { faultcode: Client, faultstring: Invalid request, faultactor: None, detail: Some(\"Missing required parameter\") }"); } #[test] fn test_error_conversions() { // We can't easily create a real reqwest::Error in tests without an actual HTTP failure // The From trait is trivial and doesn't need extensive testing } } debbugs-0.1.8/src/soap.rs000064400000000000000000001335211046102023000133510ustar 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() .ok_or("faultcode has no text")? .into_owned(), faultstring: faultstring .get_text() .ok_or("faultstring has no text")? .into_owned(), faultactor: faultactor .and_then(|s| s.get_text()) .map(|s| s.into_owned()), detail: detail.and_then(|s| s.get_text()).map(|s| s.into_owned()), }) } 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] ); } #[test] fn test_get_bug_log_request() { let request = get_bug_log_request(123456); assert_eq!(request.name, "Envelope"); assert_eq!(request.namespace.as_deref(), Some(XMLNS_SOAPENV)); let body = request.children[1].as_element().unwrap(); let get_bug_log = body.children[0].as_element().unwrap(); assert_eq!(get_bug_log.name, "get_bug_log"); let bugnumber = get_bug_log.children[0].as_element().unwrap(); assert_eq!(bugnumber.name, "bugnumber"); assert_eq!(bugnumber.children[0].as_text().unwrap(), "123456"); assert_eq!(bugnumber.attributes.get("xsi:type").unwrap(), "xsd:int"); } #[test] fn test_get_bugs_request() { let query = SearchQuery { package: Some("test-package"), owner: Some("test@example.com"), ..Default::default() }; let request = get_bugs_request(&query); assert_eq!(request.name, "Envelope"); let body = request.children[1].as_element().unwrap(); let get_bugs = body.children[0].as_element().unwrap(); assert_eq!(get_bugs.name, "get_bugs"); // Check that arguments are present (package + owner = 4 args: "package", value, "owner", value) let args: Vec<&Element> = get_bugs .children .iter() .filter_map(|c| c.as_element()) .collect(); assert_eq!(args.len(), 4); // Should have package key, package value, owner key, owner value } #[test] fn test_get_status_request_single() { let request = get_status_request(&[123456]); assert_eq!(request.name, "Envelope"); let body = request.children[1].as_element().unwrap(); let get_status = body.children[0].as_element().unwrap(); assert_eq!(get_status.name, "get_status"); let bugnumbers = get_status.children[0].as_element().unwrap(); assert_eq!(bugnumbers.name, "arg0"); // The array is passed as the first argument let item = bugnumbers.children[0].as_element().unwrap(); assert_eq!(item.name, "item"); assert_eq!(item.children[0].as_text().unwrap(), "123456"); } #[test] fn test_get_status_request_multiple() { let request = get_status_request(&[123, 456, 789]); let body = request.children[1].as_element().unwrap(); let get_status = body.children[0].as_element().unwrap(); let bugnumbers = get_status.children[0].as_element().unwrap(); assert_eq!(bugnumbers.name, "arg0"); let items: Vec = bugnumbers .children .iter() .filter_map(|c| c.as_element()) .filter_map(|e| e.children[0].as_text()) .filter_map(|t| t.parse().ok()) .collect(); assert_eq!(items, vec![123, 456, 789]); } #[test] fn test_get_usertag_request() { let request = get_usertag_request("user@example.com", &["tag1", "tag2"]); assert_eq!(request.name, "Envelope"); let body = request.children[1].as_element().unwrap(); let get_usertag = body.children[0].as_element().unwrap(); assert_eq!(get_usertag.name, "get_usertag"); // First arg should be email let email_arg = get_usertag.children[0].as_element().unwrap(); assert_eq!(email_arg.children[0].as_text().unwrap(), "user@example.com"); // Following args should be tags let tag1_arg = get_usertag.children[1].as_element().unwrap(); assert_eq!(tag1_arg.children[0].as_text().unwrap(), "tag1"); let tag2_arg = get_usertag.children[2].as_element().unwrap(); assert_eq!(tag2_arg.children[0].as_text().unwrap(), "tag2"); } #[test] fn test_to_arg_xml_string() { let s = "test string"; let elem = s.to_arg_xml("test_arg".to_string()); assert_eq!(elem.name, "test_arg"); assert_eq!(elem.children[0].as_text().unwrap(), "test string"); } #[test] fn test_to_arg_xml_str_array() { let v = ["a", "b"]; let slice: &[&str] = &v; let elem = slice.to_arg_xml("test_array".to_string()); assert_eq!(elem.name, "test_array"); assert!(elem.attributes.get("xsi:type").unwrap().contains("Array")); let items: Vec = elem .children .iter() .filter_map(|c| c.as_element()) .filter_map(|e| e.children[0].as_text()) .map(|t| t.to_string()) .collect(); assert_eq!(items, vec!["a", "b"]); } #[test] fn test_add_arg_xml() { let mut params = Vec::new(); add_arg_xml(&mut params, "test value"); assert_eq!(params.len(), 1); assert_eq!(params[0].name, "arg0"); assert_eq!(params[0].children[0].as_text().unwrap(), "test value"); add_arg_xml(&mut params, "second value"); assert_eq!(params.len(), 2); assert_eq!(params[1].name, "arg1"); assert_eq!(params[1].children[0].as_text().unwrap(), "second value"); } #[test] fn test_parse_fault() { let fault_xml = r###" Client Invalid request http://bugs.debian.org Bug ID not found "###; let fault = parse_fault(fault_xml).unwrap(); assert_eq!(fault.faultcode, "Client"); assert_eq!(fault.faultstring, "Invalid request"); assert_eq!(fault.faultactor, Some("http://bugs.debian.org".to_string())); assert_eq!(fault.detail, Some("Bug ID not found".to_string())); } #[test] fn test_parse_fault_minimal() { let fault_xml = r###" Server Internal error "###; let fault = parse_fault(fault_xml).unwrap(); assert_eq!(fault.faultcode, "Server"); assert_eq!(fault.faultstring, "Internal error"); assert_eq!(fault.faultactor, None); assert_eq!(fault.detail, None); } #[test] fn test_parse_get_bug_log_response() { let xml = r###"
Subject: Test bug
This is a test bug report. 1
"###; let bug_log = parse_get_bug_log_response(xml).unwrap(); assert_eq!(bug_log.len(), 1); assert_eq!(bug_log[0].header, "Subject: Test bug"); assert_eq!(bug_log[0].body, "This is a test bug report."); assert_eq!(bug_log[0].msgnum, 1); } #[test] fn test_parse_get_bugs_response() { let xml = r###" 123 456 789 "###; let bug_ids = parse_get_bugs_response(xml).unwrap(); assert_eq!(bug_ids, vec![123, 456, 789]); } #[test] fn test_parse_get_status_response() { let xml = r###" 123 pending normal test-package Test subject "###; let statuses = parse_get_status_response(xml).unwrap(); assert_eq!(statuses.len(), 1); assert!(statuses.contains_key(&123)); let bug_report = &statuses[&123]; assert_eq!(bug_report.severity, Some("normal".to_string())); assert_eq!(bug_report.package, Some("test-package".to_string())); assert_eq!(bug_report.subject, Some("Test subject".to_string())); } #[test] fn test_parse_get_usertag_response() { let xml = r###" 123 456 789 "###; let usertags = parse_get_usertag_response(xml).unwrap(); assert_eq!(usertags.len(), 2); assert_eq!(usertags["tag1"], vec![123, 456]); assert_eq!(usertags["tag2"], vec![789]); } #[test] fn test_parse_response_envelope_invalid() { let invalid_xml = r###" test "###; let result = parse_response_envelope(invalid_xml, "test"); assert!(result.is_err()); assert!(result .unwrap_err() .contains("Root element is not a valid soap:Envelope")); } #[test] fn test_parse_bool() { assert_eq!(parse_bool("1").unwrap(), true); assert_eq!(parse_bool("0").unwrap(), false); assert!(parse_bool("invalid").is_err()); assert!(parse_bool("true").is_err()); } #[test] fn test_bug_report_from_xml_minimal() { let xml_str = r###" 123456 Test bug subject normal test-package "###; let element = xmltree::Element::parse(xml_str.as_bytes()).unwrap(); let bug_report = BugReport::from(&element); assert_eq!(bug_report.bug_num, Some(123456)); assert_eq!(bug_report.subject, Some("Test bug subject".to_string())); assert_eq!(bug_report.severity, Some("normal".to_string())); assert_eq!(bug_report.package, Some("test-package".to_string())); } #[test] fn test_bug_report_from_xml_comprehensive() { let xml_str = r###" 123456 Test bug subject important test-package 1234567890 patch,security pending fixed in version 1.2 0 1 https://example.com/bug/123 789 101112 456 789 Short summary of the bug affected-package 1234567900 main source-package maintainer@example.com user@example.com <message-id@example.com> 1.0 1.1 1.2 "###; let element = xmltree::Element::parse(xml_str.as_bytes()).unwrap(); let bug_report = BugReport::from(&element); assert_eq!(bug_report.bug_num, Some(123456)); assert_eq!(bug_report.subject, Some("Test bug subject".to_string())); assert_eq!(bug_report.severity, Some("important".to_string())); assert_eq!(bug_report.package, Some("test-package".to_string())); assert_eq!(bug_report.last_modified, Some(1234567890)); assert_eq!(bug_report.tags, Some("patch,security".to_string())); // Tags are stored as a comma-separated string assert_eq!(bug_report.pending, Some(crate::Pending::Pending)); assert_eq!(bug_report.done, Some("fixed in version 1.2".to_string())); // done field content assert_eq!(bug_report.archived, Some(false)); assert_eq!(bug_report.unarchived, Some(true)); assert_eq!( bug_report.forwarded, Some("https://example.com/bug/123".to_string()) ); assert_eq!(bug_report.mergedwith, Some(vec![789, 101112])); assert_eq!(bug_report.blockedby, Some("456".to_string())); // Stored as string assert_eq!(bug_report.blocks, Some("789".to_string())); // Stored as string assert_eq!( bug_report.summary, Some("Short summary of the bug".to_string()) ); assert_eq!(bug_report.affects, Some("affected-package".to_string())); assert_eq!(bug_report.log_modified, Some(1234567900)); assert_eq!(bug_report.location, Some("main".to_string())); assert_eq!(bug_report.source, Some("source-package".to_string())); assert_eq!(bug_report.owner, Some("maintainer@example.com".to_string())); assert_eq!(bug_report.originator, Some("user@example.com".to_string())); // submitter -> originator assert_eq!( bug_report.msgid, Some("".to_string()) ); // Note: found_versions and fixed_versions have complex types, testing basic presence assert!(bug_report.found_versions.is_some()); assert!(bug_report.fixed_versions.is_some()); } #[test] fn test_bug_report_from_xml_empty() { let xml_str = r###""###; let element = xmltree::Element::parse(xml_str.as_bytes()).unwrap(); let bug_report = BugReport::from(&element); // All fields should be None for empty XML assert_eq!(bug_report.bug_num, None); assert_eq!(bug_report.subject, None); assert_eq!(bug_report.severity, None); assert_eq!(bug_report.package, None); assert_eq!(bug_report.last_modified, None); assert_eq!(bug_report.tags, None); assert_eq!(bug_report.pending, None); assert_eq!(bug_report.done, None); assert_eq!(bug_report.archived, None); } #[test] fn test_bug_report_from_xml_invalid_values() { let xml_str = r###" not-a-number invalid-date sometimes unknown-status "###; let element = xmltree::Element::parse(xml_str.as_bytes()).unwrap(); let bug_report = BugReport::from(&element); // Invalid values should result in None assert_eq!(bug_report.bug_num, None); assert_eq!(bug_report.last_modified, None); assert_eq!(bug_report.archived, None); assert_eq!(bug_report.pending, None); // done field accepts any string value assert!(bug_report.done.is_none()); // Not provided in test XML } #[derive(Debug)] /// Detailed information about a bug report /// /// Contains comprehensive metadata about a bug including its status, severity, /// package information, and related bugs. pub struct BugReport { /// The pending status of the bug pub pending: Option, /// Message ID of the initial bug report email pub msgid: Option, /// Email address of the person who currently owns/is working on this bug pub owner: Option, /// Keywords associated with the bug (deprecated, use `tags` instead) #[deprecated = "Use tags instead"] pub keywords: Option, /// Packages that are affected by this bug (in addition to the primary package) pub affects: Option, /// Whether the bug has been unarchived and can be archived again pub unarchived: Option, /// Email address or URL where the bug has been forwarded to upstream pub forwarded: Option, /// Short summary description of the bug pub summary: Option, /// The unique bug number identifier pub bug_num: Option, /// Whether the bug has been archived (old/resolved bugs) pub archived: Option, /// Versions of the package where this bug was found to exist pub found_versions: Option>, /// Email address of the person who marked this bug as done/resolved pub done: Option, /// Severity level of the bug (e.g., "serious", "important", "normal", "minor", "wishlist") pub severity: Option, /// Name of the package this bug affects pub package: Option, /// Versions of the package where this bug has been fixed pub fixed_versions: Option, Option)>>, /// Email address of the person who originally reported this bug pub originator: Option, /// Comma-separated list of bug IDs that this bug blocks pub blocks: Option, /// Dates when the bug was found in specific versions (deprecated, currently empty) #[deprecated(note = "empty for now")] pub found_date: Option>, /// Free-form text describing the outlook for fixing this bug pub outlook: Option, /// Legacy bug ID field (deprecated, use `bug_num` instead) #[deprecated(note = "use bug_num")] pub id: Option, /// Whether the bug has been found in any versions pub found: bool, /// Whether the bug has been fixed in any versions pub fixed: bool, /// Unix timestamp of when the bug was last modified pub last_modified: Option, /// Space-separated list of tags associated with this bug pub tags: Option, /// The title/subject line of the bug report pub subject: Option, /// Physical location or context information for the bug pub location: Option, /// List of bug IDs that this bug has been merged with pub mergedwith: Option>, /// Comma-separated list of bug IDs that block this bug pub blockedby: Option, /// Dates when the bug was fixed in specific versions (deprecated, currently empty) #[deprecated(note = "empty for now")] pub fixed_date: Option>, /// Unix timestamp of when the bug log was last modified pub log_modified: Option, /// Source package name (for binary packages built from source) 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 { // Helper function to get text and convert to owned String fn get_text_owned(element: Option<&xmltree::Element>) -> Option { element.and_then(|e| e.get_text()).map(|s| s.into_owned()) } // Helper function to parse a child element's text content fn parse_child( item: &xmltree::Element, child_name: &str, ) -> Option { item.get_child(child_name) .and_then(|e| e.get_text()) .and_then(|text| text.parse().ok()) } // Helper function to parse items from a list element fn parse_list_items(element: Option<&xmltree::Element>, parser: F) -> Option> where F: Fn(&str) -> Option, { element.map(|e| { e.children .iter() .filter_map(|c| c.as_element()) .filter(|c| c.name == "item") .filter_map(|c| c.get_text().and_then(|text| parser(text.as_ref()))) .collect() }) } Self { pending: parse_child(item, "pending"), msgid: get_text_owned(item.get_child("msgid")), owner: get_text_owned(item.get_child("owner")), keywords: get_text_owned(item.get_child("keywords")), affects: get_text_owned(item.get_child("affects")), unarchived: item .get_child("unarchived") .and_then(|e| e.get_text()) .and_then(|s| parse_bool(s.as_ref()).ok()), blocks: get_text_owned(item.get_child("blocks")), found_date: parse_list_items(item.get_child("found_date"), |s| s.parse().ok()), fixed_versions: parse_list_items(item.get_child("fixed_versions"), |s| { Some(parse_version(s)) }), outlook: get_text_owned(item.get_child("outlook")), done: get_text_owned(item.get_child("done")), forwarded: get_text_owned(item.get_child("forwarded")), summary: get_text_owned(item.get_child("summary")), bug_num: parse_child(item, "bug_num"), id: parse_child(item, "id"), archived: item .get_child("archived") .and_then(|e| e.get_text()) .and_then(|t| parse_bool(t.as_ref()).ok()), found_versions: parse_list_items(item.get_child("found_versions"), |s| { s.parse::().ok() }), found: item.get_child("found").is_some(), fixed: item.get_child("fixed").is_some(), last_modified: parse_child(item, "last_modified"), tags: get_text_owned(item.get_child("tags")), subject: get_text_owned(item.get_child("subject")), source: get_text_owned(item.get_child("source")), originator: get_text_owned(item.get_child("originator")), package: get_text_owned(item.get_child("package")), location: get_text_owned(item.get_child("location")), log_modified: parse_child(item, "log_modified"), mergedwith: item .get_child("mergedwith") .and_then(|e| e.get_text()) .map(|s| { s.split_whitespace() .filter_map(|i| i.parse().ok()) .collect() }), severity: get_text_owned(item.get_child("severity")), blockedby: get_text_owned(item.get_child("blockedby")), fixed_date: parse_list_items(item.get_child("fixed_date"), |s| s.parse().ok()), } } } #[derive(Debug, Clone)] /// A log entry (email message) from a bug's communication history /// /// Represents a single email message in the bug's conversation thread, /// including the initial bug report and all subsequent correspondence. pub struct BugLog { /// The email headers as a raw string (From, To, Subject, Date, etc.) pub header: String, /// Sequential message number within this bug's history pub msgnum: BugId, /// The email message body content 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 = e.get_text().map(|s| s.into_owned()); } "msg_num" => { msgnum = e.get_text().and_then(|s| s.parse().ok()); } "body" => { body = e.get_text().map(|s| s.into_owned()); } "attachments" => { if !e.children.is_empty() { log::warn!("Attachments found but not supported (apparently not implemented on the server side)"); } } n => { return Err(format!("Unknown element: {}", n)); } } } } Ok(BugLog { header: header.ok_or("Missing header element")?, msgnum: msgnum.ok_or("Missing or invalid msg_num element")?, body: body.ok_or("Missing body element")?, }) } 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 children: Vec<_> = self .iter() .map(|s| { xmltree::XMLNode::Element(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())], }) }) .collect(); 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, } } } 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 children: Vec<_> = self .iter() .map(|bug_id| { xmltree::XMLNode::Element(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())], }) }) .collect(); 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, } } } fn add_arg_xml(params: &mut Vec, arg: T) { params.push(arg.to_arg_xml(format!("arg{}", params.len()))); } #[derive(Debug, Default, Clone)] /// Search criteria for finding bugs matching specific conditions /// /// All fields are optional - only specify the criteria you want to filter by. /// Multiple criteria are combined with AND logic (all must match). /// /// # Examples /// /// ```no_run /// use debbugs::SearchQuery; /// /// // Find all serious bugs in the rust-debbugs package /// let query = SearchQuery { /// package: Some("rust-debbugs"), /// severity: Some("serious"), /// ..Default::default() /// }; /// /// // Find bugs owned by a specific person /// let query = SearchQuery { /// owner: Some("maintainer@example.com"), /// ..Default::default() /// }; /// ``` pub struct SearchQuery<'a> { /// Package name to search for bugs in pub package: Option<&'a str>, /// Specific bug IDs to retrieve (useful for batch operations) pub bug_ids: Option<&'a [BugId]>, /// Email address of the person who submitted the bug pub submitter: Option<&'a str>, /// Email address of the package maintainer pub maintainer: Option<&'a str>, /// Source package name (for bugs affecting source packages) pub src: Option<&'a str>, /// Severity level (e.g., "critical", "serious", "important", "normal", "minor", "wishlist") pub severity: Option<&'a str>, /// Current status of the bug (open, done, forwarded) pub status: Option, /// Email address of the person currently owning/working on the bug pub owner: Option<&'a str>, /// Email address of someone who has participated in the bug discussion pub correspondent: Option<&'a str>, /// Whether to include archived bugs, non-archived bugs, or both pub archive: Option, /// Tags to filter by (bugs must have all specified tags) 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::() .map_err(|_| "Invalid BugId format")?; 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" { if let Some(text) = e.get_text() { if let Ok(id) = text.parse::() { ids.push(id); } } } } } ret.insert(e.name.clone(), ids); } } Ok(ret) }