Commit 09ee60ae authored by Dheeraj Joshi's avatar Dheeraj Joshi

Refactor DAST Profiles to use GraphQL fragments

  * Add DastScannerProfile fragment
  * Add DastSiteProfile fragment

EE: true
Changelog: changed
parent 2ad63f89
fragment DastScannerProfileFragment on DastScannerProfile {
__typename
id
profileName
spiderTimeout
targetTimeout
scanType
useAjaxSpider
showDebugMessages
editPath
referencedInSecurityPolicies
}
#import "./dast_scanner_profile.fragment.graphql"
mutation dastScannerProfileCreate($input: DastScannerProfileCreateInput!) { mutation dastScannerProfileCreate($input: DastScannerProfileCreateInput!) {
dastScannerProfileCreate(input: $input) { dastScannerProfileCreate(input: $input) {
id id
errors errors
dastScannerProfile {
...DastScannerProfileFragment
}
} }
} }
#import "./dast_scanner_profile.fragment.graphql"
mutation dastScannerProfileUpdate($input: DastScannerProfileUpdateInput!) { mutation dastScannerProfileUpdate($input: DastScannerProfileUpdateInput!) {
dastScannerProfileUpdate(input: $input) { dastScannerProfileUpdate(input: $input) {
id id
errors errors
dastScannerProfile {
...DastScannerProfileFragment
}
} }
} }
fragment DastSiteProfileFragment on DastSiteProfile {
__typename
id
profileName
normalizedTargetUrl
targetUrl
targetType
editPath
validationStatus
referencedInSecurityPolicies
auth {
enabled
url
usernameField
passwordField
username
}
excludedUrls
requestHeaders
}
#import "./dast_site_profile.fragment.graphql"
mutation dastSiteProfileCreate($input: DastSiteProfileCreateInput!) { mutation dastSiteProfileCreate($input: DastSiteProfileCreateInput!) {
dastSiteProfileCreate(input: $input) { dastSiteProfileCreate(input: $input) {
id id
errors errors
dastSiteProfile {
...DastSiteProfileFragment
}
} }
} }
#import "./dast_site_profile.fragment.graphql"
mutation dastSiteProfileUpdate($input: DastSiteProfileUpdateInput!) { mutation dastSiteProfileUpdate($input: DastSiteProfileUpdateInput!) {
dastSiteProfileUpdate(input: $input) { dastSiteProfileUpdate(input: $input) {
id id
errors errors
dastSiteProfile {
...DastSiteProfileFragment
}
} }
} }
#import "~/graphql_shared/fragments/page_info.fragment.graphql" #import "~/graphql_shared/fragments/page_info.fragment.graphql"
#import "ee/security_configuration/dast_profiles/dast_scanner_profiles/graphql/dast_scanner_profile.fragment.graphql"
query DastScannerProfiles( query DastScannerProfiles(
$fullPath: ID! $fullPath: ID!
...@@ -22,16 +23,7 @@ query DastScannerProfiles( ...@@ -22,16 +23,7 @@ query DastScannerProfiles(
...PageInfo ...PageInfo
} }
nodes { nodes {
__typename ...DastScannerProfileFragment
id
profileName
spiderTimeout
targetTimeout
scanType
useAjaxSpider
showDebugMessages
editPath
referencedInSecurityPolicies
} }
} }
} }
......
#import "~/graphql_shared/fragments/page_info.fragment.graphql" #import "~/graphql_shared/fragments/page_info.fragment.graphql"
#import "ee/security_configuration/dast_profiles/dast_site_profiles/graphql/dast_site_profile.fragment.graphql"
query DastSiteProfiles($fullPath: ID!, $after: String, $before: String, $first: Int, $last: Int) { query DastSiteProfiles($fullPath: ID!, $after: String, $before: String, $first: Int, $last: Int) {
project(fullPath: $fullPath) { project(fullPath: $fullPath) {
...@@ -11,24 +12,7 @@ query DastSiteProfiles($fullPath: ID!, $after: String, $before: String, $first: ...@@ -11,24 +12,7 @@ query DastSiteProfiles($fullPath: ID!, $after: String, $before: String, $first:
...PageInfo ...PageInfo
} }
nodes { nodes {
__typename ...DastSiteProfileFragment
id
profileName
normalizedTargetUrl
targetUrl
targetType
editPath
validationStatus
referencedInSecurityPolicies
auth {
enabled
url
usernameField
passwordField
username
}
excludedUrls
requestHeaders
} }
} }
} }
......
export const dastSiteProfileCreate = (errors = []) => ({ export const dastSiteProfileCreate = (errors = []) => ({
data: { dastSiteProfileCreate: { id: '3083', errors } }, data: { dastSiteProfileCreate: { id: '3083', errors, dastSiteProfile: { id: '3083' } } },
}); });
export const dastSiteProfileUpdate = (errors = []) => ({ export const dastSiteProfileUpdate = (errors = []) => ({
data: { dastSiteProfileUpdate: { id: '3083', errors } }, data: { dastSiteProfileUpdate: { id: '3083', errors, dastSiteProfile: { id: '3083' } } },
}); });
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