Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Rename AnalysisInfo field to SecretParts on detectors.Result (#4911)
Miccah1529239780dc
diff --git a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.goindex c0a9a81da..5bb5773b2 100644--- a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go+++ b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go@@ -71,7 +71,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr)if isVerified {- s1.AnalysisInfo = map[string]string{"key": key}+ s1.SecretParts = map[string]string{"key": key}}}diff --git a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.goindex c6bdacbbf..1dc23ba29 100644--- a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go+++ b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr)if isVerified {- s1.AnalysisInfo = map[string]string{"key": key}+ s1.SecretParts = map[string]string{"key": key}}}diff --git a/pkg/detectors/airtableoauth/airtableoauth.go b/pkg/detectors/airtableoauth/airtableoauth.goindex 46999518f..d5d15d6a8 100644--- a/pkg/detectors/airtableoauth/airtableoauth.go+++ b/pkg/detectors/airtableoauth/airtableoauth.go@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{"token": match}+ s1.SecretParts = map[string]string{"token": match}}}diff --git a/pkg/detectors/airtablepersonalaccesstoken/airtablepersonalaccesstoken.go b/pkg/detectors/airtablepersonalaccesstoken/airtablepersonalaccesstoken.goindex b2c71e1da..ba6820d85 100644--- a/pkg/detectors/airtablepersonalaccesstoken/airtablepersonalaccesstoken.go+++ b/pkg/detectors/airtablepersonalaccesstoken/airtablepersonalaccesstoken.go@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{"token": match}+ s1.SecretParts = map[string]string{"token": match}}}diff --git a/pkg/detectors/anthropic/anthropic.go b/pkg/detectors/anthropic/anthropic.goindex defcfec56..bcd09c32e 100644--- a/pkg/detectors/anthropic/anthropic.go+++ b/pkg/detectors/anthropic/anthropic.go@@ -76,7 +76,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(err, keyMatch)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": keyMatch,}}diff --git a/pkg/detectors/anthropic/anthropic_integration_test.go b/pkg/detectors/anthropic/anthropic_integration_test.goindex 6d81721f2..40123ed15 100644--- a/pkg/detectors/anthropic/anthropic_integration_test.go+++ b/pkg/detectors/anthropic/anthropic_integration_test.go@@ -121,7 +121,7 @@ func TestAnthropic_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Anthropic.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/anypointoauth2/anypointoauth2.go b/pkg/detectors/anypointoauth2/anypointoauth2.goindex 552748164..597ced839 100644--- a/pkg/detectors/anypointoauth2/anypointoauth2.go+++ b/pkg/detectors/anypointoauth2/anypointoauth2.go@@ -78,7 +78,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"client_id": id,"client_secret": secret,}diff --git a/pkg/detectors/artifactory/artifactory.go b/pkg/detectors/artifactory/artifactory.goindex 5ba2c23e8..99e4707e2 100644--- a/pkg/detectors/artifactory/artifactory.go+++ b/pkg/detectors/artifactory/artifactory.go@@ -100,7 +100,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, token)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"domain": url,"token": token,}diff --git a/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken.go b/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken.goindex fce9a895d..6f45cd8b8 100644--- a/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken.go+++ b/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken.go@@ -99,7 +99,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"domain": url,"token": token,}diff --git a/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken_integration_test.go b/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken_integration_test.goindex 48bf55350..da08801fd 100644--- a/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken_integration_test.go+++ b/pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken_integration_test.go@@ -142,7 +142,7 @@ func TestArtifactoryreferencetoken_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Artifactoryreferencetoken.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}@@ -188,7 +188,7 @@ func TestArtifactoryreferencetoken_FromChunk_WithCustomEndpoint(t *testing.T) {}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret", "SecretParts")if diff := cmp.Diff(got, want, ignoreOpts); diff != "" {t.Errorf("Artifactoryreferencetoken.FromData() diff: (-got +want)\n%s", diff)}diff --git a/pkg/detectors/asanaoauth/asanaoauth.go b/pkg/detectors/asanaoauth/asanaoauth.goindex 43563c42f..5f5cad550 100644--- a/pkg/detectors/asanaoauth/asanaoauth.go+++ b/pkg/detectors/asanaoauth/asanaoauth.go@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, err := verifyMatch(ctx, client, resMatch)s1.Verified = isVerifieds1.SetVerificationError(err, resMatch)- s1.AnalysisInfo = map[string]string{"key": resMatch}+ s1.SecretParts = map[string]string{"key": resMatch}}results = append(results, s1)diff --git a/pkg/detectors/asanaoauth/asanaoauth_integration_test.go b/pkg/detectors/asanaoauth/asanaoauth_integration_test.goindex 361e85054..3d7f770e4 100644--- a/pkg/detectors/asanaoauth/asanaoauth_integration_test.go+++ b/pkg/detectors/asanaoauth/asanaoauth_integration_test.go@@ -95,7 +95,7 @@ func TestAsanaOauth_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("AsanaOauth.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.goindex 46ad145ab..c07700432 100644--- a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go+++ b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(err, resMatch)if isVerified {- s1.AnalysisInfo = map[string]string{"key": resMatch}+ s1.SecretParts = map[string]string{"key": resMatch}}}diff --git a/pkg/detectors/atlassian/v1/atlassian.go b/pkg/detectors/atlassian/v1/atlassian.goindex 5fe5b180d..a0ce2cdbd 100644--- a/pkg/detectors/atlassian/v1/atlassian.go+++ b/pkg/detectors/atlassian/v1/atlassian.go@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/atlassian/v2/atlassian.go b/pkg/detectors/atlassian/v2/atlassian.goindex 7b7e54618..6e478707b 100644--- a/pkg/detectors/atlassian/v2/atlassian.go+++ b/pkg/detectors/atlassian/v2/atlassian.go@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultuniqueOrgIdMatches[match[1]] = struct{}{}}if len(uniqueOrgIdMatches) == 0 {- // we only need an org ID to pass into AnalysisInfo+ // we only need an org ID to pass into SecretParts// if we don't find one, we can still verify the key// we can add a dummy entry here just to make sure a result is returneduniqueOrgIdMatches[""] = struct{}{}@@ -97,11 +97,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}s1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}if orgId != "" {- s1.AnalysisInfo["organization_id"] = orgId+ s1.SecretParts["organization_id"] = orgId}}}diff --git a/pkg/detectors/atlassian/v2/atlassian_integration_test.go b/pkg/detectors/atlassian/v2/atlassian_integration_test.goindex 0eee829f0..60346570d 100644--- a/pkg/detectors/atlassian/v2/atlassian_integration_test.go+++ b/pkg/detectors/atlassian/v2/atlassian_integration_test.go@@ -136,7 +136,7 @@ func TestAtlassian_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "ExtraData", "primarySecret", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "ExtraData", "primarySecret", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Atlassian.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/atlassian/v2/atlassian_test.go b/pkg/detectors/atlassian/v2/atlassian_test.goindex 96a4a5aa3..ebb793e43 100644--- a/pkg/detectors/atlassian/v2/atlassian_test.go+++ b/pkg/detectors/atlassian/v2/atlassian_test.go@@ -85,9 +85,9 @@ func TestAtlassian_Pattern(t *testing.T) {}}-// TestAtlassian_AnalysisInfo_KeyAndOrgId tests if both the key and organization id are populated into AnalysisInfo+// TestAtlassian_SecretParts_KeyAndOrgId tests if both the key and organization id are populated into SecretParts// given that they are present in the input data chunk-func TestAtlassian_AnalysisInfo_KeyAndOrgId(t *testing.T) {+func TestAtlassian_SecretParts_KeyAndOrgId(t *testing.T) {client := common.SaneHttpClient()d := Scanner{client: client}@@ -118,16 +118,16 @@ func TestAtlassian_AnalysisInfo_KeyAndOrgId(t *testing.T) {require.NoError(t, err)require.Len(t, results, 1, "mismatch in result count: expected %d, got %d", 1, len(results))result := results[0]- require.NotNil(t, result.AnalysisInfo, "AnalysisInfo is nil")+ require.NotNil(t, result.SecretParts, "SecretParts is nil")- assert.Equal(t, key, result.AnalysisInfo["key"], "mismatch in key")- assert.Equal(t, orgId, result.AnalysisInfo["organization_id"], "mismatch in organization_id")+ assert.Equal(t, key, result.SecretParts["key"], "mismatch in key")+ assert.Equal(t, orgId, result.SecretParts["organization_id"], "mismatch in organization_id")})}-// TestAtlassian_AnalysisInfo_KeyOnly tests if only key is populated into AnalysisInfo+// TestAtlassian_SecretParts_KeyOnly tests if only key is populated into SecretParts// given that only the key and no organization_id is present in the input data chunk-func TestAtlassian_AnalysisInfo_KeyOnly(t *testing.T) {+func TestAtlassian_SecretParts_KeyOnly(t *testing.T) {client := common.SaneHttpClient()d := Scanner{client: client}@@ -156,8 +156,8 @@ func TestAtlassian_AnalysisInfo_KeyOnly(t *testing.T) {require.NoError(t, err)require.Len(t, results, 1, "mismatch in result count: expected %d, got %d", 1, len(results))result := results[0]- require.NotNil(t, result.AnalysisInfo, "AnalysisInfo is nil")+ require.NotNil(t, result.SecretParts, "SecretParts is nil")- assert.Equal(t, key, result.AnalysisInfo["key"], "mismatch in key")+ assert.Equal(t, key, result.SecretParts["key"], "mismatch in key")})}diff --git a/pkg/detectors/aws/access_keys/accesskey.go b/pkg/detectors/aws/access_keys/accesskey.goindex 158f3aeee..95bb86c76 100644--- a/pkg/detectors/aws/access_keys/accesskey.go+++ b/pkg/detectors/aws/access_keys/accesskey.go@@ -154,7 +154,7 @@ func (s scanner) FromData(ctx context.Context, verify bool, data []byte) (resultExtraData: map[string]string{"resource_type": aws.ResourceTypes[idMatch[:4]],},- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"access_key_id": idMatch,"secret_access_key": secretMatch,},diff --git a/pkg/detectors/azureapimanagement/repositorykey/repositorykey_integration_test.go b/pkg/detectors/azureapimanagement/repositorykey/repositorykey_integration_test.goindex 49f2830b2..c54f24043 100644--- a/pkg/detectors/azureapimanagement/repositorykey/repositorykey_integration_test.go+++ b/pkg/detectors/azureapimanagement/repositorykey/repositorykey_integration_test.go@@ -110,7 +110,7 @@ func TestAxonaut_FromChunk(t *testing.T) {}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "ExtraData", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "ExtraData", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("AzureApiManagementRepositoryKey.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/buildkite/v1/buildkite.go b/pkg/detectors/buildkite/v1/buildkite.goindex 3a98936ee..b7ccfe09a 100644--- a/pkg/detectors/buildkite/v1/buildkite.go+++ b/pkg/detectors/buildkite/v1/buildkite.go@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.ExtraData = extraDataif isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/buildkite/v2/buildkite.go b/pkg/detectors/buildkite/v2/buildkite.goindex aadd5e1e4..666e515e3 100644--- a/pkg/detectors/buildkite/v2/buildkite.go+++ b/pkg/detectors/buildkite/v2/buildkite.go@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.ExtraData = extraDataif isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/coinbase/coinbase.go b/pkg/detectors/coinbase/coinbase.goindex fc368d5dc..d446dd87c 100644--- a/pkg/detectors/coinbase/coinbase.go+++ b/pkg/detectors/coinbase/coinbase.go@@ -113,7 +113,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr, resPrivateKey)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key_name": resKeyName,"key": resPrivateKey,}diff --git a/pkg/detectors/databrickstoken/databrickstoken.go b/pkg/detectors/databrickstoken/databrickstoken.goindex 6cb73fcca..82fdccb17 100644--- a/pkg/detectors/databrickstoken/databrickstoken.go+++ b/pkg/detectors/databrickstoken/databrickstoken.go@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"token": token,"domain": domain,}diff --git a/pkg/detectors/databrickstoken/databrickstoken_integration_test.go b/pkg/detectors/databrickstoken/databrickstoken_integration_test.goindex bf4897f2f..ada42f8aa 100644--- a/pkg/detectors/databrickstoken/databrickstoken_integration_test.go+++ b/pkg/detectors/databrickstoken/databrickstoken_integration_test.go@@ -138,7 +138,7 @@ func TestDatabricksToken_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("DatabricksToken.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/datadogapikey/datadogapikey.go b/pkg/detectors/datadogapikey/datadogapikey.goindex fefd472f9..fca937d1b 100644--- a/pkg/detectors/datadogapikey/datadogapikey.go+++ b/pkg/detectors/datadogapikey/datadogapikey.go@@ -74,7 +74,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, verificationErr := verifyMatch(ctx, client, resApiMatch, baseURL)if isVerified {s1.Verified = isVerified- s1.AnalysisInfo = map[string]string{"api_key": resApiMatch, "endpoint": baseURL}+ s1.SecretParts = map[string]string{"api_key": resApiMatch, "endpoint": baseURL}// break the loop once we've successfully validated the token against a baseURLbreak}diff --git a/pkg/detectors/datadogapikey/datadogapikey_integration_test.go b/pkg/detectors/datadogapikey/datadogapikey_integration_test.goindex f1baa04c9..d180f9395 100644--- a/pkg/detectors/datadogapikey/datadogapikey_integration_test.go+++ b/pkg/detectors/datadogapikey/datadogapikey_integration_test.go@@ -50,7 +50,7 @@ func TestDataDogApiKey_FromChunk(t *testing.T) {{DetectorType: detector_typepb.DetectorType_DatadogApikey,Verified: true,- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"api_key": apiKey,"endpoint": datdogEndpoint,},diff --git a/pkg/detectors/datadogtoken/datadogtoken.go b/pkg/detectors/datadogtoken/datadogtoken.goindex 0996092b0..f5e9e68ea 100644--- a/pkg/detectors/datadogtoken/datadogtoken.go+++ b/pkg/detectors/datadogtoken/datadogtoken.go@@ -142,7 +142,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultdefer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {s1.Verified = true- s1.AnalysisInfo = map[string]string{"api_key": resApiMatch, "app_key": resAppMatch, "endpoint": baseURL}+ s1.SecretParts = map[string]string{"api_key": resApiMatch, "app_key": resAppMatch, "endpoint": baseURL}var serviceResponse userServiceResponseif err := json.NewDecoder(res.Body).Decode(&serviceResponse); err == nil {// setup emailsdiff --git a/pkg/detectors/datadogtoken/datadogtoken_integration_test.go b/pkg/detectors/datadogtoken/datadogtoken_integration_test.goindex 7593b1ed7..e33450919 100644--- a/pkg/detectors/datadogtoken/datadogtoken_integration_test.go+++ b/pkg/detectors/datadogtoken/datadogtoken_integration_test.go@@ -55,7 +55,7 @@ func TestDatadogToken_FromChunk(t *testing.T) {ExtraData: map[string]string{"Type": "Application+APIKey",},- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"api_key": apiKey,"app_key": appKey,"endpoint": endpoint,diff --git a/pkg/detectors/deepseek/deepseek_integration_test.go b/pkg/detectors/deepseek/deepseek_integration_test.goindex 403fd8cc3..d91a19519 100644--- a/pkg/detectors/deepseek/deepseek_integration_test.go+++ b/pkg/detectors/deepseek/deepseek_integration_test.go@@ -126,7 +126,7 @@ func TestDeepseek_FromChunk(t *testing.T) {}}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Deepseek.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/detectors.go b/pkg/detectors/detectors.goindex 4507510a5..f15c2956e 100644--- a/pkg/detectors/detectors.go+++ b/pkg/detectors/detectors.go@@ -119,10 +119,11 @@ type Result struct {// 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+ // SecretParts holds the individual components of a (potentially multi-part)+ // credential, keyed by a component name. It is used by analyzers where+ // the keys are analyzer specific and should match what the+ // corresponding analyzer expects.+ SecretParts map[string]string// primarySecret is used when a detector has multiple secret patterns.// This secret is designated to determine the line number.diff --git a/pkg/detectors/digitaloceantoken/digitaloceantoken.go b/pkg/detectors/digitaloceantoken/digitaloceantoken.goindex f56c2dec3..e60fd3df8 100644--- a/pkg/detectors/digitaloceantoken/digitaloceantoken.go+++ b/pkg/detectors/digitaloceantoken/digitaloceantoken.go@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": token,}}diff --git a/pkg/detectors/digitaloceantoken/digitaloceantoken_integration_test.go b/pkg/detectors/digitaloceantoken/digitaloceantoken_integration_test.goindex e2ba4c825..87f5eddb8 100644--- a/pkg/detectors/digitaloceantoken/digitaloceantoken_integration_test.go+++ b/pkg/detectors/digitaloceantoken/digitaloceantoken_integration_test.go@@ -119,7 +119,7 @@ func TestDigitalOceanToken_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("DigitalOceanToken.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/digitaloceanv2/digitaloceanv2.go b/pkg/detectors/digitaloceanv2/digitaloceanv2.goindex 0d44dedbb..b42117fe2 100644--- a/pkg/detectors/digitaloceanv2/digitaloceanv2.go+++ b/pkg/detectors/digitaloceanv2/digitaloceanv2.go@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr)s1.Verified = verifiedif s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": newAccessToken,}}@@ -73,7 +73,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = verifieds1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": token,}}diff --git a/pkg/detectors/digitaloceanv2/digitaloceanv2_integration_test.go b/pkg/detectors/digitaloceanv2/digitaloceanv2_integration_test.goindex 334b67d91..abd4b1e85 100644--- a/pkg/detectors/digitaloceanv2/digitaloceanv2_integration_test.go+++ b/pkg/detectors/digitaloceanv2/digitaloceanv2_integration_test.go@@ -116,7 +116,7 @@ func TestDigitalOceanV2_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("DigitalOceanV2.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/dockerhub/v1/dockerhub.go b/pkg/detectors/dockerhub/v1/dockerhub.goindex 139ee46f6..e29ce4c23 100644--- a/pkg/detectors/dockerhub/v1/dockerhub.go+++ b/pkg/detectors/dockerhub/v1/dockerhub.go@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.ExtraData = extraDatas1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"username": username,"pat": token,}diff --git a/pkg/detectors/dockerhub/v2/dockerhub.go b/pkg/detectors/dockerhub/v2/dockerhub.goindex 17a7e80f5..4f55f6fa9 100644--- a/pkg/detectors/dockerhub/v2/dockerhub.go+++ b/pkg/detectors/dockerhub/v2/dockerhub.go@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.ExtraData = extraDatas1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"username": username,"pat": token,}diff --git a/pkg/detectors/dockerhub/v2/dockerhub_integration_test.go b/pkg/detectors/dockerhub/v2/dockerhub_integration_test.goindex 65631b6a2..a1fa7ec5f 100644--- a/pkg/detectors/dockerhub/v2/dockerhub_integration_test.go+++ b/pkg/detectors/dockerhub/v2/dockerhub_integration_test.go@@ -54,7 +54,7 @@ func TestDockerhub_FromChunk(t *testing.T) {{DetectorType: detector_typepb.DetectorType_Dockerhub,Verified: true,- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"username": username,"pat": pat,},@@ -74,7 +74,7 @@ func TestDockerhub_FromChunk(t *testing.T) {{DetectorType: detector_typepb.DetectorType_Dockerhub,Verified: true,- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"username": strings.Split(email, "-")[0],"pat": pat,},diff --git a/pkg/detectors/dropbox/dropbox.go b/pkg/detectors/dropbox/dropbox.goindex 4ee788e14..82438c8da 100644--- a/pkg/detectors/dropbox/dropbox.go+++ b/pkg/detectors/dropbox/dropbox.go@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{"token": key}+ s1.SecretParts = map[string]string{"token": key}}}diff --git a/pkg/detectors/elevenlabs/v1/elevenlabs.go b/pkg/detectors/elevenlabs/v1/elevenlabs.goindex cab39021b..7a559f769 100644--- a/pkg/detectors/elevenlabs/v1/elevenlabs.go+++ b/pkg/detectors/elevenlabs/v1/elevenlabs.go@@ -76,7 +76,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/elevenlabs/v2/elevenlabs.go b/pkg/detectors/elevenlabs/v2/elevenlabs.goindex 31b29c4b0..b7279f2bd 100644--- a/pkg/detectors/elevenlabs/v2/elevenlabs.go+++ b/pkg/detectors/elevenlabs/v2/elevenlabs.go@@ -73,7 +73,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/elevenlabs/v2/elevenlabs_integration_test.go b/pkg/detectors/elevenlabs/v2/elevenlabs_integration_test.goindex 5c201123c..7584d64f2 100644--- a/pkg/detectors/elevenlabs/v2/elevenlabs_integration_test.go+++ b/pkg/detectors/elevenlabs/v2/elevenlabs_integration_test.go@@ -150,7 +150,7 @@ func TestElevenlabs_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Elevenlabs.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.goindex bb82ce6cf..639fa85b1 100644--- a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go+++ b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken_integration_test.go b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken_integration_test.goindex b2974a692..ea723d475 100644--- a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken_integration_test.go+++ b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken_integration_test.go@@ -102,7 +102,7 @@ func TestFastlyPersonalToken_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("FastlyPersonalToken.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go b/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.goindex 5425874d9..4a6558eab 100644--- a/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go+++ b/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go@@ -76,7 +76,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(err, resMatch)}if s1.Verified {- s1.AnalysisInfo = map[string]string{"token": resMatch}+ s1.SecretParts = map[string]string{"token": resMatch}}}diff --git a/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go b/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.goindex 21da20e19..061e82e81 100644--- a/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go+++ b/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go@@ -80,7 +80,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(err, resMatch)}if s1.Verified {- s1.AnalysisInfo = map[string]string{"token": resMatch}+ s1.SecretParts = map[string]string{"token": resMatch}}}diff --git a/pkg/detectors/flyio/flyio_integration_test.go b/pkg/detectors/flyio/flyio_integration_test.goindex 128afcc65..aacacbb23 100644--- a/pkg/detectors/flyio/flyio_integration_test.go+++ b/pkg/detectors/flyio/flyio_integration_test.go@@ -138,7 +138,7 @@ func TestFlyio_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")ignoreUnexported := cmpopts.IgnoreUnexported(detectors.Result{})if diff := cmp.Diff(got, tt.want, ignoreOpts, ignoreUnexported); diff != "" {t.Errorf("Flyio.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/gcp/gcp.go b/pkg/detectors/gcp/gcp.goindex 73582fea6..dc911d80b 100644--- a/pkg/detectors/gcp/gcp.go+++ b/pkg/detectors/gcp/gcp.go@@ -118,7 +118,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result"rotation_guide": "https://howtorotate.com/docs/tutorials/gcp/","project": creds.ProjectID,},- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"key": string(credBytes),},}@@ -149,7 +149,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}if creds.Type != "" {- result.AnalysisInfo["type"] = creds.Type+ result.SecretParts["type"] = creds.Type}if verify {diff --git a/pkg/detectors/gcp/gcp_integration_test.go b/pkg/detectors/gcp/gcp_integration_test.goindex a004334ca..9fa2ac5f1 100644--- a/pkg/detectors/gcp/gcp_integration_test.go+++ b/pkg/detectors/gcp/gcp_integration_test.go@@ -133,7 +133,7 @@ func TestGCP_FromChunk(t *testing.T) {}got[i].Raw = nil}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "SecretParts")ignoreUnexported := cmpopts.IgnoreUnexported(detectors.Result{})if diff := cmp.Diff(got, tt.want, ignoreOpts, ignoreUnexported); diff != "" {t.Errorf("GCP.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/github/v1/github_old.go b/pkg/detectors/github/v1/github_old.goindex 86849f58d..f907b36f3 100644--- a/pkg/detectors/github/v1/github_old.go+++ b/pkg/detectors/github/v1/github_old.go@@ -123,7 +123,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result"rotation_guide": "https://howtorotate.com/docs/tutorials/github/","version": fmt.Sprintf("%d", s.Version()),},- AnalysisInfo: map[string]string{"key": token},+ SecretParts: map[string]string{"key": token},}if verify {diff --git a/pkg/detectors/github/v2/github.go b/pkg/detectors/github/v2/github.goindex 87dab43e3..bd3581237 100644--- a/pkg/detectors/github/v2/github.go+++ b/pkg/detectors/github/v2/github.go@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result"rotation_guide": "https://howtorotate.com/docs/tutorials/github/","version": fmt.Sprintf("%d", s.Version()),},- AnalysisInfo: map[string]string{"key": token},+ SecretParts: map[string]string{"key": token},}if verify {diff --git a/pkg/detectors/github/v2/github_integration_test.go b/pkg/detectors/github/v2/github_integration_test.goindex c4d8db1aa..61861f569 100644--- a/pkg/detectors/github/v2/github_integration_test.go+++ b/pkg/detectors/github/v2/github_integration_test.go@@ -217,7 +217,7 @@ func TestGitHub_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("GitHub.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/gitlab/v1/gitlab.go b/pkg/detectors/gitlab/v1/gitlab.goindex 82f95567d..793a44de1 100644--- a/pkg/detectors/gitlab/v1/gitlab.go+++ b/pkg/detectors/gitlab/v1/gitlab.go@@ -99,7 +99,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result// for verified keys set the analysis infoif s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,"host": endpoint,}diff --git a/pkg/detectors/gitlab/v1/gitlab_integration_test.go b/pkg/detectors/gitlab/v1/gitlab_integration_test.goindex 4c12fdf43..5a4d82307 100644--- a/pkg/detectors/gitlab/v1/gitlab_integration_test.go+++ b/pkg/detectors/gitlab/v1/gitlab_integration_test.go@@ -189,7 +189,7 @@ func TestGitlab_FromChunk(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {@@ -287,7 +287,7 @@ func TestGitlab_FromChunk_WithV2Secrets(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError")if diff := cmp.Diff(got, tt.want, opts); diff != "" {@@ -381,7 +381,7 @@ func TestGitlab_FromChunk_WithV3Secrets(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {diff --git a/pkg/detectors/gitlab/v2/gitlab_integration_test.go b/pkg/detectors/gitlab/v2/gitlab_integration_test.goindex 6fe881c79..beb684395 100644--- a/pkg/detectors/gitlab/v2/gitlab_integration_test.go+++ b/pkg/detectors/gitlab/v2/gitlab_integration_test.go@@ -101,7 +101,7 @@ func TestGitlabV2_FromChunk_WithV1Secrets(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {@@ -195,7 +195,7 @@ func TestGitlabV2_FromChunk_WithV3Secrets(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {@@ -374,7 +374,7 @@ func TestGitlabV2_FromChunk(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {diff --git a/pkg/detectors/gitlab/v2/gitlab_v2.go b/pkg/detectors/gitlab/v2/gitlab_v2.goindex 1ffca2334..8fcedad2e 100644--- a/pkg/detectors/gitlab/v2/gitlab_v2.go+++ b/pkg/detectors/gitlab/v2/gitlab_v2.go@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result// for verified keys set the analysis infoif s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,"host": endpoint,}diff --git a/pkg/detectors/gitlab/v3/gitlab_v3.go b/pkg/detectors/gitlab/v3/gitlab_v3.goindex b9c21022e..1972b6185 100644--- a/pkg/detectors/gitlab/v3/gitlab_v3.go+++ b/pkg/detectors/gitlab/v3/gitlab_v3.go@@ -83,7 +83,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result// for verified keys set the analysis infoif s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,"host": endpoint,}diff --git a/pkg/detectors/gitlab/v3/gitlab_v3_integration_test.go b/pkg/detectors/gitlab/v3/gitlab_v3_integration_test.goindex 81c6b4119..3db44ae0a 100644--- a/pkg/detectors/gitlab/v3/gitlab_v3_integration_test.go+++ b/pkg/detectors/gitlab/v3/gitlab_v3_integration_test.go@@ -170,7 +170,7 @@ func TestGitlabV3_FromChunk(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {@@ -280,7 +280,7 @@ func TestGitlabV3_FromChunk_WithV1Secrets(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "primarySecret")if diff := cmp.Diff(got, tt.want, opts); diff != "" {@@ -362,7 +362,7 @@ func TestGitlabV3_FromChunk_WithV2Secrets(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v,", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}opts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError")if diff := cmp.Diff(got, tt.want, opts); diff != "" {diff --git a/pkg/detectors/groq/groq.go b/pkg/detectors/groq/groq.goindex 3b3772f82..044817221 100644--- a/pkg/detectors/groq/groq.go+++ b/pkg/detectors/groq/groq.go@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/harness/harness.go b/pkg/detectors/harness/harness.goindex 115aa69b4..5ff241688 100644--- a/pkg/detectors/harness/harness.go+++ b/pkg/detectors/harness/harness.go@@ -74,7 +74,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/huggingface/huggingface.go b/pkg/detectors/huggingface/huggingface.goindex 30e9cffcd..9690d9f77 100644--- a/pkg/detectors/huggingface/huggingface.go+++ b/pkg/detectors/huggingface/huggingface.go@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.ExtraData = extraDatas1.SetVerificationError(verificationErr, resMatch)- s1.AnalysisInfo = map[string]string{"key": resMatch}+ s1.SecretParts = map[string]string{"key": resMatch}}results = append(results, s1)diff --git a/pkg/detectors/huggingface/huggingface_integration_test.go b/pkg/detectors/huggingface/huggingface_integration_test.goindex 656af98a1..d5f1d130d 100644--- a/pkg/detectors/huggingface/huggingface_integration_test.go+++ b/pkg/detectors/huggingface/huggingface_integration_test.go@@ -190,7 +190,7 @@ func TestHuggingface_FromChunk(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf(" wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {diff --git a/pkg/detectors/jdbc/jdbc.go b/pkg/detectors/jdbc/jdbc.goindex df90917e6..cb9816f46 100644--- a/pkg/detectors/jdbc/jdbc.go+++ b/pkg/detectors/jdbc/jdbc.go@@ -102,7 +102,7 @@ matchLoop:err = pingRes.errresult.SetVerificationError(err, jdbcConn)}- result.AnalysisInfo = map[string]string{+ result.SecretParts = map[string]string{"connection_string": jdbcConn,}// TODO: specialized redactiondiff --git a/pkg/detectors/jdbc/jdbc_integration_test.go b/pkg/detectors/jdbc/jdbc_integration_test.goindex db5709af9..f20b2a1fd 100644--- a/pkg/detectors/jdbc/jdbc_integration_test.go+++ b/pkg/detectors/jdbc/jdbc_integration_test.go@@ -125,7 +125,7 @@ func TestJdbcVerified(t *testing.T) {Verified: true,Redacted: fmt.Sprintf("jdbc:postgresql://%s:%s/%s?sslmode=disable&password=%s&user=%s",postgresHost, postgresPort.Port(), postgresDB, strings.Repeat("*", len(postgresPass)), postgresUser),- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"connection_string": fmt.Sprintf("jdbc:postgresql://%s:%s/%s?sslmode=disable&password=%s&user=%s",postgresHost, postgresPort.Port(), postgresDB, postgresPass, postgresUser),},@@ -147,7 +147,7 @@ func TestJdbcVerified(t *testing.T) {Verified: true,Redacted: fmt.Sprintf(`jdbc:mysql://%s:%s@tcp(%s:%s)/%s`,mysqlUser, strings.Repeat("*", len(mysqlPass)), mysqlHost, mysqlPort.Port(), mysqlDatabase),- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"connection_string": fmt.Sprintf(`jdbc:mysql://%s:%s@tcp(%s:%s)/%s`,mysqlUser, mysqlPass, mysqlHost, mysqlPort.Port(), mysqlDatabase),},@@ -169,7 +169,7 @@ func TestJdbcVerified(t *testing.T) {Verified: true,Redacted: fmt.Sprintf("jdbc:sqlserver://odbc:server=%s;port=%s;database=%s;password=%s",sqlServerHost, sqlServerPort.Port(), sqlServerDatabase, strings.Repeat("*", len(sqlServerPass))),- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"connection_string": fmt.Sprintf("jdbc:sqlserver://odbc:server=%s;port=%s;database=%s;password=%s",sqlServerHost, sqlServerPort.Port(), sqlServerDatabase, sqlServerPass),},@@ -322,7 +322,7 @@ func TestJdbc_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Jdbc.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/jiratoken/v1/jiratoken.go b/pkg/detectors/jiratoken/v1/jiratoken.goindex 560e9ed76..6b954ec19 100644--- a/pkg/detectors/jiratoken/v1/jiratoken.go+++ b/pkg/detectors/jiratoken/v1/jiratoken.go@@ -119,7 +119,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, token)}if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"token": token,"domain": domain,"email": email,diff --git a/pkg/detectors/jiratoken/v2/jiratoken_v2.go b/pkg/detectors/jiratoken/v2/jiratoken_v2.goindex 36ffead48..da7c2f6ef 100644--- a/pkg/detectors/jiratoken/v2/jiratoken_v2.go+++ b/pkg/detectors/jiratoken/v2/jiratoken_v2.go@@ -91,7 +91,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = isVerifieds1.SetVerificationError(verificationErr, token)if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"token": token,"domain": domain,"email": email,diff --git a/pkg/detectors/launchdarkly/launchdarkly.go b/pkg/detectors/launchdarkly/launchdarkly.goindex ed71e30ba..4ecfca837 100644--- a/pkg/detectors/launchdarkly/launchdarkly.go+++ b/pkg/detectors/launchdarkly/launchdarkly.go@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result// only api keys can be analyzedif strings.HasPrefix(resMatch, "api-") {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/launchdarkly/launchdarkly_integration_test.go b/pkg/detectors/launchdarkly/launchdarkly_integration_test.goindex 7eb56352b..7aeeacc40 100644--- a/pkg/detectors/launchdarkly/launchdarkly_integration_test.go+++ b/pkg/detectors/launchdarkly/launchdarkly_integration_test.go@@ -129,7 +129,7 @@ func TestLaunchDarkly_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil// Do we expect to be comparing the ExtraData?got[i].ExtraData = nildiff --git a/pkg/detectors/mailchimp/mailchimp.go b/pkg/detectors/mailchimp/mailchimp.goindex 85896b6a0..84f862ce7 100644--- a/pkg/detectors/mailchimp/mailchimp.go+++ b/pkg/detectors/mailchimp/mailchimp.go@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultresult.Verified = true}}- result.AnalysisInfo = map[string]string{+ result.SecretParts = map[string]string{"key": match,}}diff --git a/pkg/detectors/mailchimp/mailchimp_integration_test.go b/pkg/detectors/mailchimp/mailchimp_integration_test.goindex 5fadc6ed6..864ec1141 100644--- a/pkg/detectors/mailchimp/mailchimp_integration_test.go+++ b/pkg/detectors/mailchimp/mailchimp_integration_test.go@@ -93,7 +93,7 @@ func TestMailchimp_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nilgot[i].ExtraData = nil}if diff := pretty.Compare(got, tt.want); diff != "" {diff --git a/pkg/detectors/mailgun/mailgun.go b/pkg/detectors/mailgun/mailgun.goindex 8e1734365..9a3ba6ed2 100644--- a/pkg/detectors/mailgun/mailgun.go+++ b/pkg/detectors/mailgun/mailgun.go@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1 := detectors.Result{DetectorType: s.Type(),Raw: []byte(match),- AnalysisInfo: map[string]string{"key": match},+ SecretParts: map[string]string{"key": match},}if verify {diff --git a/pkg/detectors/mailgun/mailgun_integration_test.go b/pkg/detectors/mailgun/mailgun_integration_test.goindex 4446bf710..7dfb4c126 100644--- a/pkg/detectors/mailgun/mailgun_integration_test.go+++ b/pkg/detectors/mailgun/mailgun_integration_test.go@@ -129,7 +129,7 @@ func TestMailgun_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nilgot[i].ExtraData = nil}if diff := pretty.Compare(got, tt.want); diff != "" {diff --git a/pkg/detectors/monday/monday.go b/pkg/detectors/monday/monday.goindex ed53d040b..37e354f97 100644--- a/pkg/detectors/monday/monday.go+++ b/pkg/detectors/monday/monday.go@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/monday/monday_integration_test.go b/pkg/detectors/monday/monday_integration_test.goindex 3c32b4416..5be60129a 100644--- a/pkg/detectors/monday/monday_integration_test.go+++ b/pkg/detectors/monday/monday_integration_test.go@@ -95,7 +95,7 @@ func TestMonday_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Monday.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/mongodb/mongodb.go b/pkg/detectors/mongodb/mongodb.goindex f69f5a59b..604d8bdb8 100644--- a/pkg/detectors/mongodb/mongodb.go+++ b/pkg/detectors/mongodb/mongodb.go@@ -104,7 +104,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultr.SetVerificationError(vErr, password)if isVerified {- r.AnalysisInfo = map[string]string{+ r.SecretParts = map[string]string{"key": connStr,}}diff --git a/pkg/detectors/mux/mux.go b/pkg/detectors/mux/mux.goindex 89fb6491e..3f0781fcc 100644--- a/pkg/detectors/mux/mux.go+++ b/pkg/detectors/mux/mux.go@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}}if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,"secret": resSecretMatch,}diff --git a/pkg/detectors/netlify/v1/netlify_v1.go b/pkg/detectors/netlify/v1/netlify_v1.goindex b4863c98b..aeedae839 100644--- a/pkg/detectors/netlify/v1/netlify_v1.go+++ b/pkg/detectors/netlify/v1/netlify_v1.go@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{"key": match}+ s1.SecretParts = map[string]string{"key": match}}}diff --git a/pkg/detectors/netlify/v1/netlify_v1_integration_test.go b/pkg/detectors/netlify/v1/netlify_v1_integration_test.goindex 51a814793..b0a683f71 100644--- a/pkg/detectors/netlify/v1/netlify_v1_integration_test.go+++ b/pkg/detectors/netlify/v1/netlify_v1_integration_test.go@@ -103,7 +103,7 @@ func TestNetlify_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Netlify.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/netlify/v2/netlify_v2.go b/pkg/detectors/netlify/v2/netlify_v2.goindex 3baf0a58b..63edf985e 100644--- a/pkg/detectors/netlify/v2/netlify_v2.go+++ b/pkg/detectors/netlify/v2/netlify_v2.go@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, match)if s1.Verified {- s1.AnalysisInfo = map[string]string{"key": match}+ s1.SecretParts = map[string]string{"key": match}}}diff --git a/pkg/detectors/netlify/v2/netlify_v2_integration_test.go b/pkg/detectors/netlify/v2/netlify_v2_integration_test.goindex b141d7622..359c23594 100644--- a/pkg/detectors/netlify/v2/netlify_v2_integration_test.go+++ b/pkg/detectors/netlify/v2/netlify_v2_integration_test.go@@ -103,7 +103,7 @@ func TestNetlify_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Netlify.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/ngrok/ngrok.go b/pkg/detectors/ngrok/ngrok.goindex 6361aa141..d653aac45 100644--- a/pkg/detectors/ngrok/ngrok.go+++ b/pkg/detectors/ngrok/ngrok.go@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultr.Verified = isVerifiedr.SetVerificationError(vErr, token)if isVerified {- r.AnalysisInfo = map[string]string{"key": token}+ r.SecretParts = map[string]string{"key": token}}}diff --git a/pkg/detectors/notion/notion.go b/pkg/detectors/notion/notion.goindex 3e80ff110..e7a2d751d 100644--- a/pkg/detectors/notion/notion.go+++ b/pkg/detectors/notion/notion.go@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result// Notion returns 401 for all non-valid keys, thus 403 indicates it has fine-tuned permissions,// /v1/search, /v1/databases/*, etc. may work.s1.Verified = true- s1.AnalysisInfo = map[string]string{"key": resMatch}+ s1.SecretParts = map[string]string{"key": resMatch}}} else {diff --git a/pkg/detectors/npmtoken/npmtoken.go b/pkg/detectors/npmtoken/npmtoken.goindex 8b96490ad..9f4e95750 100644--- a/pkg/detectors/npmtoken/npmtoken.go+++ b/pkg/detectors/npmtoken/npmtoken.go@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultdefer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {s1.Verified = true- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/npmtokenv2/npmtokenv2.go b/pkg/detectors/npmtokenv2/npmtokenv2.goindex f08d73a86..1a6e36fc4 100644--- a/pkg/detectors/npmtokenv2/npmtokenv2.go+++ b/pkg/detectors/npmtokenv2/npmtokenv2.go@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultdefer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {s1.Verified = true- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/openai/openai.go b/pkg/detectors/openai/openai.goindex dbb6233cb..2fdd52659 100644--- a/pkg/detectors/openai/openai.go+++ b/pkg/detectors/openai/openai.go@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = verifieds1.ExtraData = extraDatas1.SetVerificationError(verificationErr)- s1.AnalysisInfo = map[string]string{"key": token}+ s1.SecretParts = map[string]string{"key": token}}results = append(results, s1)diff --git a/pkg/detectors/openai/openai_integration_test.go b/pkg/detectors/openai/openai_integration_test.goindex 07b548f3a..0221dabba 100644--- a/pkg/detectors/openai/openai_integration_test.go+++ b/pkg/detectors/openai/openai_integration_test.go@@ -100,7 +100,7 @@ func TestOpenAI_FromChunk(t *testing.T) {}got[i].Raw = nilgot[i].ExtraData = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("OpenAI.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/openaiadmin/openaiadmin.go b/pkg/detectors/openaiadmin/openaiadmin.goindex 5b210b9d2..f6d959d4f 100644--- a/pkg/detectors/openaiadmin/openaiadmin.go+++ b/pkg/detectors/openaiadmin/openaiadmin.go@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, verificationErr := verifyMatch(ctx, client, token)s1.Verified = isVerifieds1.SetVerificationError(verificationErr, token)- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": token,}}diff --git a/pkg/detectors/openaiadmin/openaiadmin_integration_test.go b/pkg/detectors/openaiadmin/openaiadmin_integration_test.goindex 69769d262..8483194f5 100644--- a/pkg/detectors/openaiadmin/openaiadmin_integration_test.go+++ b/pkg/detectors/openaiadmin/openaiadmin_integration_test.go@@ -136,7 +136,7 @@ func TestOpenAIAdmin_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo", "Redacted")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts", "Redacted")ignoreUnexported := cmpopts.IgnoreUnexported(detectors.Result{})if diff := cmp.Diff(got, tt.want, ignoreOpts, ignoreUnexported); diff != "" {t.Errorf("OpenAIAdmin.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/opsgenie/opsgenie.go b/pkg/detectors/opsgenie/opsgenie.goindex afbc5b4ab..2d84c1a4e 100644--- a/pkg/detectors/opsgenie/opsgenie.go+++ b/pkg/detectors/opsgenie/opsgenie.go@@ -76,7 +76,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif isVerified {r.Verified = isVerifiedr.ExtraData = extraData- r.AnalysisInfo = map[string]string{+ r.SecretParts = map[string]string{"key": key,}}diff --git a/pkg/detectors/opsgenie/opsgenie_integration_test.go b/pkg/detectors/opsgenie/opsgenie_integration_test.goindex 6aeacad3b..598496663 100644--- a/pkg/detectors/opsgenie/opsgenie_integration_test.go+++ b/pkg/detectors/opsgenie/opsgenie_integration_test.go@@ -99,7 +99,7 @@ func TestOpsgenie_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Opsgenie.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/plaidkey/plaidkey.go b/pkg/detectors/plaidkey/plaidkey.goindex cf581a4ac..ff5e5f96d 100644--- a/pkg/detectors/plaidkey/plaidkey.go+++ b/pkg/detectors/plaidkey/plaidkey.go@@ -88,7 +88,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.ExtraData = map[string]string{"environment": fmt.Sprintf("https://%s.plaid.com", environment)}s1.SetVerificationError(verificationErr, id, secret)if s1.Verified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"secret": secret,"id": id,"token": token,diff --git a/pkg/detectors/plaidkey/plaidkey_integration_test.go b/pkg/detectors/plaidkey/plaidkey_integration_test.goindex 6dfd88dd2..ad377138a 100644--- a/pkg/detectors/plaidkey/plaidkey_integration_test.go+++ b/pkg/detectors/plaidkey/plaidkey_integration_test.go@@ -55,7 +55,7 @@ func TestPlaidKey_FromChunk(t *testing.T) {DetectorType: detector_typepb.DetectorType_PlaidKey,Verified: true,RawV2: []byte(fmt.Sprintf("%s:%s:%s", secret, id, token)),- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"secret": secret,"id": id,"token": token,@@ -115,7 +115,7 @@ func TestPlaidKey_FromChunk(t *testing.T) {t.Fatalf("no raw v2 secret present: \n %+v", got[i])}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo", "ExtraData")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts", "ExtraData")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("PlaidKey.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/planetscale/planetscale.go b/pkg/detectors/planetscale/planetscale.goindex de73b69c3..bc50e00f1 100644--- a/pkg/detectors/planetscale/planetscale.go+++ b/pkg/detectors/planetscale/planetscale.go@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultdefer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {s1.Verified = true- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"id": username,"token": password,}diff --git a/pkg/detectors/planetscale/planetscale_integration_test.go b/pkg/detectors/planetscale/planetscale_integration_test.goindex d0f4e263f..4fa08a7c2 100644--- a/pkg/detectors/planetscale/planetscale_integration_test.go+++ b/pkg/detectors/planetscale/planetscale_integration_test.go@@ -139,7 +139,7 @@ func TestPlanetscale_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "AnalysisInfo", "ExtraData")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "SecretParts", "ExtraData")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Planetscale.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/postgres/postgres.go b/pkg/detectors/postgres/postgres.goindex 88e66a24d..7f5fd0db6 100644--- a/pkg/detectors/postgres/postgres.go+++ b/pkg/detectors/postgres/postgres.go@@ -164,7 +164,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) ([]deteisVerified, verificationErr := verifyPostgres(params)result.Verified = isVerifiedresult.SetVerificationError(verificationErr, password)- result.AnalysisInfo = map[string]string{+ result.SecretParts = map[string]string{"connection_string": string(raw),}}diff --git a/pkg/detectors/postgres/postgres_integration_test.go b/pkg/detectors/postgres/postgres_integration_test.goindex ea0d3c9e0..d78b5cc7d 100644--- a/pkg/detectors/postgres/postgres_integration_test.go+++ b/pkg/detectors/postgres/postgres_integration_test.go@@ -335,7 +335,7 @@ func TestPostgres_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.want[i].VerificationError(), got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Postgres.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/posthog/posthog.go b/pkg/detectors/posthog/posthog.goindex 8f923304e..157d61c5b 100644--- a/pkg/detectors/posthog/posthog.go+++ b/pkg/detectors/posthog/posthog.go@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultdefer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {s1.Verified = true- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}} else if res.StatusCode == 401 {@@ -69,7 +69,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultdefer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {s1.Verified = true- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/postman/postman.go b/pkg/detectors/postman/postman.goindex 3dde114d4..b4540d219 100644--- a/pkg/detectors/postman/postman.go+++ b/pkg/detectors/postman/postman.go@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, verificationErr := verifyPostman(ctx, client, resMatch)s1.Verified = isVerifieds1.SetVerificationError(verificationErr, resMatch)- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/postman/postman_integration_test.go b/pkg/detectors/postman/postman_integration_test.goindex b51761ccd..927880f8c 100644--- a/pkg/detectors/postman/postman_integration_test.go+++ b/pkg/detectors/postman/postman_integration_test.go@@ -133,7 +133,7 @@ func TestPostman_FromChunk(t *testing.T) {t.Errorf("Postman.FromData() error = %v, wantErr %v", got[i].VerificationError(), tt.wantVerificationErr)}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Postman.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/postmark/postmark.go b/pkg/detectors/postmark/postmark.goindex 259214af3..b3d2b9c09 100644--- a/pkg/detectors/postmark/postmark.go+++ b/pkg/detectors/postmark/postmark.go@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(err)if valid {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": resMatch,}}diff --git a/pkg/detectors/privatekey/privatekey.go b/pkg/detectors/privatekey/privatekey.goindex 39b1d7999..a345933ae 100644--- a/pkg/detectors/privatekey/privatekey.go+++ b/pkg/detectors/privatekey/privatekey.go@@ -154,7 +154,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}// enabled th- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"token": token,}} else {diff --git a/pkg/detectors/privatekey/privatekey_integration_test.go b/pkg/detectors/privatekey/privatekey_integration_test.goindex 965ee12e0..d092fd3fc 100644--- a/pkg/detectors/privatekey/privatekey_integration_test.go+++ b/pkg/detectors/privatekey/privatekey_integration_test.go@@ -154,7 +154,7 @@ func TestPrivatekey_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("PrivatekeyCI.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/salesforceoauth2/salesforceoauth2.go b/pkg/detectors/salesforceoauth2/salesforceoauth2.goindex f1ba80ea9..dfd995188 100644--- a/pkg/detectors/salesforceoauth2/salesforceoauth2.go+++ b/pkg/detectors/salesforceoauth2/salesforceoauth2.go@@ -107,7 +107,7 @@ domainLoop:}if isVerified {- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"domain": domain,"client_id": key,"client_secret": secret,diff --git a/pkg/detectors/sendgrid/sendgrid.go b/pkg/detectors/sendgrid/sendgrid.goindex 09f6e14e9..acb843104 100644--- a/pkg/detectors/sendgrid/sendgrid.go+++ b/pkg/detectors/sendgrid/sendgrid.go@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = verifieds1.ExtraData = extraDatas1.SetVerificationError(verificationErr)- s1.AnalysisInfo = map[string]string{"key": token}+ s1.SecretParts = map[string]string{"key": token}}results = append(results, s1)diff --git a/pkg/detectors/sendgrid/sendgrid_integration_test.go b/pkg/detectors/sendgrid/sendgrid_integration_test.goindex 7c35999c7..b6f7be359 100644--- a/pkg/detectors/sendgrid/sendgrid_integration_test.go+++ b/pkg/detectors/sendgrid/sendgrid_integration_test.go@@ -127,7 +127,7 @@ func TestSendgrid_FromChunk(t *testing.T) {t.Errorf("Sendgrid.FromData() error = %v, wantErr %v", err, tt.wantErr)return}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo", "ExtraData")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts", "ExtraData")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Sendgrid.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/shopify/shopify.go b/pkg/detectors/shopify/shopify.goindex 65ead3a05..6bd870926 100644--- a/pkg/detectors/shopify/shopify.go+++ b/pkg/detectors/shopify/shopify.go@@ -77,7 +77,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.ExtraData = map[string]string{"access_scopes": strings.Join(handleArray, ","),}- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": key,"store_url": domainRes,}diff --git a/pkg/detectors/shopify/shopify_integration_test.go b/pkg/detectors/shopify/shopify_integration_test.goindex 346688121..98ba451f9 100644--- a/pkg/detectors/shopify/shopify_integration_test.go+++ b/pkg/detectors/shopify/shopify_integration_test.go@@ -102,7 +102,7 @@ func TestShopify_FromChunk(t *testing.T) {t.Fatalf("no raw secret present: \n %+v", got[i])}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Shopify.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/shopifyoauth/shopifyoauth_integration_test.go b/pkg/detectors/shopifyoauth/shopifyoauth_integration_test.goindex 0971502e5..c100f8646 100644--- a/pkg/detectors/shopifyoauth/shopifyoauth_integration_test.go+++ b/pkg/detectors/shopifyoauth/shopifyoauth_integration_test.go@@ -154,7 +154,7 @@ func TestShopifyOAuth_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "AnalysisInfo", "primarySecret")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "SecretParts", "primarySecret")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("ShopifyOAuth.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/slack/slack.go b/pkg/detectors/slack/slack.goindex de112d257..1a5cb9513 100644--- a/pkg/detectors/slack/slack.go+++ b/pkg/detectors/slack/slack.go@@ -113,7 +113,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result} else {s1.SetVerificationError(err, token)}- s1.AnalysisInfo = map[string]string{+ s1.SecretParts = map[string]string{"key": token,}}diff --git a/pkg/detectors/slack/slack_integration_test.go b/pkg/detectors/slack/slack_integration_test.goindex 06788031f..204c1bae6 100644--- a/pkg/detectors/slack/slack_integration_test.go+++ b/pkg/detectors/slack/slack_integration_test.go@@ -179,7 +179,7 @@ func TestSlack_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nilif (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())diff --git a/pkg/detectors/sourcegraph/sourcegraph.go b/pkg/detectors/sourcegraph/sourcegraph.goindex 51d1253ae..53b1987c4 100644--- a/pkg/detectors/sourcegraph/sourcegraph.go+++ b/pkg/detectors/sourcegraph/sourcegraph.go@@ -78,7 +78,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result} else {s1.SetVerificationError(err, resMatch)}- s1.AnalysisInfo = map[string]string{"key": resMatch}+ s1.SecretParts = map[string]string{"key": resMatch}}results = append(results, s1)diff --git a/pkg/detectors/sourcegraph/sourcegraph_integration_test.go b/pkg/detectors/sourcegraph/sourcegraph_integration_test.goindex 5054c55c5..5e55b12d3 100644--- a/pkg/detectors/sourcegraph/sourcegraph_integration_test.go+++ b/pkg/detectors/sourcegraph/sourcegraph_integration_test.go@@ -226,7 +226,7 @@ func TestSourcegraph_FromChunk(t *testing.T) {if (got[i].VerificationError() != nil) != tt.wantVerificationErr {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "VerificationError", "ExtraData")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {diff --git a/pkg/detectors/square/square.go b/pkg/detectors/square/square.goindex bc79a312c..536191ba2 100644--- a/pkg/detectors/square/square.go+++ b/pkg/detectors/square/square.go@@ -77,7 +77,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultresult.Verified = true}}- result.AnalysisInfo = map[string]string{"key": resMatch}+ result.SecretParts = map[string]string{"key": resMatch}}results = append(results, result)diff --git a/pkg/detectors/square/square_integration_test.go b/pkg/detectors/square/square_integration_test.goindex 471a1ef51..03e3a1433 100644--- a/pkg/detectors/square/square_integration_test.go+++ b/pkg/detectors/square/square_integration_test.go@@ -95,7 +95,7 @@ func TestSquare_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Square.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/stripe/stripe.go b/pkg/detectors/stripe/stripe.goindex 605ca4045..807f5fa5e 100644--- a/pkg/detectors/stripe/stripe.go+++ b/pkg/detectors/stripe/stripe.go@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultresult.Verified = true}}- result.AnalysisInfo = map[string]string{"key": match}+ result.SecretParts = map[string]string{"key": match}}results = append(results, result)diff --git a/pkg/detectors/stripe/stripe_integration_test.go b/pkg/detectors/stripe/stripe_integration_test.goindex 471f83121..8135852b9 100644--- a/pkg/detectors/stripe/stripe_integration_test.go+++ b/pkg/detectors/stripe/stripe_integration_test.go@@ -100,7 +100,7 @@ func TestStripe_FromChunk(t *testing.T) {t.Fatal("no raw secret present")}got[i].Raw = nil- got[i].AnalysisInfo = nil+ got[i].SecretParts = nil}if diff := pretty.Compare(got, tt.want); diff != "" {t.Errorf("Stripe.FromData() %s diff: (-got +want)\n%s", tt.name, diff)diff --git a/pkg/detectors/tableau/tableau.go b/pkg/detectors/tableau/tableau.goindex 4bd7feec6..e0370aca0 100644--- a/pkg/detectors/tableau/tableau.go+++ b/pkg/detectors/tableau/tableau.go@@ -98,7 +98,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultmaps.Copy(result.ExtraData, extraData)result.SetVerificationError(verificationErr, tokenName, tokenSecret, endpoint)if isVerified {- result.AnalysisInfo = map[string]string{"token_name": tokenName, "pat_secret": tokenSecret, "endpoint": endpoint}+ result.SecretParts = map[string]string{"token_name": tokenName, "pat_secret": tokenSecret, "endpoint": endpoint}}}results = append(results, result)diff --git a/pkg/detectors/tableau/tableau_integration_test.go b/pkg/detectors/tableau/tableau_integration_test.goindex 7f45d4a2b..1ffd4d476 100644--- a/pkg/detectors/tableau/tableau_integration_test.go+++ b/pkg/detectors/tableau/tableau_integration_test.go@@ -69,7 +69,7 @@ func TestTableau_FromChunk(t *testing.T) {"verification_status": "valid","auth_token_received": "true",},- AnalysisInfo: map[string]string{+ SecretParts: map[string]string{"endpoint": tableauURL,"pat_secret": tokenSecret,"token_name": tokenName,@@ -299,7 +299,7 @@ func TestTableau_FromChunk_MultipleMixedVerificationResults(t *testing.T) {}}ignoreOpts := []cmp.Option{- cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "ExtraData", "AnalysisInfo"),+ cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "ExtraData", "SecretParts"),cmpopts.IgnoreUnexported(detectors.Result{}),}diff --git a/pkg/detectors/twilio/twilio.go b/pkg/detectors/twilio/twilio.goindex fe71ee263..aeaa09682 100644--- a/pkg/detectors/twilio/twilio.go+++ b/pkg/detectors/twilio/twilio.go@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}if s1.Verified {- s1.AnalysisInfo = map[string]string{"key": key, "sid": sid}+ s1.SecretParts = map[string]string{"key": key, "sid": sid}}}diff --git a/pkg/detectors/twilio/twilio_integration_test.go b/pkg/detectors/twilio/twilio_integration_test.goindex 5b67087eb..f5fae860d 100644--- a/pkg/detectors/twilio/twilio_integration_test.go+++ b/pkg/detectors/twilio/twilio_integration_test.go@@ -156,7 +156,7 @@ func TestTwilio_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Twilio.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/detectors/twilioapikey/twilioapikey.go b/pkg/detectors/twilioapikey/twilioapikey.goindex 6fed5c1b3..e686062be 100644--- a/pkg/detectors/twilioapikey/twilioapikey.go+++ b/pkg/detectors/twilioapikey/twilioapikey.go@@ -77,7 +77,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}if s1.Verified {- s1.AnalysisInfo = map[string]string{"key": apiKey, "sid": secret}+ s1.SecretParts = map[string]string{"key": apiKey, "sid": secret}}}diff --git a/pkg/detectors/twilioapikey/twilioapikey_integration_test.go b/pkg/detectors/twilioapikey/twilioapikey_integration_test.goindex ec15b84ad..ee6ad3a79 100644--- a/pkg/detectors/twilioapikey/twilioapikey_integration_test.go+++ b/pkg/detectors/twilioapikey/twilioapikey_integration_test.go@@ -110,7 +110,7 @@ func TestTwilioAPIKey_FromChunk(t *testing.T) {t.Fatalf("wantVerificationError = %v, verification error = %v", tt.wantVerificationErr, got[i].VerificationError())}}- ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "AnalysisInfo")+ ignoreOpts := cmpopts.IgnoreFields(detectors.Result{}, "Raw", "verificationError", "SecretParts")if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {t.Errorf("Twilio.FromData() %s diff: (-got +want)\n%s", tt.name, diff)}diff --git a/pkg/output/plain.go b/pkg/output/plain.goindex 62c08c506..04a9e216d 100644--- a/pkg/output/plain.go+++ b/pkg/output/plain.go@@ -102,7 +102,7 @@ func (p *PlainPrinter) Print(_ context.Context, r *detectors.ResultWithMetadata)}// if analysis info is not nil, means the detector added key for analyzer and result is verified- if r.Result.AnalysisInfo != nil && r.Result.Verified {+ if r.Result.SecretParts != nil && r.Result.Verified {printer.Printf("Analyze: Run `trufflehog analyze` to analyze this key's permissions\n")}