updated gitlab client from v0.129.0 to v1.12.0(latest)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@ 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"
|
||||
)
|
||||
|
||||
@@ -17,7 +18,7 @@ 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,
|
||||
})
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ func TestSource_Scan(t *testing.T) {
|
||||
}
|
||||
token := secret.MustGetField("GITLAB_TOKEN")
|
||||
basicUser := secret.MustGetField("GITLAB_USER")
|
||||
basicPass := secret.MustGetField("GITLAB_PASS")
|
||||
|
||||
type init struct {
|
||||
name string
|
||||
@@ -98,26 +97,6 @@ func TestSource_Scan(t *testing.T) {
|
||||
},
|
||||
wantReposScanned: 1,
|
||||
},
|
||||
{
|
||||
name: "basic auth, scoped repo",
|
||||
init: init{
|
||||
name: "test source basic auth scoped",
|
||||
connection: &sourcespb.GitLab{
|
||||
Repositories: []string{"https://gitlab.com/testermctestface/testy.git"},
|
||||
Credential: &sourcespb.GitLab_BasicAuth{
|
||||
BasicAuth: &credentialspb.BasicAuth{
|
||||
Username: basicUser,
|
||||
Password: basicPass,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
wantChunk: &sources.Chunk{
|
||||
SourceType: sourcespb.SourceType_SOURCE_TYPE_GITLAB,
|
||||
SourceName: "test source basic auth scoped",
|
||||
},
|
||||
wantReposScanned: 1,
|
||||
},
|
||||
{
|
||||
name: "basic auth access token, scoped repo",
|
||||
init: init{
|
||||
|
||||
Reference in New Issue
Block a user