aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
authorJanos Gyerik <janos.gyerik@sonarsource.com>2018-07-09 10:22:06 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-17 20:21:24 +0200
commit494faa4ab6425a54f40a891024034b1d8fe14647 (patch)
tree655d9cbafabce0147aa3bc8c7f5ccdafd4e67c83 /server/sonar-server-common
parent4c237919e3c72aa0a62a27b4587825944bc81ee9 (diff)
downloadsonarqube-494faa4ab6425a54f40a891024034b1d8fe14647.tar.gz
sonarqube-494faa4ab6425a54f40a891024034b1d8fe14647.zip
SONAR-10985 Add filters for owaspTop10, sans25Top10, cwe (#485)
* Add security standards for Xoo hotspot sensor (when API supports it) * Re-generate issues/SearchRequest * Verify security standards in issue search * Store security standards when registering rules
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQueryFactory.java3
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIndex.java3
2 files changed, 6 insertions, 0 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQueryFactory.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQueryFactory.java
index d0b0747a9f6..e28607edc5b 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQueryFactory.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQueryFactory.java
@@ -106,6 +106,9 @@ public class IssueQueryFactory {
.languages(request.getLanguages())
.tags(request.getTags())
.types(request.getTypes())
+ .owaspTop10(request.getOwaspTop10())
+ .sansTop25(request.getSansTop25())
+ .cwe(request.getCwe())
.assigned(request.getAssigned())
.createdAt(parseDateOrDateTime(request.getCreatedAt()))
.createdBefore(parseEndingDateOrDateTime(request.getCreatedBefore()))
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index 9f1bc7382e1..27303d4b508 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -268,6 +268,9 @@ public class IssueIndex {
filters.put(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, query.severities()));
filters.put(IssueIndexDefinition.FIELD_ISSUE_STATUS, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_STATUS, query.statuses()));
filters.put(IssueIndexDefinition.FIELD_ISSUE_ORGANIZATION_UUID, createTermFilter(IssueIndexDefinition.FIELD_ISSUE_ORGANIZATION_UUID, query.organizationUuid()));
+ filters.put(IssueIndexDefinition.FIELD_ISSUE_OWASP_TOP_10, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_OWASP_TOP_10, query.owaspTop10()));
+ filters.put(IssueIndexDefinition.FIELD_ISSUE_SANS_TOP_25, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_SANS_TOP_25, query.sansTop25()));
+ filters.put(IssueIndexDefinition.FIELD_ISSUE_CWE, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_CWE, query.cwe()));
addComponentRelatedFilters(query, filters);