blastdns 2.0.2__tar.gz → 2.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. blastdns-2.0.4/.github/dependabot.yml +59 -0
  2. {blastdns-2.0.2 → blastdns-2.0.4}/.github/workflows/benchmark.yml +10 -7
  3. blastdns-2.0.4/.github/workflows/cla.yml +19 -0
  4. blastdns-2.0.4/.github/workflows/dev-security.yml +11 -0
  5. blastdns-2.0.4/.github/workflows/publish.yml +79 -0
  6. blastdns-2.0.4/.github/workflows/stable-guard.yml +12 -0
  7. blastdns-2.0.4/.github/workflows/tests.yml +39 -0
  8. blastdns-2.0.4/.gitignore +4 -0
  9. blastdns-2.0.4/AGENTS.md +71 -0
  10. blastdns-2.0.4/CLAUDE.md +1 -0
  11. {blastdns-2.0.2 → blastdns-2.0.4}/Cargo.lock +251 -13
  12. {blastdns-2.0.2 → blastdns-2.0.4}/Cargo.toml +3 -3
  13. blastdns-2.0.2/README.md → blastdns-2.0.4/PKG-INFO +56 -22
  14. blastdns-2.0.2/PKG-INFO → blastdns-2.0.4/README.md +41 -35
  15. {blastdns-2.0.2 → blastdns-2.0.4}/pyproject.toml +2 -2
  16. blastdns-2.0.4/scripts/ci-setup.sh +7 -0
  17. blastdns-2.0.4/scripts/ci-teardown.sh +5 -0
  18. {blastdns-2.0.2 → blastdns-2.0.4}/src/client.rs +27 -16
  19. {blastdns-2.0.2 → blastdns-2.0.4}/src/controller.rs +491 -4
  20. blastdns-2.0.4/src/limiter.rs +373 -0
  21. {blastdns-2.0.2 → blastdns-2.0.4}/src/utils.rs +20 -1
  22. {blastdns-2.0.2 → blastdns-2.0.4}/src/worker.rs +7 -1
  23. {blastdns-2.0.2 → blastdns-2.0.4}/uv.lock +72 -74
  24. blastdns-2.0.2/.github/dependabot.yml +0 -17
  25. blastdns-2.0.2/.github/workflows/cla.yml +0 -68
  26. blastdns-2.0.2/.github/workflows/python-tests.yml +0 -265
  27. blastdns-2.0.2/.github/workflows/rust-tests.yml +0 -92
  28. blastdns-2.0.2/src/limiter.rs +0 -182
  29. {blastdns-2.0.2 → blastdns-2.0.4}/LICENSE +0 -0
  30. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/__init__.py +0 -0
  31. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/client.py +0 -0
  32. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/exceptions.py +0 -0
  33. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/models.py +0 -0
  34. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/tests/test_batching.py +0 -0
  35. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/tests/test_client.py +0 -0
  36. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/tests/test_exceptions.py +0 -0
  37. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/tests/test_mock_client.py +0 -0
  38. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/tests/test_zone_transfer.py +0 -0
  39. {blastdns-2.0.2 → blastdns-2.0.4}/blastdns/zone_transfer.py +0 -0
  40. {blastdns-2.0.2 → blastdns-2.0.4}/examples/resolve-batch.py +0 -0
  41. {blastdns-2.0.2 → blastdns-2.0.4}/examples/resolve-single-host.py +0 -0
  42. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/benchmark.py +0 -0
  43. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/start-test-axfr.sh +0 -0
  44. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/start-test-dns.sh +0 -0
  45. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/stop-test-axfr.sh +0 -0
  46. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/stop-test-dns.sh +0 -0
  47. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/test-zone/db.zonetransfer.test +0 -0
  48. {blastdns-2.0.2 → blastdns-2.0.4}/scripts/test-zone/named.conf +0 -0
  49. {blastdns-2.0.2 → blastdns-2.0.4}/src/cache.rs +0 -0
  50. {blastdns-2.0.2 → blastdns-2.0.4}/src/config.rs +0 -0
  51. {blastdns-2.0.2 → blastdns-2.0.4}/src/error.rs +0 -0
  52. {blastdns-2.0.2 → blastdns-2.0.4}/src/health.rs +0 -0
  53. {blastdns-2.0.2 → blastdns-2.0.4}/src/lib.rs +0 -0
  54. {blastdns-2.0.2 → blastdns-2.0.4}/src/main.rs +0 -0
  55. {blastdns-2.0.2 → blastdns-2.0.4}/src/mock.rs +0 -0
  56. {blastdns-2.0.2 → blastdns-2.0.4}/src/python.rs +0 -0
  57. {blastdns-2.0.2 → blastdns-2.0.4}/src/resolver.rs +0 -0
  58. {blastdns-2.0.2 → blastdns-2.0.4}/src/sim.rs +0 -0
  59. {blastdns-2.0.2 → blastdns-2.0.4}/src/zone_transfer.rs +0 -0
  60. {blastdns-2.0.2 → blastdns-2.0.4}/tests/cli_tests.py +0 -0
@@ -0,0 +1,59 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "cargo"
4
+ directory: "/"
5
+ target-branch: "dev"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ cargo-minor-patch:
10
+ patterns:
11
+ - "*"
12
+ update-types:
13
+ - "minor"
14
+ - "patch"
15
+ cargo-major:
16
+ patterns:
17
+ - "*"
18
+ update-types:
19
+ - "major"
20
+ cooldown:
21
+ default-days: 7
22
+ - package-ecosystem: "uv"
23
+ directory: "/"
24
+ target-branch: "dev"
25
+ schedule:
26
+ interval: "weekly"
27
+ groups:
28
+ uv-minor-patch:
29
+ patterns:
30
+ - "*"
31
+ update-types:
32
+ - "minor"
33
+ - "patch"
34
+ uv-major:
35
+ patterns:
36
+ - "*"
37
+ update-types:
38
+ - "major"
39
+ cooldown:
40
+ default-days: 7
41
+ - package-ecosystem: "github-actions"
42
+ directory: "/"
43
+ target-branch: "dev"
44
+ schedule:
45
+ interval: "weekly"
46
+ groups:
47
+ github-actions-minor-patch:
48
+ patterns:
49
+ - "*"
50
+ update-types:
51
+ - "minor"
52
+ - "patch"
53
+ github-actions-major:
54
+ patterns:
55
+ - "*"
56
+ update-types:
57
+ - "major"
58
+ cooldown:
59
+ default-days: 7
@@ -16,16 +16,19 @@ jobs:
16
16
 
17
17
  steps:
18
18
  # The PR merged into its base, so the comparison isolates exactly this change.
19
- - uses: actions/checkout@v7
19
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
+ with:
21
+ persist-credentials: false
20
22
 
21
23
  - name: Check out base
22
- uses: actions/checkout@v7
24
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
25
  with:
26
+ persist-credentials: false
24
27
  ref: ${{ github.event.pull_request.base.sha }}
25
28
  path: .bench-base
26
29
 
27
30
  - name: Install Rust toolchain
28
- uses: actions-rust-lang/setup-rust-toolchain@v2
31
+ uses: actions-rust-lang/setup-rust-toolchain@a188e68d0fd2bd36ad51dccb2b07ba6e75105f30 # v2.0.1
29
32
  with:
30
33
  # A base built with a newer toolchain can carry warnings; that's for the
31
34
  # test workflows to catch, not a reason to skip the comparison.
@@ -35,12 +38,12 @@ jobs:
35
38
  .bench-base -> target
36
39
 
37
40
  - name: Set up Python
38
- uses: actions/setup-python@v7
41
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
39
42
  with:
40
43
  python-version: '3.x'
41
44
 
42
45
  - name: Install uv
43
- uses: astral-sh/setup-uv@v7
46
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
44
47
 
45
48
  - name: Build head
46
49
  run: uv sync && uv run maturin develop --release
@@ -76,7 +79,7 @@ jobs:
76
79
 
77
80
  - name: Upload benchmark results
78
81
  if: always()
79
- uses: actions/upload-artifact@v7
82
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
80
83
  with:
81
84
  name: benchmark-results
82
85
  path: benchmark_report.md
@@ -88,7 +91,7 @@ jobs:
88
91
 
89
92
  - name: Comment benchmark results on PR
90
93
  if: ${{ !cancelled() && github.event_name == 'pull_request' }}
91
- uses: actions/github-script@v9
94
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
92
95
  with:
93
96
  script: |
94
97
  const fs = require('fs');
@@ -0,0 +1,19 @@
1
+ name: CLA
2
+
3
+ # The CLA bot needs both triggers; cla-reusable.yml never checks out pull request code.
4
+ on:
5
+ issue_comment: # zizmor: ignore[dangerous-triggers]
6
+ types: [created]
7
+ pull_request_target: # zizmor: ignore[dangerous-triggers]
8
+ types: [opened, closed, synchronize]
9
+
10
+ permissions:
11
+ pull-requests: write
12
+ statuses: write
13
+
14
+ jobs:
15
+ cla:
16
+ uses: blacklanternsecurity/release-workflows/.github/workflows/cla-reusable.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
17
+ secrets:
18
+ APP_ID: ${{ secrets.APP_ID }}
19
+ APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
@@ -0,0 +1,11 @@
1
+ name: dev-security
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ dev-security:
11
+ uses: blacklanternsecurity/release-workflows/.github/workflows/dev-security.yml@12139195c6f35d8b4478bb8ec3df94aa275da01e # v1.1.0
@@ -0,0 +1,79 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [stable]
6
+
7
+ permissions: {}
8
+
9
+ concurrency:
10
+ group: publish-${{ github.ref }}
11
+ cancel-in-progress: false
12
+
13
+ jobs:
14
+ check:
15
+ permissions:
16
+ contents: read
17
+ actions: read
18
+ pull-requests: read
19
+ uses: blacklanternsecurity/release-workflows/.github/workflows/release-check.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
20
+ secrets:
21
+ BLS_RELEASE_PRIVATE_KEY: ${{ secrets.BLS_RELEASE_PRIVATE_KEY }}
22
+
23
+ tests:
24
+ needs: check
25
+ if: needs.check.outputs.release == 'true'
26
+ permissions:
27
+ contents: read
28
+ uses: ./.github/workflows/tests.yml # zizmor: ignore[self-repository]
29
+
30
+ wheels:
31
+ needs: tests
32
+ permissions:
33
+ contents: read
34
+ uses: blacklanternsecurity/release-workflows/.github/workflows/maturin-wheels.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
35
+
36
+ crates:
37
+ needs: [check, pypi]
38
+ if: needs.check.outputs.release == 'true'
39
+ permissions:
40
+ contents: read
41
+ id-token: write
42
+ uses: blacklanternsecurity/release-workflows/.github/workflows/crates.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
43
+ with:
44
+ version: ${{ needs.check.outputs.version }}
45
+
46
+ pypi:
47
+ needs: wheels
48
+ runs-on: ubuntu-24.04
49
+ environment: release
50
+ permissions:
51
+ contents: read
52
+ id-token: write
53
+ attestations: write
54
+ steps:
55
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
56
+ with:
57
+ pattern: ${{ needs.wheels.outputs.artifacts }}
58
+ path: dist
59
+ merge-multiple: true
60
+ - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
61
+ with:
62
+ subject-path: dist/*
63
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
64
+ with:
65
+ skip-existing: true
66
+
67
+ release:
68
+ needs: [check, wheels, crates, pypi]
69
+ if: needs.check.outputs.release == 'true'
70
+ permissions:
71
+ contents: read
72
+ uses: blacklanternsecurity/release-workflows/.github/workflows/publish.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
73
+ with:
74
+ tag: ${{ needs.check.outputs.tag }}
75
+ version: ${{ needs.check.outputs.version }}
76
+ artifacts: ${{ needs.wheels.outputs.artifacts }}
77
+ assets: dist/*
78
+ secrets:
79
+ BLS_RELEASE_PRIVATE_KEY: ${{ secrets.BLS_RELEASE_PRIVATE_KEY }}
@@ -0,0 +1,12 @@
1
+ name: stable guard
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [stable]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ guard:
12
+ uses: blacklanternsecurity/release-workflows/.github/workflows/stable-guard.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
@@ -0,0 +1,39 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_call:
6
+
7
+ concurrency:
8
+ group: tests-${{ github.workflow_ref }}-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ rust:
16
+ uses: blacklanternsecurity/release-workflows/.github/workflows/rust-tests.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
17
+ with:
18
+ cargo-args: --all --locked
19
+ test-args: --include-ignored
20
+ setup-script: scripts/ci-setup.sh
21
+ teardown-script: scripts/ci-teardown.sh
22
+
23
+ clippy-python-feature:
24
+ runs-on: ubuntu-24.04
25
+ steps:
26
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27
+ with:
28
+ persist-credentials: false
29
+ - uses: actions-rust-lang/setup-rust-toolchain@a188e68d0fd2bd36ad51dccb2b07ba6e75105f30 # v2.0.1
30
+ with:
31
+ components: clippy
32
+ - run: cargo clippy --all-targets --all-features --locked -- -D warnings
33
+
34
+ python:
35
+ uses: blacklanternsecurity/release-workflows/.github/workflows/python-tests.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
36
+ with:
37
+ pytest-args: blastdns/tests tests/cli_tests.py -vv
38
+ setup-script: scripts/ci-setup.sh
39
+ teardown-script: scripts/ci-teardown.sh
@@ -0,0 +1,4 @@
1
+ /target/
2
+ .venv/
3
+ __pycache__/
4
+ *.so
@@ -0,0 +1,71 @@
1
+ # AGENTS.md
2
+
3
+ Fast DNS resolver in Rust with Python bindings via maturin.
4
+
5
+ ## Toolchain
6
+
7
+ | Concern | This repository |
8
+ |---|---|
9
+ | Language | Rust, edition in Cargo.toml. Python bindings, `requires-python` in pyproject.toml |
10
+ | Package manager | cargo, uv |
11
+ | Lint and format | clippy and rustfmt, no rust-toolchain.toml yet. ruff, version in the `dev` group of pyproject.toml |
12
+ | Tests | cargo test, pytest |
13
+
14
+ ## Setup
15
+
16
+ ```bash
17
+ uv sync && uv run maturin develop
18
+ ```
19
+
20
+ ## Tests
21
+
22
+ Integration tests need two local servers: dnsmasq (see "Integration Tests" in README.md) and a BIND9 AXFR server. Without dnsmasq the Python client tests fail with `ResolverError`. Without BIND9 the zone transfer tests fail.
23
+
24
+ ```bash
25
+ sudo ./scripts/start-test-dns.sh # dnsmasq on 127.0.0.1:5353
26
+ ./scripts/start-test-axfr.sh # BIND9 in Docker on 127.0.0.1:5354
27
+ cargo test --all --locked -- --include-ignored
28
+ uv run maturin develop --release && uv run pytest blastdns/tests
29
+ cargo build --release --locked && uv run pytest tests/cli_tests.py
30
+ ./scripts/stop-test-axfr.sh && sudo ./scripts/stop-test-dns.sh
31
+ ```
32
+
33
+ `tests/cli_tests.py` does not match pytest's default `test_*.py` pattern, so a bare `uv run pytest` skips it. It runs the binary at `target/release/blastdns`.
34
+
35
+ ## Lint
36
+
37
+ CI fails on any of these.
38
+
39
+ ```bash
40
+ cargo fmt --all -- --check
41
+ cargo clippy --all-targets --all-features --locked -- -D warnings
42
+ uv run ruff check
43
+ uv run ruff format --check
44
+ ```
45
+
46
+ Clippy runs with `-D warnings` on unpinned stable Rust, so a new Rust release can break CI with no code change, for example a newly deprecated std API.
47
+
48
+ ## Benchmarks
49
+
50
+ `benchmark.yml` runs `scripts/benchmark.py` on every pull request, comparing the head build against the base branch, and comments the report on the PR. To run it locally, build each side into its own environment with `maturin develop --release` and start dnsmasq, then:
51
+
52
+ ```bash
53
+ uv run python scripts/benchmark.py --base BASE/.venv/bin/python --head .venv/bin/python
54
+ ```
55
+
56
+ ## Standards
57
+
58
+ Org-wide, in [blacklanternsecurity/.github/standards](https://github.com/blacklanternsecurity/.github/tree/main/standards). Read the one your task touches, not all of them.
59
+
60
+ | Document | Read it when |
61
+ |---|---|
62
+ | [principles.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/principles.md) | Always |
63
+ | [toolchain.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/toolchain.md) | Touching dependencies, linting, formatting, or language versions |
64
+ | [git.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/git.md) | Branching, commit messages, opening or reviewing a pull request |
65
+ | [rfc.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/rfc.md) | A change needs agreement before work starts, or an RFC is ending |
66
+ | [testing.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/testing.md) | Writing or changing tests, or anything that has them |
67
+ | [ci.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/ci.md) | Touching a workflow, an action pin, or a permissions block |
68
+ | [releases.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/releases.md) | Versioning, tagging, or publishing |
69
+ | [repository-setup.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/repository-setup.md) | Creating a repository, or auditing one |
70
+
71
+ Never restate a standard here. If this file and a standard disagree, the standard wins and this file is the bug.
@@ -0,0 +1 @@
1
+ See @AGENTS.md.