Skip to content

Commit

Permalink
Test numeric password redaction (trufflesecurity#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina committed Jul 7, 2022
1 parent 5ac54ac commit 8e6289e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/detectors/jdbc/jdbc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down

0 comments on commit 8e6289e

Please sign in to comment.