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
168c05ee
Commit
168c05ee
authored
Nov 30, 2020
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose normalizedTargetUrl on DastSiteProfile
Exposes new field on GraphQL type for frontend.
parent
fdc1d6a8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
1 deletion
+44
-1
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+14
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
ee/app/graphql/types/dast_site_profile_type.rb
ee/app/graphql/types/dast_site_profile_type.rb
+7
-0
ee/changelogs/unreleased/philipcunningham-expose-canonical-url-for-dast-site-profile-277403.yml
...ham-expose-canonical-url-for-dast-site-profile-277403.yml
+5
-0
ee/spec/graphql/types/dast_site_profile_type_spec.rb
ee/spec/graphql/types/dast_site_profile_type_spec.rb
+10
-1
ee/spec/requests/api/graphql/project/dast_site_profile_spec.rb
...ec/requests/api/graphql/project/dast_site_profile_spec.rb
+1
-0
ee/spec/requests/api/graphql/project/dast_site_profiles_spec.rb
...c/requests/api/graphql/project/dast_site_profiles_spec.rb
+1
-0
No files found.
doc/api/graphql/reference/gitlab_schema.graphql
View file @
168c05ee
...
...
@@ -5015,6 +5015,11 @@ type DastSiteProfile {
"""
id
:
DastSiteProfileID
!
"""
Normalized
URL
of
the
target
to
be
scanned
"""
normalizedTargetUrl
:
String
"""
The
name
of
the
site
profile
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
168c05ee
...
...
@@ -13726,6 +13726,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "normalizedTargetUrl",
"description": "Normalized URL of the target to be scanned",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "profileName",
"description": "The name of the site profile",
doc/api/graphql/reference/index.md
View file @
168c05ee
...
...
@@ -827,6 +827,7 @@ Represents a DAST Site Profile.
| ----- | ---- | ----------- |
|
`editPath`
| String | Relative web path to the edit page of a site profile |
|
`id`
| DastSiteProfileID! | ID of the site profile |
|
`normalizedTargetUrl`
| String | Normalized URL of the target to be scanned |
|
`profileName`
| String | The name of the site profile |
|
`targetUrl`
| String | The URL of the target to be scanned |
|
`userPermissions`
| DastSiteProfilePermissions! | Permissions for the current user on the resource |
...
...
ee/app/graphql/types/dast_site_profile_type.rb
View file @
168c05ee
...
...
@@ -26,6 +26,9 @@ module Types
description:
'The current validation status of the site profile'
,
method: :status
field
:normalized_target_url
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Normalized URL of the target to be scanned'
def
target_url
object
.
dast_site
.
url
end
...
...
@@ -33,5 +36,9 @@ module Types
def
edit_path
Rails
.
application
.
routes
.
url_helpers
.
edit_project_security_configuration_dast_profiles_dast_site_profile_path
(
object
.
project
,
object
)
end
def
normalized_target_url
DastSiteValidation
.
get_normalized_url_base
(
object
.
dast_site
.
url
)
end
end
end
ee/changelogs/unreleased/philipcunningham-expose-canonical-url-for-dast-site-profile-277403.yml
0 → 100644
View file @
168c05ee
---
title
:
Expose normalizedTargetUrl on DastSiteProfile GraphQL type
merge_request
:
48727
author
:
type
:
added
ee/spec/graphql/types/dast_site_profile_type_spec.rb
View file @
168c05ee
...
...
@@ -6,7 +6,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
let_it_be
(
:dast_site_profile
)
{
create
(
:dast_site_profile
)
}
let_it_be
(
:project
)
{
dast_site_profile
.
project
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:fields
)
{
%i[id profileName targetUrl editPath validationStatus userPermissions]
}
let_it_be
(
:fields
)
{
%i[id profileName targetUrl editPath validationStatus userPermissions
normalizedTargetUrl
]
}
subject
do
GitlabSchema
.
execute
(
...
...
@@ -46,6 +46,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
targetUrl
editPath
validationStatus
normalizedTargetUrl
}
}
}
...
...
@@ -89,6 +90,14 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
end
end
describe
'normalized_target_url field'
do
it
'is the normalized url of the associated dast_site'
do
normalized_url
=
DastSiteValidation
.
get_normalized_url_base
(
dast_site_profile
.
dast_site
.
url
)
expect
(
first_dast_site_profile
[
'normalizedTargetUrl'
]).
to
eq
(
normalized_url
)
end
end
context
'when there are no dast_site_profiles'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
ee/spec/requests/api/graphql/project/dast_site_profile_spec.rb
View file @
168c05ee
...
...
@@ -18,6 +18,7 @@ RSpec.describe 'Query.project(fullPath).dastSiteProfile' do
profileName
targetUrl
validationStatus
normalizedTargetUrl
}
}
}
...
...
ee/spec/requests/api/graphql/project/dast_site_profiles_spec.rb
View file @
168c05ee
...
...
@@ -23,6 +23,7 @@ RSpec.describe 'Query.project(fullPath).dastSiteProfiles' do
targetUrl
editPath
validationStatus
normalizedTargetUrl
}
}
}
...
...
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