Skip to content

Find, verify, and analyze leaked credentials

Test numeric password redaction (#644)

Miccah8e6289e70c1c
diff --git a/pkg/detectors/jdbc/jdbc_test.go b/pkg/detectors/jdbc/jdbc_test.go
index e01a142d8..a4b447d39 100644
--- a/pkg/detectors/jdbc/jdbc_test.go
+++ b/pkg/detectors/jdbc/jdbc_test.go
@@ -40,6 +40,23 @@ func TestJdbc_FromChunk(t *testing.T) {
},
wantErr: false,
},
+ {
+ name: "found, unverified numeric password",
+ s: Scanner{},
+ args: args{
+ ctx: context.Background(),
+ data: []byte(`jdbc connection string: jdbc:postgresql://host:5342/testdb?password=123456 <-`),
+ verify: false,
+ },
+ want: []detectors.Result{
+ {
+ DetectorType: detectorspb.DetectorType_JDBC,
+ Verified: false,
+ Redacted: "jdbc:postgresql://host:5342/testdb?password=******",
+ },
+ },
+ wantErr: false,
+ },
{
name: "not found",
s: Scanner{},