Repository navigation
test: one runtime test credential, and a guard against password literals - #145
Merged
Merged
Conversation
Integration tests no longer declare passwords: tests/support provides a per-process password generated from OS randomness (plus wrong, fresh, and too-short variants), the shared login and user helpers that 14 and 12 test crates had each copied, and assertion messages that name no user. With no literal there is nothing for CodeQL's hard-coded-credential and cleartext-logging rules to flag in new test files (#126; recurred on #130 and #139). tests/no_credential_literals.rs scans every test source and fails on a password, passphrase, or secret literal in a binding, struct field, JSON key, JSON-in-a-string, or a credential call, with its scan contract in the header, an exact-path allowlist (upgrade_compat's argon2 0.5 fixture), and negative controls for every shape it flags and every allowed shape it must not; against the pre-change tests it reports 38 findings across 28 files. Closes #126 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Independent review found no blockers. Follow-ups: upgrade_compat again
checks a one-character near miss of the fixture password, built at run time
(a verifier that ignored the last byte passed the previous version); a
sensitive binding is flagged for any non-empty literal in its initializer
(arrays, vec!, Some, match/if arms, closures), a ("password", "literal")
pair and macro/turbofish credential calls are caught, and sign-in helpers
are matched by more names; empty literals are exempt, so absence and
empty-password tests read naturally; the header lists every remaining miss
with its reason. The controls move to a 149-case corpus checked against the
header in both directions, the walk skips symbolic links, and an unreadable
file is named. Against the pre-change tests: 38 findings in 26 files.
Refs #126
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 15, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primary Issue
Closes #126
Problem And Outcome
Every integration test file declared its own password. CodeQL's
rust/hard-coded-cryptographic-valueandrust/cleartext-loggingrules then flagged each new test file, turning the PR's CodeQL check red and blocking merge until the alerts were dismissed by hand. This happened on #130 and #139.After merge, the Rust integration tests hold no password literal outside one allowlisted compatibility fixture. A guard test fails
cargo teston a new one.Changes
tests/support/mod.rsprovides:password(), a per-process value from OS randomness;wrong_password(),fresh_password(), andtoo_short_password();loginanduser_with_rolehelpers that 14 and 12 test crates had each copied;upgrade_compatkeeps its argon2 0.5 fixture password, allowlisted by exact path. It again checks a one-character near miss, built at run time.tests/no_credential_literals.rs: the guard.("password", "lit")pairs; credential calls, including macros and turbofish.docs/development.md: one sentence on where test credentials come from.Scope
Verification
c19f940d1019a4908fd6f8f3f0c14e3e6a79fc91(tree78221af0).54782768…. The test count drops because the guard's controls moved into one corpus test.tests/". The dismissed alerts at the swept locations (Milestone 2 slice 3: enrollment pinning and minimal user creation #19–Stream installation exports instead of assembling the archive in memory #47, records(packet): trainee packets over the export units #50, records(packet): bind signoffs and phase events to the pin timeline in verification #52, web(deps): resolve SvelteKit cookie audit advisory #54, Implement Milestone 1 operable-shell foundation #1–docs(decisions): adopt program-version configuration model #13) are expected to close.Review And Merge Notes
fc3f7fe): 0 blocking.c19f940: the near miss, the uncaught-shape class plus an honest header, and empty-literal false positives. Nits: wording, symlinks, the unreadable-file path, andmodplacement.🤖 Generated with Claude Code