Skip to content

Commit

Permalink
Merge pull request #16 from trufflesecurity/analyzer-detector-info
Browse files Browse the repository at this point in the history
Add AnalysisInfo to detectors.Result
  • Loading branch information
mcastorina authored Jul 25, 2024
2 parents 7e33008 + 50d6f32 commit a8ea3b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/detectors/detectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ type Result struct {
// This field should only be populated if the verification process itself failed in a way that provides no
// information about the verification status of the candidate secret, such as if the verification request timed out.
verificationError error

// AnalysisInfo should be set with information required for credential
// analysis to run. The keys of the map are analyzer specific and
// should match what is expected in the corresponding analyzer.
AnalysisInfo map[string]string
}

// SetVerificationError is the only way to set a verification error. Any sensitive values should be passed-in as secrets to be redacted.
Expand Down
1 change: 1 addition & 0 deletions pkg/detectors/openai/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.Verified = verified
s1.ExtraData = extraData
s1.SetVerificationError(verificationErr)
s1.AnalysisInfo = map[string]string{"key": token}
}

results = append(results, s1)
Expand Down

0 comments on commit a8ea3b1

Please sign in to comment.