Skip to content

DAST site profiles: support validation path

What does this MR do?

This adds support for providing a validation file path when validation a DAST site profile.

  • The input's prefix now defaults to the target URL's origin, followed by a trailing slash
  • The input itself defaults to the target URL's path followed by the generated token
  • Submitting the validation form now sends the validation path along with the GraphQL mutation

What does this MR do?

This hooks up the frontend validation components to actual API calls for validating DAST sites.

How to test this?

  1. Enable the feature flag.
echo "Feature.enable(:security_on_demand_scans_site_validation)" | rails c
  1. Install and setup graphql-vue-apollo-playground locally. Checkout the mock-dast-site-profiles branch and run the mock server.

  2. Use the local mock server in the Apollo provider.

diff --git a/ee/app/assets/javascripts/dast_site_profiles_form/graphql/provider.js b/ee/app/assets/javascripts/dast_site_profiles_form/graphql/provider.js
index ef96b443da8..993a7cefb5c 100644
--- a/ee/app/assets/javascripts/dast_site_profiles_form/graphql/provider.js
+++ b/ee/app/assets/javascripts/dast_site_profiles_form/graphql/provider.js
@@ -5,5 +5,10 @@ import createDefaultClient from '~/lib/graphql';
 Vue.use(VueApollo);
 
 export default new VueApollo({
-  defaultClient: createDefaultClient(),
+  defaultClient: createDefaultClient(
+    {},
+    {
+      baseUrl: 'http://localhost:4000',
+    },
+  ),
 });
  1. Navigate to the DAST Site profile form in your GDK: /:namespace/:project/-/on_demand_scans/profiles/dast_site_profiles/new

Screenshots

Screen_Shot_2020-09-21_at_5.21.08_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Paul Gascou-Vaillancourt

Merge request reports