Skip to content

Commit 491341c

Browse files
Added found verified endpoint to ExtraData
1 parent 20f4f19 commit 491341c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/detectors/datadogapikey/datadogapikey.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
7676
s1.SetVerificationError(verificationErr, resApiMatch)
7777
if isVerified {
7878
s1.AnalysisInfo = map[string]string{"apiKey": resApiMatch, "endpoint": baseURL}
79+
s1.ExtraData = map[string]string{"endpoint": baseURL}
7980
// break the loop once we've successfully validated the token against a baseURL
8081
break
8182
}

pkg/detectors/datadogapikey/datadogapikey_integration_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ func TestDataDogApiKey_FromChunk(t *testing.T) {
5454
"apiKey": apiKey,
5555
"endpoint": datdogEndpoint,
5656
},
57+
ExtraData: map[string]string{
58+
"endpoint": datdogEndpoint,
59+
},
5760
Raw: []byte(apiKey),
5861
},
5962
},

0 commit comments

Comments
 (0)