Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c36a27bb
Commit
c36a27bb
authored
Jul 08, 2020
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mount DastSiteProfileCreate GraphQL mutation
Mounts mutation, generates documentation and adds some specs.
parent
8c5ecfa0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
263 additions
and
1 deletion
+263
-1
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+46
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+153
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+10
-0
ee/app/graphql/ee/types/mutation_type.rb
ee/app/graphql/ee/types/mutation_type.rb
+1
-0
ee/app/graphql/mutations/dast_site_profiles/create.rb
ee/app/graphql/mutations/dast_site_profiles/create.rb
+1
-1
ee/spec/requests/api/graphql/mutations/dast_site_profiles/create_spec.rb
...s/api/graphql/mutations/dast_site_profiles/create_spec.rb
+52
-0
No files found.
doc/api/graphql/reference/gitlab_schema.graphql
View file @
c36a27bb
...
@@ -2064,6 +2064,51 @@ enum DastScanTypeEnum {
...
@@ -2064,6 +2064,51 @@ enum DastScanTypeEnum {
PASSIVE
PASSIVE
}
}
"""
Autogenerated input type of DastSiteProfileCreate
"""
input
DastSiteProfileCreateInput
{
"""
A
unique
identifier
for
the
client
performing
the
mutation
.
"""
clientMutationId
:
String
"""
The
project
the
site
profile
belongs
to
.
"""
fullPath
:
ID
!
"""
The
name
of
the
site
profile
.
"""
profileName
:
String
!
"""
The
URL
of
the
target
to
be
scanned
.
"""
targetUrl
:
String
}
"""
Autogenerated return type of DastSiteProfileCreate
"""
type
DastSiteProfileCreatePayload
{
"""
A
unique
identifier
for
the
client
performing
the
mutation
.
"""
clientMutationId
:
String
"""
Errors
encountered
during
execution
of
the
mutation
.
"""
errors
:
[
String
!]!
"""
ID
of
the
site
profile
.
"""
id
:
ID
}
"""
"""
Autogenerated input type of DeleteAnnotation
Autogenerated input type of DeleteAnnotation
"""
"""
...
@@ -7969,6 +8014,7 @@ type Mutation {
...
@@ -7969,6 +8014,7 @@ type Mutation {
createNote
(
input
:
CreateNoteInput
!):
CreateNotePayload
createNote
(
input
:
CreateNoteInput
!):
CreateNotePayload
createRequirement
(
input
:
CreateRequirementInput
!):
CreateRequirementPayload
createRequirement
(
input
:
CreateRequirementInput
!):
CreateRequirementPayload
createSnippet
(
input
:
CreateSnippetInput
!):
CreateSnippetPayload
createSnippet
(
input
:
CreateSnippetInput
!):
CreateSnippetPayload
dastSiteProfileCreate
(
input
:
DastSiteProfileCreateInput
!):
DastSiteProfileCreatePayload
deleteAnnotation
(
input
:
DeleteAnnotationInput
!):
DeleteAnnotationPayload
deleteAnnotation
(
input
:
DeleteAnnotationInput
!):
DeleteAnnotationPayload
designManagementDelete
(
input
:
DesignManagementDeleteInput
!):
DesignManagementDeletePayload
designManagementDelete
(
input
:
DesignManagementDeleteInput
!):
DesignManagementDeletePayload
designManagementUpload
(
input
:
DesignManagementUploadInput
!):
DesignManagementUploadPayload
designManagementUpload
(
input
:
DesignManagementUploadInput
!):
DesignManagementUploadPayload
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
c36a27bb
...
@@ -5523,6 +5523,132 @@
...
@@ -5523,6 +5523,132 @@
],
],
"possibleTypes": null
"possibleTypes": null
},
},
{
"kind": "INPUT_OBJECT",
"name": "DastSiteProfileCreateInput",
"description": "Autogenerated input type of DastSiteProfileCreate",
"fields": null,
"inputFields": [
{
"name": "fullPath",
"description": "The project the site profile belongs to.",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "profileName",
"description": "The name of the site profile.",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "targetUrl",
"description": "The URL of the target to be scanned.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "DastSiteProfileCreatePayload",
"description": "Autogenerated return type of DastSiteProfileCreate",
"fields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "errors",
"description": "Errors encountered during execution of the mutation.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": "ID of the site profile.",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
{
"kind": "INPUT_OBJECT",
"kind": "INPUT_OBJECT",
"name": "DeleteAnnotationInput",
"name": "DeleteAnnotationInput",
...
@@ -22811,6 +22937,33 @@
...
@@ -22811,6 +22937,33 @@
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
"name": "dastSiteProfileCreate",
"description": null,
"args": [
{
"name": "input",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "DastSiteProfileCreateInput",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "DastSiteProfileCreatePayload",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
{
"name": "deleteAnnotation",
"name": "deleteAnnotation",
"description": null,
"description": null,
doc/api/graphql/reference/index.md
View file @
c36a27bb
...
@@ -364,6 +364,16 @@ Autogenerated return type of CreateSnippet
...
@@ -364,6 +364,16 @@ Autogenerated return type of CreateSnippet
|
`errors`
| String! => Array | Errors encountered during execution of the mutation. |
|
`errors`
| String! => Array | Errors encountered during execution of the mutation. |
|
`snippet`
| Snippet | The snippet after mutation |
|
`snippet`
| Snippet | The snippet after mutation |
## DastSiteProfileCreatePayload
Autogenerated return type of DastSiteProfileCreate
| Name | Type | Description |
| --- | ---- | ---------- |
|
`clientMutationId`
| String | A unique identifier for the client performing the mutation. |
|
`errors`
| String! => Array | Errors encountered during execution of the mutation. |
|
`id`
| ID | ID of the site profile. |
## DeleteAnnotationPayload
## DeleteAnnotationPayload
Autogenerated return type of DeleteAnnotation
Autogenerated return type of DeleteAnnotation
...
...
ee/app/graphql/ee/types/mutation_type.rb
View file @
c36a27bb
...
@@ -22,6 +22,7 @@ module EE
...
@@ -22,6 +22,7 @@ module EE
mount_mutation
::
Mutations
::
InstanceSecurityDashboard
::
AddProject
mount_mutation
::
Mutations
::
InstanceSecurityDashboard
::
AddProject
mount_mutation
::
Mutations
::
InstanceSecurityDashboard
::
RemoveProject
mount_mutation
::
Mutations
::
InstanceSecurityDashboard
::
RemoveProject
mount_mutation
::
Mutations
::
Pipelines
::
RunDastScan
mount_mutation
::
Mutations
::
Pipelines
::
RunDastScan
mount_mutation
::
Mutations
::
DastSiteProfiles
::
Create
end
end
end
end
end
end
...
...
ee/app/graphql/mutations/dast_site_profiles/create.rb
View file @
c36a27bb
...
@@ -8,7 +8,7 @@ module Mutations
...
@@ -8,7 +8,7 @@ module Mutations
graphql_name
'DastSiteProfileCreate'
graphql_name
'DastSiteProfileCreate'
field
:id
,
GraphQL
::
ID_TYPE
,
field
:id
,
GraphQL
::
ID_TYPE
,
null:
fals
e
,
null:
tru
e
,
description:
'ID of the site profile.'
description:
'ID of the site profile.'
argument
:full_path
,
GraphQL
::
ID_TYPE
,
argument
:full_path
,
GraphQL
::
ID_TYPE
,
...
...
ee/spec/requests/api/graphql/mutations/dast_site_profiles/create_spec.rb
0 → 100644
View file @
c36a27bb
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Creating a DAST Site Profile'
do
include
GraphqlHelpers
let
(
:project
)
{
create
(
:project
,
:repository
,
creator:
current_user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:full_path
)
{
project
.
full_path
}
let
(
:profile_name
)
{
FFaker
::
Company
.
catch_phrase
}
let
(
:target_url
)
{
FFaker
::
Internet
.
uri
(
:https
)
}
let
(
:mutation
)
do
graphql_mutation
(
:dast_site_profile_create
,
full_path:
full_path
,
profile_name:
profile_name
,
target_url:
target_url
)
end
def
mutation_response
graphql_mutation_response
(
:dast_site_profile_create
)
end
context
'when on demand scan feature is not enabled'
do
it_behaves_like
'a mutation that returns top-level errors'
,
errors:
[
'The resource that you are attempting to access does not '
\
'exist or you don\'t have permission to perform this action'
]
end
context
'when on demand scan feature is enabled'
do
before
do
stub_feature_flags
(
security_on_demand_scans_feature_flag:
true
)
end
context
'when the user does not have permission to run a dast scan'
do
it_behaves_like
'a mutation that returns top-level errors'
,
errors:
[
'The resource that you are attempting to access does not '
\
'exist or you don\'t have permission to perform this action'
]
end
context
'when the user can run a dast scan'
do
before
do
project
.
add_developer
(
current_user
)
end
it_behaves_like
'a mutation that returns errors in the response'
,
errors:
[
'Not implemented'
]
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment