From 31727b7788325159afa4c5382c1962080d6cca9b Mon Sep 17 00:00:00 2001 From: Muneeb Ullah Khan Date: Mon, 12 Jan 2026 12:50:21 +0500 Subject: [PATCH] updated gitlab client from v0.129.0 to v1.12.0(latest) --- go.mod | 2 +- pkg/engine/filesystem_integration_test.go | 3 ++- pkg/engine/gitlab_integration_test.go | 7 ++++--- pkg/sources/gitlab/gitlab_integration_test.go | 21 ------------------- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 290a6db59..eadbeb4ea 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/pkg/engine/filesystem_integration_test.go b/pkg/engine/filesystem_integration_test.go index f1dd2625d..0afc0abe9 100644 --- a/pkg/engine/filesystem_integration_test.go +++ b/pkg/engine/filesystem_integration_test.go @@ -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, }) diff --git a/pkg/engine/gitlab_integration_test.go b/pkg/engine/gitlab_integration_test.go index 5cc33cd5f..390afc031 100644 --- a/pkg/engine/gitlab_integration_test.go +++ b/pkg/engine/gitlab_integration_test.go @@ -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)) } diff --git a/pkg/sources/gitlab/gitlab_integration_test.go b/pkg/sources/gitlab/gitlab_integration_test.go index 933897b82..0d99c31e6 100644 --- a/pkg/sources/gitlab/gitlab_integration_test.go +++ b/pkg/sources/gitlab/gitlab_integration_test.go @@ -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{