Add dast_pre_scan_verification field to ProfileType
What does this MR do and why?
This Merge Request adds the PreScanVerification
to the GraphQL api. This new type will be used to return the pre-scan validation status as described here.
This Merge Request is related to issue #379049
Screenshots or screen recordings
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
pre-scan verification
records
Create the - Start the rails console
rails c
- Create the records
dpsv = dpsv = Dast::PreScanVerification.create(dast_profile: Dast::Profile.last, ci_pipeline: Ci::Pipeline.last)
Dast::PreScanVerificationStep.create(name: 'connection', dast_pre_scan_verification: dpsv)
Dast::PreScanVerificationStep.create(name: 'authentication', dast_pre_scan_verification: dpsv, verification_errors: ['Actionable error message'])
Dast::PreScanVerificationStep.create(name: 'crawling', dast_pre_scan_verification: dpsv)
pre-scan verification
Query the - Go to
/-/graphql-explorer
- Add a Query like
{
project(fullPath: "root/apiscantest") {
dastProfiles {
nodes {
dastPreScanVerification {
status
valid
preScanVerificationSteps {
name
errors
success
}
}
}
}
}
}
- Check the results
{
"data": {
"project": {
"dastProfiles": {
"nodes": [
{
"dastPreScanVerification": null
},
{
"dastPreScanVerification": {
"status": "COMPLETE_WITH_ERRORS",
"valid": true,
"preScanVerificationSteps": [
{
"name": "connection",
"errors": [],
"success": true
},
{
"name": "authentication",
"errors": [
"Actionable error message"
],
"success": false
},
{
"name": "crawling",
"errors": [],
"success": true
}
]
}
}
]
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marcos Rocha