Commit 9f318420 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'djadmin-rename-dast-profiles-route' into 'master'

Update DAST Profiles links to use the new route

See merge request gitlab-org/gitlab!56966
parents 49e2bf6c 39f62cce
......@@ -46,7 +46,7 @@ module Types
description: 'List of security policy names that are referencing given project.'
def edit_path
Rails.application.routes.url_helpers.edit_project_security_configuration_dast_profiles_dast_scanner_profile_path(object.project, object)
Rails.application.routes.url_helpers.edit_project_security_configuration_dast_scans_dast_scanner_profile_path(object.project, object)
end
end
end
......@@ -52,7 +52,7 @@ module Types
end
def edit_path
Rails.application.routes.url_helpers.edit_project_security_configuration_dast_profiles_dast_site_profile_path(object.project, object)
Rails.application.routes.url_helpers.edit_project_security_configuration_dast_scans_dast_site_profile_path(object.project, object)
end
def auth
......
......@@ -8,11 +8,11 @@ module Projects::OnDemandScansHelper
'empty-state-svg-path' => image_path('illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace,
'profiles-library-path' => project_security_configuration_dast_profiles_path(project),
'scanner-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_security_configuration_dast_profiles_dast_site_profile_path(project)
'profiles-library-path' => project_security_configuration_dast_scans_path(project),
'scanner-profiles-library-path' => project_security_configuration_dast_scans_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_security_configuration_dast_scans_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_security_configuration_dast_scans_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_security_configuration_dast_scans_dast_site_profile_path(project)
}
end
end
......@@ -90,7 +90,7 @@ module Projects
def configuration_path(type)
{
sast: project_security_configuration_sast_path(project),
dast_profiles: project_security_configuration_dast_profiles_path(project),
dast_profiles: project_security_configuration_dast_scans_path(project),
api_fuzzing: ::Feature.enabled?(:api_fuzzing_configuration_ui, project, default_enabled: :yaml) ? project_security_configuration_api_fuzzing_path(project) : nil
}[type]
end
......
......@@ -3,6 +3,6 @@
- page_title s_('DastProfiles|Manage DAST scans')
.js-dast-profiles{ data: { new_dast_saved_scan_path: new_project_on_demand_scan_path(@project),
new_dast_site_profile_path: new_project_security_configuration_dast_profiles_dast_site_profile_path(@project),
new_dast_scanner_profile_path: new_project_security_configuration_dast_profiles_dast_scanner_profile_path(@project),
new_dast_site_profile_path: new_project_security_configuration_dast_scans_dast_site_profile_path(@project),
new_dast_scanner_profile_path: new_project_security_configuration_dast_scans_dast_scanner_profile_path(@project),
project_full_path: @project.path_with_namespace } }
- add_to_breadcrumbs _('Security Configuration'), project_security_configuration_path(@project)
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_profiles_path(@project, anchor: 'scanner-profiles')
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_scans_path(@project, anchor: 'scanner-profiles')
- breadcrumb_title s_('DastProfiles|Edit scanner profile')
- page_title s_('DastProfiles|Edit scanner profile')
.js-dast-scanner-profile-form{ data: { project_full_path: @project.path_with_namespace,
profiles_library_path: project_security_configuration_dast_profiles_path(@project, anchor: 'scanner-profiles'),
profiles_library_path: project_security_configuration_dast_scans_path(@project, anchor: 'scanner-profiles'),
scanner_profile: { id: @scanner_profile.to_global_id.to_s, name: @scanner_profile.name,
spider_timeout: @scanner_profile.spider_timeout, target_timeout: @scanner_profile.target_timeout,
scan_type: @scanner_profile.scan_type.upcase, use_ajax_spider: @scanner_profile.use_ajax_spider,
......
- add_to_breadcrumbs _('Security Configuration'), project_security_configuration_path(@project)
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_profiles_path(@project, anchor: 'scanner-profiles')
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_scans_path(@project, anchor: 'scanner-profiles')
- breadcrumb_title s_('DastProfiles|New scanner profile')
- page_title s_('DastProfiles|New scanner profile')
.js-dast-scanner-profile-form{ data: { project_full_path: @project.path_with_namespace,
profiles_library_path: project_security_configuration_dast_profiles_path(@project, anchor: 'scanner-profiles'),
profiles_library_path: project_security_configuration_dast_scans_path(@project, anchor: 'scanner-profiles'),
on_demand_scans_path: new_project_on_demand_scan_path(@project) } }
- add_to_breadcrumbs _('Security Configuration'), project_security_configuration_path(@project)
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_profiles_path(@project, anchor: 'site-profiles')
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_scans_path(@project, anchor: 'site-profiles')
- breadcrumb_title s_('DastProfiles|Edit site profile')
- page_title s_('DastProfiles|Edit site profile')
.js-dast-site-profile-form{ data: { full_path: @project.path_with_namespace,
profiles_library_path: project_security_configuration_dast_profiles_path(@project, anchor: 'site-profiles'),
profiles_library_path: project_security_configuration_dast_scans_path(@project, anchor: 'site-profiles'),
site_profile: { id: @site_profile.to_global_id.to_s, name: @site_profile.name, target_url: @site_profile.dast_site.url,
excluded_urls: ['https://example.com/logout', 'https://example.com/send_mail'], request_headers: 'new-header',
auth: { enabled: true, url: 'https://example.com', username: 'admin', usernameField: 'username', passwordField: 'password' }, referenced_in_security_policies: @site_profile.referenced_in_security_policies}.to_json,
......
- add_to_breadcrumbs _('Security Configuration'), project_security_configuration_path(@project)
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_profiles_path(@project, anchor: 'site-profiles')
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_security_configuration_dast_scans_path(@project, anchor: 'site-profiles')
- breadcrumb_title s_('DastProfiles|New site profile')
- page_title s_('DastProfiles|New site profile')
.js-dast-site-profile-form{ data: { full_path: @project.path_with_namespace,
profiles_library_path: project_security_configuration_dast_profiles_path(@project, anchor: 'site-profiles'),
profiles_library_path: project_security_configuration_dast_scans_path(@project, anchor: 'site-profiles'),
on_demand_scans_path: new_project_on_demand_scan_path(@project) } }
---
title: Update routes for DAST profiles to align with user interface
merge_request: 56966
author:
type: changed
......@@ -8,7 +8,7 @@ const helpPagePath = `${TEST_HOST}/application_security/dast/index#on-demand-sca
const projectPath = 'group/project';
const defaultBranch = 'master';
const emptyStateSvgPath = `${TEST_HOST}/assets/illustrations/alert-management-empty-state.svg`;
const newSiteProfilePath = `${TEST_HOST}/${projectPath}/-/security/configuration/dast_profiles`;
const newSiteProfilePath = `${TEST_HOST}/${projectPath}/-/security/configuration/dast_scans`;
describe('OnDemandScansApp', () => {
let wrapper;
......
......@@ -23,11 +23,11 @@ const URL_HOST = 'https://localhost/';
const helpPagePath = '/application_security/dast/index#on-demand-scans';
const projectPath = 'group/project';
const defaultBranch = 'master';
const profilesLibraryPath = '/security/configuration/dast_profiles';
const scannerProfilesLibraryPath = '/security/configuration/dast_profiles#scanner-profiles';
const siteProfilesLibraryPath = '/security/configuration/dast_profiles#site-profiles';
const newScannerProfilePath = '/security/configuration/dast_profiles/dast_scanner_profile/new';
const newSiteProfilePath = `/${projectPath}/-/security/configuration/dast_profiles`;
const profilesLibraryPath = '/security/configuration/dast_scans';
const scannerProfilesLibraryPath = '/security/configuration/dast_scans#scanner-profiles';
const siteProfilesLibraryPath = '/security/configuration/dast_scans#site-profiles';
const newScannerProfilePath = '/security/configuration/dast_scans/dast_scanner_profile/new';
const newSiteProfilePath = `/${projectPath}/-/security/configuration/dast_scans`;
const defaultProps = {
helpPagePath,
......
......@@ -3,7 +3,7 @@ import { TEST_HOST } from 'helpers/test_constants';
import * as urlUtility from '~/lib/utils/url_utility';
const fullPath = 'group/project';
const profilesLibraryPath = `${TEST_HOST}/${fullPath}/-/security/configuration/dast_profiles`;
const profilesLibraryPath = `${TEST_HOST}/${fullPath}/-/security/configuration/dast_scans`;
const onDemandScansPath = `${TEST_HOST}/${fullPath}/-/on_demand_scans`;
const urlParamKey = 'site_profile_id';
const originalReferrer = document.referrer;
......
......@@ -15,7 +15,7 @@ jest.mock('~/lib/utils/url_utility', () => ({
}));
const projectFullPath = 'group/project';
const profilesLibraryPath = `${TEST_HOST}/${projectFullPath}/-/security/configuration/dast_profiles`;
const profilesLibraryPath = `${TEST_HOST}/${projectFullPath}/-/security/configuration/dast_scans`;
const onDemandScansPath = `${TEST_HOST}/${projectFullPath}/-/on_demand_scans`;
const defaultProfile = scannerProfiles[0];
......
......@@ -20,7 +20,7 @@ localVue.use(VueApollo);
const [siteProfileOne] = siteProfiles;
const fullPath = 'group/project';
const profilesLibraryPath = `${TEST_HOST}/${fullPath}/-/security/configuration/dast_profiles`;
const profilesLibraryPath = `${TEST_HOST}/${fullPath}/-/security/configuration/dast_scans`;
const onDemandScansPath = `${TEST_HOST}/${fullPath}/-/on_demand_scans`;
const profileName = 'My DAST site profile';
const targetUrl = 'http://example.com';
......
......@@ -73,7 +73,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
describe 'edit_path field' do
it 'is the relative path to edit the dast_site_profile' do
path = "/#{project.full_path}/-/security/configuration/dast_profiles/dast_site_profiles/#{dast_site_profile.id}/edit"
path = "/#{project.full_path}/-/security/configuration/dast_scans/dast_site_profiles/#{dast_site_profile.id}/edit"
expect(first_dast_site_profile['editPath']).to eq(path)
end
......
......@@ -13,11 +13,11 @@ RSpec.describe Projects::OnDemandScansHelper do
'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace,
'profiles-library-path' => project_security_configuration_dast_profiles_path(project),
'scanner-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_security_configuration_dast_profiles_dast_site_profile_path(project)
'profiles-library-path' => project_security_configuration_dast_scans_path(project),
'scanner-profiles-library-path' => project_security_configuration_dast_scans_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_security_configuration_dast_scans_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_security_configuration_dast_scans_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_security_configuration_dast_scans_dast_site_profile_path(project)
)
end
end
......
......@@ -266,7 +266,7 @@ RSpec.describe Projects::Security::ConfigurationPresenter do
def configuration_path(type)
{
dast_profiles: project_security_configuration_dast_profiles_path(project),
dast_profiles: project_security_configuration_dast_scans_path(project),
sast: project_security_configuration_sast_path(project),
api_fuzzing: project_security_configuration_api_fuzzing_path(project)
}[type]
......
......@@ -14,7 +14,7 @@ RSpec.describe Projects::Security::DastProfilesController, type: :request do
end
include_context '"Security & Compliance" permissions' do
let(:valid_request) { get project_security_configuration_dast_profiles_path(project) }
let(:valid_request) { get project_security_configuration_dast_scans_path(project) }
before_request do
project.add_developer(user)
......@@ -28,7 +28,7 @@ RSpec.describe Projects::Security::DastProfilesController, type: :request do
end
it 'can access page' do
get project_security_configuration_dast_profiles_path(project)
get project_security_configuration_dast_scans_path(project)
expect(response).to have_gitlab_http_status(:ok)
end
......@@ -40,7 +40,7 @@ RSpec.describe Projects::Security::DastProfilesController, type: :request do
end
it 'sees a 404 error' do
get project_security_configuration_dast_profiles_path(project)
get project_security_configuration_dast_scans_path(project)
expect(response).to have_gitlab_http_status(:not_found)
end
......@@ -55,7 +55,7 @@ RSpec.describe Projects::Security::DastProfilesController, type: :request do
context 'license doesnt\'t support the feature' do
it 'sees a 404 error' do
get project_security_configuration_dast_profiles_path(project)
get project_security_configuration_dast_scans_path(project)
expect(response).to have_gitlab_http_status(:not_found)
end
......
......@@ -75,7 +75,7 @@ RSpec.describe Projects::Security::DastScannerProfilesController, type: :request
describe 'GET #new' do
it_behaves_like 'a GET request' do
let(:path) { new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project) }
let(:path) { new_project_security_configuration_dast_scans_dast_scanner_profile_path(project) }
end
end
......@@ -83,7 +83,7 @@ RSpec.describe Projects::Security::DastScannerProfilesController, type: :request
include_context 'user authorized'
include_context 'on-demand scans feature available'
let(:edit_path) { edit_project_security_configuration_dast_profiles_dast_scanner_profile_path(project, dast_scanner_profile) }
let(:edit_path) { edit_project_security_configuration_dast_scans_dast_scanner_profile_path(project, dast_scanner_profile) }
it_behaves_like 'a GET request' do
let(:path) { edit_path }
......
......@@ -76,12 +76,12 @@ RSpec.describe Projects::Security::DastSiteProfilesController, type: :request do
describe 'GET #new' do
it_behaves_like 'a GET request' do
let(:path) { new_project_security_configuration_dast_profiles_dast_site_profile_path(project) }
let(:path) { new_project_security_configuration_dast_scans_dast_site_profile_path(project) }
end
end
describe 'GET #edit' do
let(:edit_path) { edit_project_security_configuration_dast_profiles_dast_site_profile_path(project, dast_site_profile) }
let(:edit_path) { edit_project_security_configuration_dast_scans_dast_site_profile_path(project, dast_site_profile) }
it_behaves_like 'a GET request' do
let(:path) { edit_path }
......
......@@ -17,11 +17,11 @@ RSpec.describe "projects/security/dast_profiles/show", type: :view do
end
it 'passes new dast site profile path' do
expect(rendered).to include '/security/configuration/dast_profiles/dast_site_profiles/new'
expect(rendered).to include '/security/configuration/dast_scans/dast_site_profiles/new'
end
it 'passes new dast scanner profile path' do
expect(rendered).to include '/security/configuration/dast_profiles/dast_scanner_profiles/new'
expect(rendered).to include '/security/configuration/dast_scans/dast_scanner_profiles/new'
end
it 'passes project\'s full path' do
......
......@@ -22,7 +22,7 @@ RSpec.describe "projects/security/dast_scanner_profiles/edit", type: :view do
end
it 'passes DAST profiles library URL' do
expect(rendered).to include '/security/configuration/dast_profiles'
expect(rendered).to include '/security/configuration/dast_scans'
end
it 'passes DAST scanner profile\'s data' do
......
......@@ -17,6 +17,6 @@ RSpec.describe "projects/security/dast_scanner_profiles/new", type: :view do
end
it 'passes DAST profiles library URL' do
expect(rendered).to include '/security/configuration/dast_profiles#scanner-profiles'
expect(rendered).to include '/security/configuration/dast_scans#scanner-profiles'
end
end
......@@ -22,7 +22,7 @@ RSpec.describe "projects/security/dast_site_profiles/edit", type: :view do
end
it 'passes DAST profiles library URL' do
expect(rendered).to include '/security/configuration/dast_profiles#site-profiles'
expect(rendered).to include '/security/configuration/dast_scans#site-profiles'
end
it 'passes DAST site profile\'s data' do
......
......@@ -17,6 +17,6 @@ RSpec.describe "projects/security/dast_site_profiles/new", type: :view do
end
it 'passes DAST profiles library URL' do
expect(rendered).to include '/security/configuration/dast_profiles#site-profiles'
expect(rendered).to include '/security/configuration/dast_scans#site-profiles'
end
end
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