Skip to content

Commit b0d7918

Browse files
authored
[THOG-314] Add new parameter to the Init method for the source interface. (#529)
* Add new parameter to the Init method for the source interface. * Add Oauth Token service. * remove .test file. * remove .test file. * Fix param spelling. * fix tests with new param in init * Add missing gock lib.
1 parent e12432c commit b0d7918

20 files changed

+976
-511
lines changed

pkg/engine/filesystem.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (e *Engine) ScanFileSystem(ctx context.Context, directories []string) error
2323
}
2424

2525
fileSystemSource := filesystem.Source{}
26-
err = fileSystemSource.Init(ctx, "trufflehog - filesystem", 0, int64(sourcespb.SourceType_SOURCE_TYPE_FILESYSTEM), true, &conn, runtime.NumCPU())
26+
err = fileSystemSource.Init(ctx, "trufflehog - filesystem", 0, int64(sourcespb.SourceType_SOURCE_TYPE_FILESYSTEM), true, &conn, runtime.NumCPU(), nil)
2727
if err != nil {
2828
return errors.WrapPrefix(err, "could not init filesystem source", 0)
2929
}

pkg/engine/github.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (e *Engine) ScanGitHub(ctx context.Context, endpoint string, repos, orgs []
3434
logrus.WithError(err).Error("failed to marshal github connection")
3535
return err
3636
}
37-
err = source.Init(ctx, "trufflehog - github", 0, 0, false, &conn, concurrency)
37+
err = source.Init(ctx, "trufflehog - github", 0, 0, false, &conn, concurrency, nil)
3838
if err != nil {
3939
logrus.WithError(err).Error("failed to initialize github source")
4040
return err

pkg/engine/gitlab.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (e *Engine) ScanGitLab(ctx context.Context, endpoint, token string, reposit
4040
}
4141

4242
gitlabSource := gitlab.Source{}
43-
err = gitlabSource.Init(ctx, "trufflehog - gitlab", 0, int64(sourcespb.SourceType_SOURCE_TYPE_GITLAB), true, &conn, runtime.NumCPU())
43+
err = gitlabSource.Init(ctx, "trufflehog - gitlab", 0, int64(sourcespb.SourceType_SOURCE_TYPE_GITLAB), true, &conn, runtime.NumCPU(), nil)
4444
if err != nil {
4545
return errors.WrapPrefix(err, "could not init GitLab source", 0)
4646
}

pkg/engine/s3.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (e *Engine) ScanS3(ctx context.Context, key, secret string, cloudCred bool,
4242
}
4343

4444
s3Source := s3.Source{}
45-
err = s3Source.Init(ctx, "trufflehog - s3", 0, int64(sourcespb.SourceType_SOURCE_TYPE_S3), true, &conn, runtime.NumCPU())
45+
err = s3Source.Init(ctx, "trufflehog - s3", 0, int64(sourcespb.SourceType_SOURCE_TYPE_S3), true, &conn, runtime.NumCPU(), nil)
4646
if err != nil {
4747
return errors.WrapPrefix(err, "failed to init S3 source", 0)
4848
}

pkg/engine/syslog.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (e *Engine) ScanSyslog(ctx context.Context, address, protocol, certPath, ke
3939
return errors.WrapPrefix(err, "error unmarshalling connection", 0)
4040
}
4141
source := syslog.Source{}
42-
err = source.Init(ctx, "trufflehog - syslog", 0, 0, false, &conn, concurrency)
42+
err = source.Init(ctx, "trufflehog - syslog", 0, 0, false, &conn, concurrency, nil)
4343
source.InjectConnection(connection)
4444
if err != nil {
4545
logrus.WithError(err).Error("failed to initialize syslog source")

0 commit comments

Comments
 (0)