@@ -10,6 +10,7 @@ import (
10
10
11
11
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
12
12
"github.com/trufflesecurity/trufflehog/v3/pkg/context"
13
+ "github.com/trufflesecurity/trufflehog/v3/pkg/feature"
13
14
"github.com/trufflesecurity/trufflehog/v3/pkg/giturl"
14
15
"github.com/trufflesecurity/trufflehog/v3/pkg/log"
15
16
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/source_metadatapb"
@@ -31,9 +32,6 @@ const SourceType = sourcespb.SourceType_SOURCE_TYPE_GITLAB
31
32
// This is the URL for gitlab hosted at gitlab.com
32
33
const gitlabBaseURL = "https://gitlab.com/"
33
34
34
- // useSimplifiedGitlabEnumeration if set to true use simplified list-all-projects API to enumerate
35
- var useSimplifiedGitlabEnumeration = true
36
-
37
35
type Source struct {
38
36
name string
39
37
sourceID sources.SourceID
@@ -268,7 +266,7 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk, tar
268
266
return ctx .Err ()
269
267
},
270
268
}
271
- if useSimplifiedGitlabEnumeration {
269
+ if feature . UseSimplifiedGitlabEnumeration . Load () {
272
270
if err := s .getAllProjectReposV2 (ctx , apiClient , ignoreRepo , reporter ); err != nil {
273
271
return err
274
272
}
@@ -403,7 +401,7 @@ func (s *Source) Validate(ctx context.Context) []error {
403
401
},
404
402
}
405
403
406
- if useSimplifiedGitlabEnumeration {
404
+ if feature . UseSimplifiedGitlabEnumeration . Load () {
407
405
if err := s .getAllProjectReposV2 (ctx , apiClient , ignoreProject , visitor ); err != nil {
408
406
errs = append (errs , err )
409
407
return errs
@@ -943,7 +941,7 @@ func (s *Source) Enumerate(ctx context.Context, reporter sources.UnitReporter) e
943
941
_ = reporter .UnitErr (ctx , fmt .Errorf ("could not compile include/exclude repo glob: %w" , err ))
944
942
})
945
943
946
- if useSimplifiedGitlabEnumeration {
944
+ if feature . UseSimplifiedGitlabEnumeration . Load () {
947
945
return s .getAllProjectReposV2 (ctx , apiClient , ignoreRepo , reporter )
948
946
} else {
949
947
return s .getAllProjectRepos (ctx , apiClient , ignoreRepo , reporter )
0 commit comments