Commit 4f5f5024 authored by Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt Committed by Vitaly Slobodin

Create DastSiteValidationModal component

- Refactors the DastSiteValiation component into a modal-based component
- Move required logic to create validation tokens from within the
validation component
- Remove validation status checks from the validation component
- Add/update specs
parent e09933bf
...@@ -6,16 +6,16 @@ export const DAST_SITE_VALIDATION_METHOD_HTTP_HEADER = 'HEADER'; ...@@ -6,16 +6,16 @@ export const DAST_SITE_VALIDATION_METHOD_HTTP_HEADER = 'HEADER';
export const DAST_SITE_VALIDATION_METHODS = { export const DAST_SITE_VALIDATION_METHODS = {
[DAST_SITE_VALIDATION_METHOD_TEXT_FILE]: { [DAST_SITE_VALIDATION_METHOD_TEXT_FILE]: {
value: DAST_SITE_VALIDATION_METHOD_TEXT_FILE, value: DAST_SITE_VALIDATION_METHOD_TEXT_FILE,
text: s__('DastProfiles|Text file validation'), text: s__('DastSiteValidation|Text file validation'),
i18n: { i18n: {
locationStepLabel: s__('DastProfiles|Step 3 - Confirm text file location and validate'), locationStepLabel: s__('DastSiteValidation|Step 3 - Confirm text file location and validate'),
}, },
}, },
[DAST_SITE_VALIDATION_METHOD_HTTP_HEADER]: { [DAST_SITE_VALIDATION_METHOD_HTTP_HEADER]: {
value: DAST_SITE_VALIDATION_METHOD_HTTP_HEADER, value: DAST_SITE_VALIDATION_METHOD_HTTP_HEADER,
text: s__('DastProfiles|Header validation'), text: s__('DastSiteValidation|Header validation'),
i18n: { i18n: {
locationStepLabel: s__('DastProfiles|Step 3 - Confirm header location and validate'), locationStepLabel: s__('DastSiteValidation|Step 3 - Confirm header location and validate'),
}, },
}, },
}; };
...@@ -27,5 +27,6 @@ export const DAST_SITE_VALIDATION_STATUS = { ...@@ -27,5 +27,6 @@ export const DAST_SITE_VALIDATION_STATUS = {
FAILED: 'FAILED_VALIDATION', FAILED: 'FAILED_VALIDATION',
}; };
export const DAST_SITE_VALIDATION_POLL_INTERVAL = 1000;
export const DAST_SITE_VALIDATION_HTTP_HEADER_KEY = 'Gitlab-On-Demand-DAST'; export const DAST_SITE_VALIDATION_HTTP_HEADER_KEY = 'Gitlab-On-Demand-DAST';
export const DAST_SITE_VALIDATION_MODAL_ID = 'dast-site-validation-modal';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
Vue.use(VueApollo);
export default new VueApollo({
defaultClient: createDefaultClient(),
});
import { DAST_SITE_VALIDATION_STATUS } from 'ee/security_configuration/dast_site_profiles_form/constants';
export const dastSiteProfileCreate = (errors = []) => ({ export const dastSiteProfileCreate = (errors = []) => ({
data: { dastSiteProfileCreate: { id: '3083', errors } }, data: { dastSiteProfileCreate: { id: '3083', errors } },
}); });
...@@ -7,23 +5,3 @@ export const dastSiteProfileCreate = (errors = []) => ({ ...@@ -7,23 +5,3 @@ export const dastSiteProfileCreate = (errors = []) => ({
export const dastSiteProfileUpdate = (errors = []) => ({ export const dastSiteProfileUpdate = (errors = []) => ({
data: { dastSiteProfileUpdate: { id: '3083', errors } }, data: { dastSiteProfileUpdate: { id: '3083', errors } },
}); });
export const dastSiteValidation = (status = DAST_SITE_VALIDATION_STATUS.PENDING) => ({
data: { project: { dastSiteValidation: { status, id: '1' } } },
});
export const dastSiteValidationCreate = (errors = []) => ({
data: {
dastSiteValidationCreate: { status: DAST_SITE_VALIDATION_STATUS.PENDING, id: '1', errors },
},
});
export const dastSiteTokenCreate = ({ id = '1', token = '1', errors = [] }) => ({
data: {
dastSiteTokenCreate: {
id,
token,
errors,
},
},
});
import { DAST_SITE_VALIDATION_STATUS } from 'ee/security_configuration/dast_site_validation/constants';
export const dastSiteValidationCreate = (errors = []) => ({
data: {
dastSiteValidationCreate: { status: DAST_SITE_VALIDATION_STATUS.PENDING, id: '1', errors },
},
});
export const dastSiteTokenCreate = ({ id = '1', token = '1', errors = [] }) => ({
data: {
dastSiteTokenCreate: {
id,
token,
errors,
},
},
});
...@@ -8413,9 +8413,6 @@ msgstr "" ...@@ -8413,9 +8413,6 @@ msgstr ""
msgid "DastProfiles|Authentication URL" msgid "DastProfiles|Authentication URL"
msgstr "" msgstr ""
msgid "DastProfiles|Copy HTTP header to clipboard"
msgstr ""
msgid "DastProfiles|Could not create the scanner profile. Please try again." msgid "DastProfiles|Could not create the scanner profile. Please try again."
msgstr "" msgstr ""
...@@ -8461,9 +8458,6 @@ msgstr "" ...@@ -8461,9 +8458,6 @@ msgstr ""
msgid "DastProfiles|Do you want to discard your changes?" msgid "DastProfiles|Do you want to discard your changes?"
msgstr "" msgstr ""
msgid "DastProfiles|Download validation text file"
msgstr ""
msgid "DastProfiles|Edit scanner profile" msgid "DastProfiles|Edit scanner profile"
msgstr "" msgstr ""
...@@ -8476,9 +8470,6 @@ msgstr "" ...@@ -8476,9 +8470,6 @@ msgstr ""
msgid "DastProfiles|Error Details" msgid "DastProfiles|Error Details"
msgstr "" msgstr ""
msgid "DastProfiles|Header validation"
msgstr ""
msgid "DastProfiles|Hide debug messages" msgid "DastProfiles|Hide debug messages"
msgstr "" msgstr ""
...@@ -8551,58 +8542,64 @@ msgstr "" ...@@ -8551,58 +8542,64 @@ msgstr ""
msgid "DastProfiles|Site Profiles" msgid "DastProfiles|Site Profiles"
msgstr "" msgstr ""
msgid "DastProfiles|Site is not validated yet, please follow the steps." msgid "DastProfiles|Spider timeout"
msgstr "" msgstr ""
msgid "DastProfiles|Spider timeout" msgid "DastProfiles|Target URL"
msgstr ""
msgid "DastProfiles|Target timeout"
msgstr ""
msgid "DastProfiles|The maximum number of minutes allowed for the spider to traverse the site."
msgstr "" msgstr ""
msgid "DastProfiles|Step 1 - Choose site validation method" msgid "DastProfiles|The maximum number of seconds allowed for the site under test to respond to a request."
msgstr "" msgstr ""
msgid "DastProfiles|Step 2 - Add following HTTP header to your site" msgid "DastProfiles|Turn on AJAX spider"
msgstr "" msgstr ""
msgid "DastProfiles|Step 2 - Add following text to the target site" msgid "DastProfiles|Username"
msgstr "" msgstr ""
msgid "DastProfiles|Step 3 - Confirm header location and validate" msgid "DastProfiles|Username form field"
msgstr "" msgstr ""
msgid "DastProfiles|Step 3 - Confirm text file location and validate" msgid "DastSiteValidation|Copy HTTP header to clipboard"
msgstr "" msgstr ""
msgid "DastProfiles|Target URL" msgid "DastSiteValidation|Could not create validation token. Please try again."
msgstr "" msgstr ""
msgid "DastProfiles|Target timeout" msgid "DastSiteValidation|Download validation text file"
msgstr "" msgstr ""
msgid "DastProfiles|Text file validation" msgid "DastSiteValidation|Header validation"
msgstr "" msgstr ""
msgid "DastProfiles|The maximum number of minutes allowed for the spider to traverse the site." msgid "DastSiteValidation|Step 1 - Choose site validation method"
msgstr "" msgstr ""
msgid "DastProfiles|The maximum number of seconds allowed for the site under test to respond to a request." msgid "DastSiteValidation|Step 2 - Add following HTTP header to your site"
msgstr "" msgstr ""
msgid "DastProfiles|Turn on AJAX spider" msgid "DastSiteValidation|Step 2 - Add following text to the target site"
msgstr "" msgstr ""
msgid "DastProfiles|Username" msgid "DastSiteValidation|Step 3 - Confirm header location and validate"
msgstr "" msgstr ""
msgid "DastProfiles|Username form field" msgid "DastSiteValidation|Step 3 - Confirm text file location and validate"
msgstr "" msgstr ""
msgid "DastProfiles|Validate" msgid "DastSiteValidation|Text file validation"
msgstr "" msgstr ""
msgid "DastProfiles|Validating..." msgid "DastSiteValidation|Validate"
msgstr "" msgstr ""
msgid "DastProfiles|Validation failed, please make sure that you follow the steps above with the chosen method." msgid "DastSiteValidation|Validate target site"
msgstr "" msgstr ""
msgid "Data is still calculating..." msgid "Data is still calculating..."
......
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