Commit d690637a authored by Simon Knox's avatar Simon Knox

Merge branch '235610-ondemand-scans-use-existing-scanner-profiles' into 'master'

DAST On-Demand Scans - Use existing scanner profiles for scans implementation - Frontend

See merge request gitlab-org/gitlab!40414
parents 88f43c7d dd40f342
...@@ -25,14 +25,6 @@ export default { ...@@ -25,14 +25,6 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
profilesLibraryPath: {
type: String,
required: true,
},
newSiteProfilePath: {
type: String,
required: true,
},
}, },
data() { data() {
return { return {
...@@ -49,8 +41,6 @@ export default { ...@@ -49,8 +41,6 @@ export default {
:help-page-path="helpPagePath" :help-page-path="helpPagePath"
:project-path="projectPath" :project-path="projectPath"
:default-branch="defaultBranch" :default-branch="defaultBranch"
:profiles-library-path="profilesLibraryPath"
:new-site-profile-path="newSiteProfilePath"
@cancel="showForm = false" @cancel="showForm = false"
/> />
</template> </template>
......
export const SCAN_TYPES = {
PASSIVE: 'PASSIVE',
};
mutation dastOnDemandScanCreate($fullPath: ID!, $dastSiteProfileId: DastSiteProfileID!) { mutation dastOnDemandScanCreate(
dastOnDemandScanCreate(input: { fullPath: $fullPath, dastSiteProfileId: $dastSiteProfileId }) { $fullPath: ID!
$dastScannerProfileId: DastScannerProfileID
$dastSiteProfileId: DastSiteProfileID!
) {
dastOnDemandScanCreate(
input: {
fullPath: $fullPath
dastScannerProfileId: $dastScannerProfileId
dastSiteProfileId: $dastSiteProfileId
}
) {
pipelineUrl pipelineUrl
errors errors
} }
......
...@@ -13,13 +13,21 @@ export default () => { ...@@ -13,13 +13,21 @@ export default () => {
emptyStateSvgPath, emptyStateSvgPath,
projectPath, projectPath,
defaultBranch, defaultBranch,
profilesLibraryPath, scannerProfilesLibraryPath,
siteProfilesLibraryPath,
newSiteProfilePath, newSiteProfilePath,
newScannerProfilePath,
} = el.dataset; } = el.dataset;
return new Vue({ return new Vue({
el, el,
apolloProvider, apolloProvider,
provide: {
scannerProfilesLibraryPath,
siteProfilesLibraryPath,
newScannerProfilePath,
newSiteProfilePath,
},
render(h) { render(h) {
return h(OnDemandScansApp, { return h(OnDemandScansApp, {
props: { props: {
...@@ -27,8 +35,6 @@ export default () => { ...@@ -27,8 +35,6 @@ export default () => {
emptyStateSvgPath, emptyStateSvgPath,
projectPath, projectPath,
defaultBranch, defaultBranch,
profilesLibraryPath,
newSiteProfilePath,
}, },
}); });
}, },
......
...@@ -4,6 +4,7 @@ module Projects ...@@ -4,6 +4,7 @@ module Projects
class OnDemandScansController < Projects::ApplicationController class OnDemandScansController < Projects::ApplicationController
before_action do before_action do
authorize_read_on_demand_scans! authorize_read_on_demand_scans!
push_frontend_feature_flag(:security_on_demand_scans_scanner_profiles)
end end
def index def index
......
...@@ -7,7 +7,9 @@ module Projects::OnDemandScansHelper ...@@ -7,7 +7,9 @@ module Projects::OnDemandScansHelper
'empty-state-svg-path' => image_path('illustrations/empty-state/ondemand-scan-empty.svg'), 'empty-state-svg-path' => image_path('illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch, 'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace, 'project-path' => project.path_with_namespace,
'profiles-library-path' => project_profiles_path(project), 'scanner-profiles-library-path' => project_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_dast_site_profile_path(project) 'new-site-profile-path' => new_project_dast_site_profile_path(project)
} }
end end
......
...@@ -9,7 +9,6 @@ const helpPagePath = `${TEST_HOST}/application_security/dast/index#on-demand-sca ...@@ -9,7 +9,6 @@ const helpPagePath = `${TEST_HOST}/application_security/dast/index#on-demand-sca
const projectPath = 'group/project'; const projectPath = 'group/project';
const defaultBranch = 'master'; const defaultBranch = 'master';
const emptyStateSvgPath = `${TEST_HOST}/assets/illustrations/alert-management-empty-state.svg`; const emptyStateSvgPath = `${TEST_HOST}/assets/illustrations/alert-management-empty-state.svg`;
const profilesLibraryPath = `${TEST_HOST}/${projectPath}/-/on_demand_scans/profiles`;
const newSiteProfilePath = `${TEST_HOST}/${projectPath}/-/on_demand_scans/profiles`; const newSiteProfilePath = `${TEST_HOST}/${projectPath}/-/on_demand_scans/profiles`;
describe('OnDemandScansApp', () => { describe('OnDemandScansApp', () => {
...@@ -39,7 +38,6 @@ describe('OnDemandScansApp', () => { ...@@ -39,7 +38,6 @@ describe('OnDemandScansApp', () => {
projectPath, projectPath,
defaultBranch, defaultBranch,
emptyStateSvgPath, emptyStateSvgPath,
profilesLibraryPath,
newSiteProfilePath, newSiteProfilePath,
}, },
}, },
...@@ -85,8 +83,6 @@ describe('OnDemandScansApp', () => { ...@@ -85,8 +83,6 @@ describe('OnDemandScansApp', () => {
helpPagePath, helpPagePath,
projectPath, projectPath,
defaultBranch, defaultBranch,
profilesLibraryPath,
newSiteProfilePath,
}); });
}); });
......
...@@ -12,7 +12,9 @@ RSpec.describe Projects::OnDemandScansHelper do ...@@ -12,7 +12,9 @@ RSpec.describe Projects::OnDemandScansHelper do
'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'), 'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch, 'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace, 'project-path' => project.path_with_namespace,
'profiles-library-path' => project_profiles_path(project), 'scanner-profiles-library-path' => project_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_dast_site_profile_path(project) 'new-site-profile-path' => new_project_dast_site_profile_path(project)
) )
end end
......
...@@ -7870,6 +7870,9 @@ msgstr "" ...@@ -7870,6 +7870,9 @@ msgstr ""
msgid "DastProfiles|No profiles created yet" msgid "DastProfiles|No profiles created yet"
msgstr "" msgstr ""
msgid "DastProfiles|Passive"
msgstr ""
msgid "DastProfiles|Please enter a valid URL format, ex: http://www.example.com/home" msgid "DastProfiles|Please enter a valid URL format, ex: http://www.example.com/home"
msgstr "" msgstr ""
...@@ -7885,6 +7888,9 @@ msgstr "" ...@@ -7885,6 +7888,9 @@ msgstr ""
msgid "DastProfiles|Save profile" msgid "DastProfiles|Save profile"
msgstr "" msgstr ""
msgid "DastProfiles|Scan mode"
msgstr ""
msgid "DastProfiles|Scanner Profile" msgid "DastProfiles|Scanner Profile"
msgstr "" msgstr ""
...@@ -17281,12 +17287,18 @@ msgstr "" ...@@ -17281,12 +17287,18 @@ msgstr ""
msgid "OnDemandScans|Attached branch is where the scan job runs." msgid "OnDemandScans|Attached branch is where the scan job runs."
msgstr "" msgstr ""
msgid "OnDemandScans|Could not fetch scanner profiles. Please refresh the page, or try again later."
msgstr ""
msgid "OnDemandScans|Could not fetch site profiles. Please refresh the page, or try again later." msgid "OnDemandScans|Could not fetch site profiles. Please refresh the page, or try again later."
msgstr "" msgstr ""
msgid "OnDemandScans|Could not run the scan. Please try again." msgid "OnDemandScans|Could not run the scan. Please try again."
msgstr "" msgstr ""
msgid "OnDemandScans|Create a new scanner profile"
msgstr ""
msgid "OnDemandScans|Create a new site profile" msgid "OnDemandScans|Create a new site profile"
msgstr "" msgstr ""
...@@ -17299,6 +17311,9 @@ msgstr "" ...@@ -17299,6 +17311,9 @@ msgstr ""
msgid "OnDemandScans|New on-demand DAST scan" msgid "OnDemandScans|New on-demand DAST scan"
msgstr "" msgstr ""
msgid "OnDemandScans|No profile yet. In order to create a new scan, you need to have at least one completed scanner profile."
msgstr ""
msgid "OnDemandScans|No profile yet. In order to create a new scan, you need to have at least one completed site profile." msgid "OnDemandScans|No profile yet. In order to create a new scan, you need to have at least one completed site profile."
msgstr "" msgstr ""
...@@ -17332,6 +17347,9 @@ msgstr "" ...@@ -17332,6 +17347,9 @@ msgstr ""
msgid "OnDemandScans|Site profiles" msgid "OnDemandScans|Site profiles"
msgstr "" msgstr ""
msgid "OnDemandScans|Use existing scanner profile"
msgstr ""
msgid "OnDemandScans|Use existing site profile" msgid "OnDemandScans|Use existing site profile"
msgstr "" msgstr ""
......
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