Skip to content

Commit 5474feb

Browse files
Renamed AnypointOAuth2 detector's AnalysisInfo keys to make it consistent with its Analyzer (#4906)
* Rename analysisInfo keys to make it consistent with its relevant analyzer * Added analysis info to coinbase detector
1 parent 17456f8 commit 5474feb

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

pkg/detectors/anypointoauth2/anypointoauth2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
7979
s1.SetVerificationError(verificationErr)
8080
if isVerified {
8181
s1.AnalysisInfo = map[string]string{
82-
"id": id,
83-
"secret": secret,
82+
"client_id": id,
83+
"client_secret": secret,
8484
}
8585
}
8686
}

pkg/detectors/coinbase/coinbase.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func isValidECPrivateKey(pemKey []byte) bool {
6868

6969
// Check the key type
7070
_, ok := key.Public().(*ecdsa.PublicKey)
71-
return ok
71+
return ok
7272
}
7373

7474
func (s Scanner) getClient() *http.Client {
@@ -112,6 +112,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
112112
isVerified, verificationErr := s.verifyMatch(ctx, client, resKeyName, resPrivateKey)
113113
s1.Verified = isVerified
114114
s1.SetVerificationError(verificationErr, resPrivateKey)
115+
if isVerified {
116+
s1.AnalysisInfo = map[string]string{
117+
"key_name": resKeyName,
118+
"key": resPrivateKey,
119+
}
120+
}
115121
}
116122
results = append(results, s1)
117123

0 commit comments

Comments
 (0)