Skip to content

Find, verify, and analyze leaked credentials

invert logic for sonarcloud (#487)

Dustin Decker335a5212a6dc
diff --git a/pkg/detectors/sonarcloud/sonarcloud.go b/pkg/detectors/sonarcloud/sonarcloud.go
index 253bf61b9..61f3964af 100644
--- a/pkg/detectors/sonarcloud/sonarcloud.go
+++ b/pkg/detectors/sonarcloud/sonarcloud.go
@@ -60,13 +60,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
bodyString := string(bodyBytes)
- validResponse := strings.Contains(bodyString, `"valid":false`)
+ validResponse := strings.Contains(bodyString, `"valid":true`)
defer res.Body.Close()
if res.StatusCode >= 200 && res.StatusCode < 300 {
if validResponse {
- s1.Verified = false
- } else {
s1.Verified = true
}
} else {