Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ require (
github.com/trufflesecurity/disk-buffer-reader v0.2.1
github.com/wasilibs/go-re2 v1.9.0
github.com/xo/dburl v0.23.8
gitlab.com/gitlab-org/api/client-go v0.129.0
gitlab.com/gitlab-org/api/client-go v1.12.0
go.mongodb.org/mongo-driver v1.17.4
go.uber.org/automaxprocs v1.6.0
go.uber.org/mock v0.5.2
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/filesystem_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/trufflesecurity/trufflehog/v3/pkg/context"
"github.com/trufflesecurity/trufflehog/v3/pkg/engine/defaults"
"github.com/trufflesecurity/trufflehog/v3/pkg/sources"
)

Expand Down Expand Up @@ -62,7 +63,7 @@ func TestFilesystem(t *testing.T) {
// Run the scan.
ctx := context.Background()
e, err := NewEngine(ctx, &Config{
Detectors: DefaultDetectors(),
Detectors: defaults.DefaultDetectors(),
SourceManager: sources.NewManager(),
Verify: false,
})
Expand Down
7 changes: 4 additions & 3 deletions pkg/engine/gitlab_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import (
"github.com/stretchr/testify/assert"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/context"
"github.com/trufflesecurity/trufflehog/v3/pkg/engine/defaults"
"github.com/trufflesecurity/trufflehog/v3/pkg/sources"
)

func TestGitLab(t *testing.T) {
// Run the scan.
ctx := context.Background()
e, err := NewEngine(ctx, &Config{
Detectors: DefaultDetectors(),
Detectors: defaults.DefaultDetectors(),
SourceManager: sources.NewManager(),
Verify: false,
})
Expand All @@ -38,6 +39,6 @@ func TestGitLab(t *testing.T) {

// Check the output provided by metrics.
metrics := e.GetMetrics()
assert.GreaterOrEqual(t, metrics.ChunksScanned, uint64(36312))
assert.GreaterOrEqual(t, metrics.BytesScanned, uint64(91618854))
assert.GreaterOrEqual(t, metrics.ChunksScanned, uint64(23528))
assert.GreaterOrEqual(t, metrics.BytesScanned, uint64(84982266))
}
10 changes: 6 additions & 4 deletions pkg/sources/gitlab/gitlab_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func TestSource_Scan(t *testing.T) {
}
token := secret.MustGetField("GITLAB_TOKEN")
basicUser := secret.MustGetField("GITLAB_USER")
basicPass := secret.MustGetField("GITLAB_PASS")
no2FaUser := secret.MustGetField("GITLAB_NO_2FA_USER")
no2FaPass := secret.MustGetField("GITLAB_NO_2FA_PASS")

type init struct {
name string
Expand Down Expand Up @@ -103,11 +104,12 @@ func TestSource_Scan(t *testing.T) {
init: init{
name: "test source basic auth scoped",
connection: &sourcespb.GitLab{
Repositories: []string{"https://gitlab.com/testermctestface/testy.git"},
Repositories: []string{"https://gitlab.com/trufflesec-detectors/test-project.git"},

Credential: &sourcespb.GitLab_BasicAuth{
BasicAuth: &credentialspb.BasicAuth{
Username: basicUser,
Password: basicPass,
Username: no2FaUser,
Password: no2FaPass,
},
},
},
Expand Down
Loading