You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: "found two, one included for every ID found",
91
+
s: Scanner{},
92
+
args: args{
93
+
ctx: context.Background(),
94
+
data: []byte(fmt.Sprintf("The verified ID is %s with a secret of %s, but the unverified ID is %s and this is the secret %s", id, secret, inactiveID, inactiveSecret)),
95
+
verify: true,
96
+
},
97
+
want: []detectors.Result{
98
+
{
99
+
DetectorType: detectorspb.DetectorType_AWS,
100
+
Verified: true,
101
+
Redacted: id,
102
+
},
103
+
{
104
+
DetectorType: detectorspb.DetectorType_AWS,
105
+
Verified: false,
106
+
Redacted: inactiveID,
107
+
},
108
+
},
109
+
wantErr: false,
110
+
},
111
+
{
112
+
name: "not found, because unverified secret was a hash",
113
+
s: Scanner{},
114
+
args: args{
115
+
ctx: context.Background(),
116
+
data: []byte(fmt.Sprintf("You can find a aws secret %s within aws %s but not valid", hash, id)), // The secret would satisfy the regex but be filtered out after not passing validation.
117
+
verify: true,
118
+
},
119
+
want: nil,
120
+
wantErr: false,
121
+
},
122
+
{
123
+
name: "found two, returned both because the active secret for one paired with the inactive ID, despite the hash",
124
+
s: Scanner{},
125
+
args: args{
126
+
ctx: context.Background(),
127
+
data: []byte(fmt.Sprintf("The verified ID is %s with a secret of %s, but the unverified ID is %s and the secret is this hash %s", id, secret, inactiveID, hash)),
0 commit comments