Skip to content

Port the local credential guard to the 0.1.10 rules - #29

Merged
imanimanyara merged 1 commit into
mainfrom
chore/declare-guard-copy
Oct 20, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
chore/declare-guard-copy

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Why: this repository carries a local port of laranail/package-tools' credential scanner, because its CI tests PHP 8.3, below package-tools' floor. The port predated package-tools 0.1.10:

  • It had no check that TestCredentials purposes are single words. GitGuardian reads a compound purpose as the password itself.
  • It had none of 0.1.10's false-positive exclusions (route names, casts, single validation rules, metadata keys, last-segment dotted keys).
  • It didn't catch a strong-looking new Password() literal or a dotted credential key.

Change:

  • tests/Unit/NoLiteralCredentialsTest.php is now the same 0.1.10 port enumerator carries. It has three tests: literals, purposes, and a self-check that the scanner recognises what it guards, plus a 9-file floor.
  • It declares @credential-guard-copy reason=php-floor-below-package-tools mirrors=0.1.10, so package-tools' new scheduled verify-credential-guard-copies.py catches the next drift.
  • CHANGELOG entry.

Verification:

  • The guard runs green locally: 3 tests.
  • Red proof: a scratch literal and a scratch hyphenated purpose in tests/TestCase.php each turned it red; restored afterwards.
  • The copy check passes over this branch.

This copy of package-tools' scanner predated 0.1.10: it had no check
that TestCredentials purposes are single words, which GitGuardian reads
as passwords when they are not, and none of the false-positive
exclusions. It is now the same port enumerator carries, and it declares
itself (@credential-guard-copy reason=php-floor-below-package-tools
mirrors=0.1.10) so package-tools' scheduled copy check catches the next
drift instead of nobody.
Copilot AI balanced review requested due to automatic review settings October 20, 2026 12:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@imanimanyara
imanimanyara merged commit d3946cc into main Oct 20, 2026
11 checks passed
@imanimanyara
imanimanyara deleted the chore/declare-guard-copy branch October 20, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants