Skip to content

Commit ba5b98e

Browse files
committed
rename to SourceVerify
1 parent 3f26a1c commit ba5b98e

File tree

23 files changed

+84
-84
lines changed

23 files changed

+84
-84
lines changed

pkg/decoders/escaped_unicode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (d *EscapedUnicode) FromChunk(chunk *sources.Chunk) *DecodableChunk {
111111
SecretID: chunk.SecretID,
112112
SourceMetadata: chunk.SourceMetadata,
113113
SourceType: chunk.SourceType,
114-
Verify: chunk.Verify,
114+
SourceVerify: chunk.SourceVerify,
115115
},
116116
}
117117
} else {

pkg/engine/engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ func (e *Engine) scannerWorker(ctx context.Context) {
793793

794794
for chunk := range e.ChunksChan() {
795795
startTime := time.Now()
796-
sourceVerify := chunk.Verify
796+
sourceVerify := chunk.SourceVerify
797797
for _, decoder := range e.decoders {
798798
decodeStart := time.Now()
799799
// This copy is needed to preserve the original chunk.Data across multiple decoders.
@@ -1028,7 +1028,7 @@ func (e *Engine) verificationOverlapWorker(ctx context.Context) {
10281028
chunk: chunk.chunk,
10291029
detector: detector,
10301030
decoder: chunk.decoder,
1031-
verify: e.shouldVerifyChunk(chunk.chunk.Verify, detector, e.detectorVerificationOverrides),
1031+
verify: e.shouldVerifyChunk(chunk.chunk.SourceVerify, detector, e.detectorVerificationOverrides),
10321032
wgDoneFn: wgDetect.Done,
10331033
}
10341034
}

pkg/sources/circleci/circleci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ func (s *Source) chunk(ctx context.Context, proj project, buildNum BuildNum, ste
375375
},
376376
},
377377
},
378-
Verify: s.verify,
378+
SourceVerify: s.verify,
379379
}
380380
if err := data.Error(); err != nil {
381381
return err

pkg/sources/docker/docker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ func (s *Source) processHistoryEntry(ctx context.Context, historyInfo historyEnt
342342
},
343343
},
344344
},
345-
Verify: s.verify,
346-
Data: []byte(historyInfo.entry.CreatedBy),
345+
SourceVerify: s.verify,
346+
Data: []byte(historyInfo.entry.CreatedBy),
347347
}
348348

349349
ctx.Logger().V(2).Info("scanning image history entry", "index", historyInfo.index, "layer", historyInfo.layerDigest)
@@ -455,7 +455,7 @@ func (s *Source) processChunk(ctx context.Context, info chunkProcessingInfo, chu
455455
},
456456
},
457457
},
458-
Verify: s.verify,
458+
SourceVerify: s.verify,
459459
}
460460
chunk.Data = data.Bytes()
461461

pkg/sources/elasticsearch/elasticsearch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (s *Source) Chunks(
202202
},
203203
},
204204
},
205-
Verify: s.verify,
205+
SourceVerify: s.verify,
206206
}
207207

208208
chunk.Data = []byte(document.message)

pkg/sources/filesystem/filesystem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (s *Source) scanFile(ctx context.Context, path string, chunksChan chan *sou
215215
},
216216
},
217217
},
218-
Verify: s.verify,
218+
SourceVerify: s.verify,
219219
}
220220

221221
return handlers.HandleFile(fileCtx, inputFile, chunkSkel, sources.ChanReporter{Ch: chunksChan})

pkg/sources/gcs/gcs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,11 @@ func (s *Source) completeProgress(ctx context.Context) {
333333

334334
func (s *Source) processObject(ctx context.Context, o object) error {
335335
chunkSkel := &sources.Chunk{
336-
SourceName: s.name,
337-
SourceType: s.Type(),
338-
JobID: s.JobID(),
339-
SourceID: s.sourceId,
340-
Verify: s.verify,
336+
SourceName: s.name,
337+
SourceType: s.Type(),
338+
JobID: s.JobID(),
339+
SourceID: s.sourceId,
340+
SourceVerify: s.verify,
341341
SourceMetadata: &source_metadatapb.MetaData{
342342
Data: &source_metadatapb.MetaData_Gcs{
343343
Gcs: &source_metadatapb.GCS{

pkg/sources/gcs/gcs_integration_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ func TestChunks_PublicBucket(t *testing.T) {
7979

8080
want := []*sources.Chunk{
8181
{
82-
SourceName: "test",
83-
SourceType: sourcespb.SourceType_SOURCE_TYPE_GCS,
84-
SourceID: 0,
85-
Verify: true,
82+
SourceName: "test",
83+
SourceType: sourcespb.SourceType_SOURCE_TYPE_GCS,
84+
SourceID: 0,
85+
SourceVerify: true,
8686
SourceMetadata: &source_metadatapb.MetaData{
8787
Data: &source_metadatapb.MetaData_Gcs{
8888
Gcs: &source_metadatapb.GCS{
@@ -164,10 +164,10 @@ func createTestChunks() []*sources.Chunk {
164164
chunks := make([]*sources.Chunk, 0, len(objects))
165165
for _, o := range objects {
166166
chunks = append(chunks, &sources.Chunk{
167-
SourceName: "test",
168-
SourceType: sourcespb.SourceType_SOURCE_TYPE_GCS,
169-
SourceID: 0,
170-
Verify: true,
167+
SourceName: "test",
168+
SourceType: sourcespb.SourceType_SOURCE_TYPE_GCS,
169+
SourceID: 0,
170+
SourceVerify: true,
171171
SourceMetadata: &source_metadatapb.MetaData{
172172
Data: &source_metadatapb.MetaData_Gcs{
173173
Gcs: &source_metadatapb.GCS{

pkg/sources/gcs/gcs_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ func createTestObject(id int) object {
271271

272272
func createTestSourceChunk(id int) *sources.Chunk {
273273
return &sources.Chunk{
274-
SourceName: "test",
275-
SourceType: sourcespb.SourceType_SOURCE_TYPE_GCS,
276-
SourceID: 0,
277-
Verify: true,
278-
Data: []byte(fmt.Sprintf("hello world %d", id)),
274+
SourceName: "test",
275+
SourceType: sourcespb.SourceType_SOURCE_TYPE_GCS,
276+
SourceID: 0,
277+
SourceVerify: true,
278+
Data: []byte(fmt.Sprintf("hello world %d", id)),
279279
SourceMetadata: &source_metadatapb.MetaData{
280280
Data: &source_metadatapb.MetaData_Gcs{
281281
Gcs: &source_metadatapb.GCS{

pkg/sources/git/git.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string
745745
SourceType: s.sourceType,
746746
SourceMetadata: metadata,
747747
Data: []byte(sb.String()),
748-
Verify: s.verify,
748+
SourceVerify: s.verify,
749749
}
750750
if err := reporter.ChunkOk(ctx, chunk); err != nil {
751751
return err
@@ -779,7 +779,7 @@ func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string
779779
JobID: s.jobID,
780780
SourceType: s.sourceType,
781781
SourceMetadata: metadata,
782-
Verify: s.verify,
782+
SourceVerify: s.verify,
783783
}
784784

785785
if err := HandleBinary(ctx, gitDir, reporter, chunkSkel, commitHash, fileName, s.skipArchives); err != nil {
@@ -828,7 +828,7 @@ func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string
828828
SourceType: s.sourceType,
829829
SourceMetadata: metadata,
830830
Data: data,
831-
Verify: s.verify,
831+
SourceVerify: s.verify,
832832
}
833833
return reporter.ChunkOk(ctx, chunk)
834834
}
@@ -866,7 +866,7 @@ func (s *Git) gitChunk(ctx context.Context, diff *gitparse.Diff, fileName, email
866866
SourceType: s.sourceType,
867867
SourceMetadata: metadata,
868868
Data: append([]byte{}, newChunkBuffer.Bytes()...),
869-
Verify: s.verify,
869+
SourceVerify: s.verify,
870870
}
871871
if err := reporter.ChunkOk(ctx, chunk); err != nil {
872872
// TODO: Return error.
@@ -886,7 +886,7 @@ func (s *Git) gitChunk(ctx context.Context, diff *gitparse.Diff, fileName, email
886886
SourceType: s.sourceType,
887887
SourceMetadata: metadata,
888888
Data: line,
889-
Verify: s.verify,
889+
SourceVerify: s.verify,
890890
}
891891
if err := reporter.ChunkOk(ctx, chunk); err != nil {
892892
// TODO: Return error.
@@ -910,7 +910,7 @@ func (s *Git) gitChunk(ctx context.Context, diff *gitparse.Diff, fileName, email
910910
SourceType: s.sourceType,
911911
SourceMetadata: metadata,
912912
Data: append([]byte{}, newChunkBuffer.Bytes()...),
913-
Verify: s.verify,
913+
SourceVerify: s.verify,
914914
}
915915
if err := reporter.ChunkOk(ctx, chunk); err != nil {
916916
// TODO: Return error.
@@ -1010,7 +1010,7 @@ func (s *Git) ScanStaged(ctx context.Context, repo *git.Repository, path string,
10101010
JobID: s.jobID,
10111011
SourceType: s.sourceType,
10121012
SourceMetadata: metadata,
1013-
Verify: s.verify,
1013+
SourceVerify: s.verify,
10141014
}
10151015
if err := HandleBinary(ctx, gitDir, reporter, chunkSkel, commitHash, fileName, s.skipArchives); err != nil {
10161016
logger.Error(err, "error handling binary file")
@@ -1040,7 +1040,7 @@ func (s *Git) ScanStaged(ctx context.Context, repo *git.Repository, path string,
10401040
SourceType: s.sourceType,
10411041
SourceMetadata: metadata,
10421042
Data: data,
1043-
Verify: s.verify,
1043+
SourceVerify: s.verify,
10441044
}
10451045
return reporter.ChunkOk(ctx, chunk)
10461046
}

0 commit comments

Comments
 (0)