Secrets/Rules/Dist.pm

filter: Statementstmt 100% 4 / 4 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 100% 7 / 7 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
rules
1.0
CRAP 1.0
« Secrets.pm ↑ Summary Secrets/Rules/Gitleaks.pm »
1 5 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Text::Redact::Secrets::Rules::Dist;
4  
5 # Rules of the distribution's own, for secrets gitleaks has no rule for,
6 # written by hand, as roadmap 2026-0001's D12 says. Each is given as
7 # Text::Redact::Secrets::Rules::Gitleaks gives gitleaks', and run as they
8 # are, after them, with gitleaks' global allowlists.
9  
10 # The rules, each a hash as Text::Redact::Secrets::Rules::Gitleaks gives
11 # them.
12 4 ▶sub rules () {
Subroutine rules: called CC=1 SCAR=0.0
Pod documented
13 return [{
14  
15 # A password in a URL's user information, as in
16 # postgres://user:password@host/db, or redis://:password@host,
17 # whatever the scheme: the user may be empty, the password
18 # can't, and ends at the @.
19 4 id => 'url-userinfo-password',
20 regex => '\b[a-zA-Z][a-zA-Z0-9+.-]*://[^\s/?#@:]*:([^\s/?#@]+)@',
21 keywords => ['://'],
22 }];
23 }
24  
25 5 1;
26  
27 __END__
« Secrets.pm ↑ Summary Secrets/Rules/Gitleaks.pm »