rust-audit 0.2.3__tar.gz → 0.2.5__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 (21) hide show
  1. {rust_audit-0.2.3/scripts/rust_audit.egg-info → rust_audit-0.2.5}/PKG-INFO +14 -5
  2. {rust_audit-0.2.3 → rust_audit-0.2.5}/README.md +13 -4
  3. {rust_audit-0.2.3 → rust_audit-0.2.5}/pyproject.toml +3 -3
  4. {rust_audit-0.2.3 → rust_audit-0.2.5/scripts/rust_audit.egg-info}/PKG-INFO +14 -5
  5. {rust_audit-0.2.3 → rust_audit-0.2.5}/scripts/rust_audit.py +1 -1
  6. {rust_audit-0.2.3 → rust_audit-0.2.5}/tests/test_packaging.py +61 -11
  7. {rust_audit-0.2.3 → rust_audit-0.2.5}/tests/test_verify_release.py +0 -11
  8. {rust_audit-0.2.3 → rust_audit-0.2.5}/LICENSE +0 -0
  9. {rust_audit-0.2.3 → rust_audit-0.2.5}/resources/popular_crates.txt +0 -0
  10. {rust_audit-0.2.3 → rust_audit-0.2.5}/resources/suspicious_names.txt +0 -0
  11. {rust_audit-0.2.3 → rust_audit-0.2.5}/scripts/rust_audit.egg-info/SOURCES.txt +0 -0
  12. {rust_audit-0.2.3 → rust_audit-0.2.5}/scripts/rust_audit.egg-info/dependency_links.txt +0 -0
  13. {rust_audit-0.2.3 → rust_audit-0.2.5}/scripts/rust_audit.egg-info/entry_points.txt +0 -0
  14. {rust_audit-0.2.3 → rust_audit-0.2.5}/scripts/rust_audit.egg-info/requires.txt +0 -0
  15. {rust_audit-0.2.3 → rust_audit-0.2.5}/scripts/rust_audit.egg-info/top_level.txt +0 -0
  16. {rust_audit-0.2.3 → rust_audit-0.2.5}/setup.cfg +0 -0
  17. {rust_audit-0.2.3 → rust_audit-0.2.5}/templates/deny.toml +0 -0
  18. {rust_audit-0.2.3 → rust_audit-0.2.5}/tests/test_check_skill_sync.py +0 -0
  19. {rust_audit-0.2.3 → rust_audit-0.2.5}/tests/test_interpreter_guard.py +0 -0
  20. {rust_audit-0.2.3 → rust_audit-0.2.5}/tests/test_production_e2e.py +0 -0
  21. {rust_audit-0.2.3 → rust_audit-0.2.5}/tests/test_skill_wrapper_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rust-audit
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Static auditor and auto-fixer for AI-generated Rust traps — stubs, fake tests, swallowed errors, panic/unsafe misuse, hallucinated or typosquatted crates
5
5
  Author-email: Antonio Cantallops Alba <contact@exyonq.org>
6
6
  License-Expression: Apache-2.0
@@ -44,19 +44,28 @@ pipx install rust-audit # or: pip install rust-audit
44
44
  rust-audit selftest # prints `selftest PASS`
45
45
  ```
46
46
 
47
- From PyPI as **`rust-audit`**; the one-word alias **`rustaudit`** is the same
48
- package under a name that resolves to it, and both `rust-audit` and `rustaudit`
49
- run from either install. Nothing is fetched or executed at install time, and
47
+ From PyPI as **`rust-audit`**, whose wheel installs both commands: `rust-audit`
48
+ and `rustaudit` run the same module. There is no separate one-word project on
49
+ PyPI — it answers "This project name is too similar to an existing project" —
50
+ so the spelling is served by this package's own entry point.
51
+ Nothing is fetched or executed at install time, and
50
52
  the wheel carries the same `rust_audit.py` as the signed release asset — so the
51
53
  verify-before-use chain below still applies to the script you download.
52
54
 
55
+ The wheel's digest is attested by the workflow that built it, so you can check
56
+ where it came from before running it:
57
+
58
+ ```bash
59
+ gh attestation verify rust_audit-*-py3-none-any.whl -R Doken-Tokuyama/Rust-Audit
60
+ ```
61
+
53
62
  ## Quick start
54
63
 
55
64
  ```bash
56
65
  # 0) verify before use — check the exact audited bytes before executing them
57
66
  # (key pin -> SSH signature -> checksum -> tag identity) and proceed only
58
67
  # on VERIFIED (exit 0); see SECURITY.md for the pinned key and the chain
59
- scripts/verify_release.sh v0.2.3 ./rust_audit.py
68
+ scripts/verify_release.sh v0.2.5 ./rust_audit.py
60
69
 
61
70
  python3 scripts/rust_audit.py selftest
62
71
  python3 scripts/rust_audit.py scan <rust-project> --format terminal,md,json,sarif --fail-on high
@@ -14,19 +14,28 @@ pipx install rust-audit # or: pip install rust-audit
14
14
  rust-audit selftest # prints `selftest PASS`
15
15
  ```
16
16
 
17
- From PyPI as **`rust-audit`**; the one-word alias **`rustaudit`** is the same
18
- package under a name that resolves to it, and both `rust-audit` and `rustaudit`
19
- run from either install. Nothing is fetched or executed at install time, and
17
+ From PyPI as **`rust-audit`**, whose wheel installs both commands: `rust-audit`
18
+ and `rustaudit` run the same module. There is no separate one-word project on
19
+ PyPI — it answers "This project name is too similar to an existing project" —
20
+ so the spelling is served by this package's own entry point.
21
+ Nothing is fetched or executed at install time, and
20
22
  the wheel carries the same `rust_audit.py` as the signed release asset — so the
21
23
  verify-before-use chain below still applies to the script you download.
22
24
 
25
+ The wheel's digest is attested by the workflow that built it, so you can check
26
+ where it came from before running it:
27
+
28
+ ```bash
29
+ gh attestation verify rust_audit-*-py3-none-any.whl -R Doken-Tokuyama/Rust-Audit
30
+ ```
31
+
23
32
  ## Quick start
24
33
 
25
34
  ```bash
26
35
  # 0) verify before use — check the exact audited bytes before executing them
27
36
  # (key pin -> SSH signature -> checksum -> tag identity) and proceed only
28
37
  # on VERIFIED (exit 0); see SECURITY.md for the pinned key and the chain
29
- scripts/verify_release.sh v0.2.3 ./rust_audit.py
38
+ scripts/verify_release.sh v0.2.5 ./rust_audit.py
30
39
 
31
40
  python3 scripts/rust_audit.py selftest
32
41
  python3 scripts/rust_audit.py scan <rust-project> --format terminal,md,json,sarif --fail-on high
@@ -42,9 +42,9 @@ dev = ["pytest>=7.4.0"]
42
42
 
43
43
  [project.scripts]
44
44
  rust-audit = "rust_audit:main"
45
- # Same entry point under the one-word spelling; the `rustaudit` distribution on
46
- # PyPI is an alias that pulls this one in, so either name on the prompt runs
47
- # the same code once this package is installed.
45
+ # Same entry point under the one-word spelling. There is no `rustaudit`
46
+ # distribution on PyPI: it is refused as "too similar to an existing project"
47
+ # next to `rust-audit`, so this wheel is the only place that name comes from.
48
48
  rustaudit = "rust_audit:main"
49
49
 
50
50
  [project.urls]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rust-audit
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Static auditor and auto-fixer for AI-generated Rust traps — stubs, fake tests, swallowed errors, panic/unsafe misuse, hallucinated or typosquatted crates
5
5
  Author-email: Antonio Cantallops Alba <contact@exyonq.org>
6
6
  License-Expression: Apache-2.0
@@ -44,19 +44,28 @@ pipx install rust-audit # or: pip install rust-audit
44
44
  rust-audit selftest # prints `selftest PASS`
45
45
  ```
46
46
 
47
- From PyPI as **`rust-audit`**; the one-word alias **`rustaudit`** is the same
48
- package under a name that resolves to it, and both `rust-audit` and `rustaudit`
49
- run from either install. Nothing is fetched or executed at install time, and
47
+ From PyPI as **`rust-audit`**, whose wheel installs both commands: `rust-audit`
48
+ and `rustaudit` run the same module. There is no separate one-word project on
49
+ PyPI — it answers "This project name is too similar to an existing project" —
50
+ so the spelling is served by this package's own entry point.
51
+ Nothing is fetched or executed at install time, and
50
52
  the wheel carries the same `rust_audit.py` as the signed release asset — so the
51
53
  verify-before-use chain below still applies to the script you download.
52
54
 
55
+ The wheel's digest is attested by the workflow that built it, so you can check
56
+ where it came from before running it:
57
+
58
+ ```bash
59
+ gh attestation verify rust_audit-*-py3-none-any.whl -R Doken-Tokuyama/Rust-Audit
60
+ ```
61
+
53
62
  ## Quick start
54
63
 
55
64
  ```bash
56
65
  # 0) verify before use — check the exact audited bytes before executing them
57
66
  # (key pin -> SSH signature -> checksum -> tag identity) and proceed only
58
67
  # on VERIFIED (exit 0); see SECURITY.md for the pinned key and the chain
59
- scripts/verify_release.sh v0.2.3 ./rust_audit.py
68
+ scripts/verify_release.sh v0.2.5 ./rust_audit.py
60
69
 
61
70
  python3 scripts/rust_audit.py selftest
62
71
  python3 scripts/rust_audit.py scan <rust-project> --format terminal,md,json,sarif --fail-on high
@@ -48,7 +48,7 @@ import urllib.request
48
48
  from dataclasses import dataclass, field
49
49
  from pathlib import Path
50
50
 
51
- VERSION = "0.2.3"
51
+ VERSION = "0.2.5"
52
52
  TOOL_NAME = "Rust Audit"
53
53
 
54
54
  SEVERITY_RANK = {"critical": 4, "high": 3, "medium": 2, "low": 1, "info": 0}
@@ -16,7 +16,10 @@ from pathlib import Path
16
16
  REPO = Path(__file__).resolve().parent.parent
17
17
  TOOL = REPO / "scripts" / "rust_audit.py"
18
18
  PYPROJECT = REPO / "pyproject.toml"
19
- ALIAS = REPO / "packaging" / "rustaudit-alias" / "pyproject.toml"
19
+ PUBLISH_WORKFLOW = REPO / ".github" / "workflows" / "publish.yml"
20
+ ATTEST_WORKFLOW = REPO / ".github" / "workflows" / "attest-release.yml"
21
+ # actions/attest-build-provenance v4.2.2, pinned by commit: a tag can move.
22
+ ATTEST_SHA = "4d101475d8b20a2381f78447822ac1eab6504dd8"
20
23
 
21
24
 
22
25
  def load_module(path=TOOL, name="rust_audit_probe"):
@@ -54,16 +57,63 @@ def test_both_commands_run_the_same_entry_point():
54
57
  "the entry point names a function the module does not define")
55
58
 
56
59
 
57
- def test_alias_reserves_the_one_word_name():
58
- alias = tomllib.loads(ALIAS.read_text())
59
- version = tool_version()
60
- assert alias["project"]["name"] == "rustaudit"
61
- assert alias["project"]["version"] == version
62
- assert alias["project"]["dependencies"] == [f"rust-audit>={version}"]
63
- assert alias["tool"]["setuptools"]["packages"] == []
64
- assert "scripts" not in alias["project"], (
65
- "the alias must install no commands of its own, or it could shadow the "
66
- "real package's entry points")
60
+ def test_only_one_distribution_is_published():
61
+ """`rustaudit` cannot be a PyPI project next to `rust-audit`.
62
+
63
+ PyPI answers a pending publisher for the one-word name with "This project
64
+ name is too similar to an existing project" (checked against the live API
65
+ on 2026-10-20), so a second distribution would fail on every release. The
66
+ one-word command ships from this wheel's own entry points instead; the
67
+ workflow must not build or upload a second project.
68
+ """
69
+ workflow = PUBLISH_WORKFLOW.read_text()
70
+ assert "python -m build --outdir dist/main" in workflow
71
+ assert "packaging/" not in workflow, (
72
+ "the workflow builds a second distribution, which PyPI refuses as "
73
+ "too similar to rust-audit")
74
+ assert not (REPO / "packaging").exists(), (
75
+ "an alias distribution reappeared under packaging/")
76
+
77
+
78
+ def test_provenance_attestations_are_wired_in():
79
+ """Both channels attest a digest, from the workflow that can sign it.
80
+
81
+ `gh attestation verify` only answers for a digest some workflow run
82
+ signed with the repository's OIDC identity, so deleting either step
83
+ would silently downgrade the channel to "trust the uploader".
84
+ """
85
+ publish = PUBLISH_WORKFLOW.read_text()
86
+ attest = ATTEST_WORKFLOW.read_text()
87
+ for name, workflow in (("publish.yml", publish),
88
+ ("attest-release.yml", attest)):
89
+ assert "id-token: write" in workflow, f"{name}: nothing to sign with"
90
+ assert "attestations: write" in workflow, (
91
+ f"{name}: the attestation would have nowhere to go")
92
+ assert ATTEST_SHA in workflow, (
93
+ f"{name}: actions/attest-build-provenance is not pinned to "
94
+ f"{ATTEST_SHA} — a moving tag can be retargeted")
95
+ assert "subject-path: dist/main/*" in publish, (
96
+ "the wheel and sdist are not attested where they are built")
97
+ assert "subject-path: assets/*" in attest, (
98
+ "the uploaded release assets are not attested")
99
+ assert "release:" in attest and "published" in attest, (
100
+ "release assets only exist after `release: published`")
101
+ assert "gh release download" in attest, (
102
+ "the job must attest the bytes that were actually uploaded")
103
+
104
+
105
+ def test_security_says_what_each_channel_proves():
106
+ security = (REPO / "SECURITY.md").read_text()
107
+ assert "gh attestation verify" in security, (
108
+ "the attestations exist but SECURITY.md never tells anyone how to "
109
+ "check them")
110
+ assert "not wired in yet" not in security, (
111
+ "SECURITY.md still says attestations are missing")
112
+ rows = [line for line in security.splitlines()
113
+ if line.startswith("| GitHub release asset |")
114
+ or line.startswith("| PyPI wheel")]
115
+ assert len(rows) == 2, (
116
+ "the channel table must cover the release asset and the wheel")
67
117
 
68
118
 
69
119
  def test_declared_data_files_exist():
@@ -515,12 +515,6 @@ def make_cut_repo(path, keytype, keydata):
515
515
  "```bash\nscripts/verify_release.sh v0.2.0 ./rust_audit.py\n```\n")
516
516
  (path / "SKILL.md").write_text(
517
517
  "scripts/verify_release.sh v0.2.0 ./rust_audit.py\n")
518
- # --cut cuts both PyPI distributions, so the alias metadata is part of its
519
- # surface: without it here the version bump has nothing to edit.
520
- (path / "packaging" / "rustaudit-alias").mkdir(parents=True)
521
- (path / "packaging" / "rustaudit-alias" / "pyproject.toml").write_text(
522
- '[project]\nname = "rustaudit"\nversion = "0.2.0"\n'
523
- 'dependencies = ["rust-audit>=0.2.0"]\n')
524
518
  (path / "SECURITY.md").write_text(
525
519
  f'release@rust-audit namespaces="file" {keytype} {keydata}\n')
526
520
  cmd("git", "init", "-q", path)
@@ -547,11 +541,6 @@ def test_cut_releases_in_one_command(release, tmp_path):
547
541
  RA_REPO_ROOT=str(repo))
548
542
  assert r.returncode == 0, r.stdout + r.stderr
549
543
  assert 'VERSION = "9.9.9"' in (repo / "scripts" / "rust_audit.py").read_text()
550
- alias = (repo / "packaging" / "rustaudit-alias" / "pyproject.toml").read_text()
551
- assert 'version = "9.9.9"' in alias
552
- assert 'rust-audit>=9.9.9' in alias, (
553
- "the alias dependency floor must follow the tag, or pip installs an "
554
- "older rust-audit behind the alias")
555
544
  for doc in ("README.md", "SKILL.md"):
556
545
  assert "verify_release.sh v9.9.9" in (repo / doc).read_text()
557
546
  assert cmd("git", "-C", origin, "rev-parse", "v9.9.9").returncode == 0
File without changes
File without changes