Repository navigation
Guard the tests against literal credentials - #19
Merged
Merged
Conversation
Secret scanners cannot tell a test password from a leaked one, and report both. GitGuardian raised 28 incidents across laranail by 2026-10-18, 27 of them test literals or false positives, each closed by hand. This guard fails the suite on a literal credential, and on a TestCredentials purpose that is not a single word, so the next one never reaches a push. laranail/package-tools moves to ^0.1.10, which ships the purpose check.
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.
Why
Secret scanners cannot tell a test password from a leaked one, and report both. GitGuardian raised 28 incidents across laranail by 2026-10-18, 27 of them test literals or false positives, each closed by hand. This guard keeps the next one out of a push.
What changed
tests/Architecture/NoLiteralCredentialsTest.php: two tests fromlaranail/package-tools'AssertsNoLiteralCredentials. One fails on a literal credential undertests/, the other on aTestCredentialspurpose that is not a single lowercase word.composer.json:laranail/package-toolsraised to^0.1.10, which ships the purpose check.CHANGELOG.md: an[Unreleased]→### Changedentry.The scan inspects 5 PHP files, and both tests have a floor of
minFiles: 4, so a wrong path fails rather than passing over nothing. The v0.1.10 scanner found no literal credentials onmain, so no test changed.Red proof
After committing, each test was shown to fail, then restored with
git checkout HEAD --:passwordkey appended to the guard file: the literal test failed (named), and the purpose test passed.TestCredentials::password('smtp-new')appended: the purpose test failed on'smtp-new'.Nothing scratch is committed.
Local gates (PHP 8.5)
vendor/bin/laranail-pint --test: passed