Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/detectors/tableau/tableau.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
result.Verified = isVerified
maps.Copy(result.ExtraData, extraData)
result.SetVerificationError(verificationErr, tokenName, tokenSecret, endpoint)
if isVerified {
result.AnalysisInfo = map[string]string{"tokenName": tokenName, "patSecret": tokenSecret, "endpoint": endpoint}
}
}
results = append(results, result)
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/detectors/tableau/tableau_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ func TestTableau_FromChunk(t *testing.T) {
"verification_status": "valid",
"auth_token_received": "true",
},
AnalysisInfo: map[string]string{
"endpoint": tableauURL,
"patSecret": tokenSecret,
"tokenName": tokenName,
},
},
},
wantErr: false,
Expand Down Expand Up @@ -254,7 +259,7 @@ func TestTableau_FromChunk(t *testing.T) {
}

ignoreOpts := []cmp.Option{
cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "ExtraData"),
cmpopts.IgnoreFields(detectors.Result{}, "Raw", "RawV2", "verificationError", "ExtraData", "AnalysisInfo"),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test ignores AnalysisInfo field rendering expected values useless

Medium Severity

The test adds expected AnalysisInfo values (lines 72-76) but then adds AnalysisInfo to cmpopts.IgnoreFields (line 262), which means the comparison will never verify these values. The expected AnalysisInfo is effectively dead code that provides false confidence the feature is tested. Other integration tests like dockerhub_integration_test.go either test AnalysisInfo properly (without ignoring it) or don't include expected values at all.

Additional Locations (1)

Fix in Cursor Fix in Web

cmpopts.IgnoreUnexported(detectors.Result{}),
}

Expand Down
Loading