Commit 4be72478 authored by Dheeraj Joshi's avatar Dheeraj Joshi Committed by Stan Hu

Enable secret detection in MR Widget

parent 1ec95ad8
......@@ -229,6 +229,7 @@ export default {
'dependencyScanning',
'containerScanning',
'coverageFuzzing',
'secretDetection',
],
};
</script>
......
......@@ -229,7 +229,7 @@ export default {
return this.enabledReports.sast;
},
hasSecretScanningReports() {
return this.enabledReports.secretScanning;
return this.enabledReports.secretDetection;
},
isMRActive() {
return this.mrState !== mrStates.merged && this.mrState !== mrStates.closed;
......
......@@ -76,7 +76,7 @@ export default {
'ciReport|Secret scanning detects secrets and credentials vulnerabilities in your source code.',
),
content: sprintf(
s__('ciReport|%{linkStartTag}Learn more about Secret Scanning %{linkEndTag}'),
s__('ciReport|%{linkStartTag}Learn more about Secret Detection %{linkEndTag}'),
{
linkStartTag: getLinkStartTag(this.secretScanningHelpPath),
linkEndTag,
......
......@@ -203,7 +203,7 @@ export const receiveSecretScanningDiffError = ({ commit }) =>
export const fetchSecretScanningDiff = ({ state, dispatch }) => {
dispatch('requestSecretScanningDiff');
return fetchDiffData(state, state.secretScanning.paths.diffEndpoint, 'secret_scanning')
return fetchDiffData(state, state.secretScanning.paths.diffEndpoint, 'secret_detection')
.then(data => {
dispatch('receiveSecretScanningDiffSuccess', data);
})
......
......@@ -164,7 +164,8 @@ module EE
dast: report_type_enabled?(:dast),
dependency_scanning: report_type_enabled?(:dependency_scanning),
license_scanning: report_type_enabled?(:license_scanning),
coverage_fuzzing: report_type_enabled?(:coverage_fuzzing)
coverage_fuzzing: report_type_enabled?(:coverage_fuzzing),
secret_detection: report_type_enabled?(:secret_detection)
}
end
......
......@@ -7,11 +7,10 @@
window.gl.mrWidgetData.is_geo_secondary_node = '#{Gitlab::Geo.secondary?}' === 'true';
window.gl.mrWidgetData.geo_secondary_help_path = '#{help_page_path("administration/geo/replication/configuration.md")}';
window.gl.mrWidgetData.sast_help_path = '#{help_page_path("user/application_security/sast/index")}';
window.gl.mrWidgetData.secret_detection_help_path = '#{help_page_path("user/application_security/secret_detection/index")}';
window.gl.mrWidgetData.secret_scanning_help_path = '#{help_page_path("user/application_security/secret_detection/index")}';
window.gl.mrWidgetData.container_scanning_help_path = '#{help_page_path("user/application_security/container_scanning/index")}';
window.gl.mrWidgetData.dast_help_path = '#{help_page_path("user/application_security/dast/index")}';
window.gl.mrWidgetData.dependency_scanning_help_path = '#{help_page_path("user/application_security/dependency_scanning/index")}';
window.gl.mrWidgetData.secret_scanning_help_path = '#{help_page_path('user/application_security/sast/index', anchor: 'secret-detection')}';
window.gl.mrWidgetData.coverage_fuzzinghelp_path = '#{help_page_path("user/application_security/coverage_fuzzing/index")}';
window.gl.mrWidgetData.vulnerability_feedback_help_path = '#{help_page_path("user/application_security/index")}';
window.gl.mrWidgetData.visual_review_app_available = '#{@project.feature_available?(:visual_review_app)}' === 'true';
......@@ -20,3 +19,4 @@
window.gl.mrWidgetData.dependency_scanning_comparison_path = '#{dependency_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dependency_scanning)}'
window.gl.mrWidgetData.sast_comparison_path = '#{sast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:sast)}'
window.gl.mrWidgetData.dast_comparison_path = '#{dast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dast)}'
window.gl.mrWidgetData.secret_scanning_comparison_path = '#{secret_detection_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:secret_detection)}'
---
title: Enable secret detection for MR Widget
merge_request: 41582
author:
type: fixed
......@@ -810,13 +810,13 @@ describe('ee merge request widget options', () => {
});
describe('Secret Scanning', () => {
const SECRET_SCANNING_ENDPOINT = 'secret_scanning';
const SECRET_SCANNING_ENDPOINT = 'secret_detection_report';
beforeEach(() => {
gl.mrWidgetData = {
...mockData,
enabled_reports: {
secret_scanning: true,
secret_detection: true,
// The below property needs to exist until
// secret scanning is implemented in backend
// Or for some other reason I'm yet to find
......@@ -1070,7 +1070,7 @@ describe('ee merge request widget options', () => {
sast: false,
container_scanning: false,
dependency_scanning: false,
secret_scanning: false,
secret_detection: false,
},
];
......
......@@ -29,7 +29,7 @@ const CONTAINER_SCANNING_DIFF_ENDPOINT = 'container_scanning.json';
const DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'dependency_scanning.json';
const DAST_DIFF_ENDPOINT = 'dast.json';
const SAST_DIFF_ENDPOINT = 'sast.json';
const SECRET_SCANNING_DIFF_ENDPOINT = 'secret_scanning.json';
const SECRET_SCANNING_DIFF_ENDPOINT = 'secret_detection.json';
const COVERAGE_FUZZING_DIFF_ENDPOINT = 'coverage_fuzzing.json';
describe('Grouped security reports app', () => {
......@@ -103,7 +103,7 @@ describe('Grouped security reports app', () => {
dast: true,
containerScanning: true,
dependencyScanning: true,
secretScanning: true,
secretDetection: true,
coverageFuzzing: true,
},
};
......@@ -515,7 +515,7 @@ describe('Grouped security reports app', () => {
createWrapper({
...props,
enabledReports: {
secretScanning: isEnabled,
secretDetection: isEnabled,
},
});
......
......@@ -284,7 +284,7 @@ export const secretScanningFeedbacks = [
author_id: 1,
issue_iid: null,
pipeline_id: 132,
category: 'secret_scanning',
category: 'secret_detection',
feedback_type: 'dismissal',
branch: 'try_new_secret_scanning',
project_fingerprint: libTiffCveFingerprint2,
......@@ -295,7 +295,7 @@ export const secretScanningFeedbacks = [
author_id: 1,
issue_iid: 123,
pipeline_id: 132,
category: 'secret_scanning',
category: 'secret_detection',
feedback_type: 'issue',
branch: 'try_new_secret_scanning',
project_fingerprint: libTiffCveFingerprint2,
......
......@@ -1781,7 +1781,7 @@ describe('security reports actions', () => {
mock
.onGet('vulnerabilities_feedback', {
params: {
category: 'secret_scanning',
category: 'secret_detection',
},
})
.reply(200, secretScanningFeedbacks);
......
......@@ -29386,7 +29386,7 @@ msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about SAST %{linkEndTag}"
msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about Secret Scanning %{linkEndTag}"
msgid "ciReport|%{linkStartTag}Learn more about Secret Detection %{linkEndTag}"
msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about codequality reports %{linkEndTag}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment