@@ -647,10 +647,9 @@ func FuzzProcessEntry(f *testing.F) {
647
647
}
648
648
649
649
func FuzzConfig (f * testing.F ) {
650
- for _ , testConf := range testConfigs {
651
- for _ , testLog := range testLogs {
652
- f .Add (testConf , testLog .log )
653
- }
650
+ for _ , testLog := range testLogs {
651
+ f .Add ("" , false , uint (0 ), "" , "" , testLog .log ) // zero values
652
+ f .Add ("REDACTED" , true , uint (4 ), "aws,gcp" , "abc.*&.*foobar.*" , testLog .log ) // sane values
654
653
}
655
654
opts := component.Options {
656
655
Logger : util .TestLogger (f ),
@@ -659,18 +658,16 @@ func FuzzConfig(f *testing.F) {
659
658
}
660
659
ch1 := loki .NewLogsReceiver ()
661
660
662
- f .Fuzz (func (t * testing.T , config string , log string ) {
663
- var args Arguments
664
- err := syntax . Unmarshal ([] byte ( config ), & args )
665
- if err != nil {
666
- // ignore parsing errors, as we aren't fuzz testing the Alloy config parser
667
- return
668
- }
669
- if args . GitleaksConfig != "" {
670
- return // Skip the configs that use a custom gitleaks config file
661
+ f .Fuzz (func (t * testing.T , redact string , generic bool , partial uint , types string , allow string , log string ) {
662
+ args := Arguments {
663
+ ForwardTo : []loki. LogsReceiver { ch1 }, // not fuzzed
664
+ Types : strings . Split ( types , "," ),
665
+ RedactWith : redact ,
666
+ IncludeGeneric : generic ,
667
+ AllowList : strings . Split ( allow , "&" ), // a character that has no special meaning in go regexp and doesn't appear in the gitleaks regexes
668
+ PartialMask : partial ,
669
+ GitleaksConfig : "" , // not fuzzed in this test
671
670
}
672
-
673
- args .ForwardTo = []loki.LogsReceiver {ch1 }
674
671
c , err := New (opts , args )
675
672
if err != nil {
676
673
// ignore regex parsing errors
0 commit comments