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
a5d11593
Commit
a5d11593
authored
Apr 13, 2021
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vulnerabilities query use GlobalID for scannerID
parent
9d6730da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
ee/app/assets/javascripts/security_dashboard/graphql/queries/instance_vulnerabilities.query.graphql
...rd/graphql/queries/instance_vulnerabilities.query.graphql
+1
-1
ee/app/graphql/resolvers/vulnerabilities_resolver.rb
ee/app/graphql/resolvers/vulnerabilities_resolver.rb
+9
-1
ee/changelogs/unreleased/293843-expand-filtering-functionality-of-vulnerabilities-scanner-gid.yml
...iltering-functionality-of-vulnerabilities-scanner-gid.yml
+5
-0
No files found.
ee/app/assets/javascripts/security_dashboard/graphql/queries/instance_vulnerabilities.query.graphql
View file @
a5d11593
...
...
@@ -8,7 +8,7 @@ query instance(
$severity
:
[
VulnerabilitySeverity
!]
$reportType
:
[
VulnerabilityReportType
!]
$scanner
:
[
String
!]
$scannerId
:
[
I
nt
!]
$scannerId
:
[
I
D
!]
$state
:
[
VulnerabilityState
!]
$sort
:
VulnerabilitySort
$hasIssues
:
Boolean
...
...
ee/app/graphql/resolvers/vulnerabilities_resolver.rb
View file @
a5d11593
...
...
@@ -26,7 +26,7 @@ module Resolvers
required:
false
,
description:
'Filter vulnerabilities by VulnerabilityScanner.externalId.'
argument
:scanner_id
,
[
GraphQL
::
INT_TYPE
],
argument
:scanner_id
,
[
::
Types
::
GlobalIDType
[
::
Vulnerabilities
::
Scanner
]
],
required:
false
,
description:
'Filter vulnerabilities by scanner ID.'
...
...
@@ -46,6 +46,8 @@ module Resolvers
def
resolve
(
**
args
)
return
Vulnerability
.
none
unless
vulnerable
args
[
:scanner_id
]
=
resolve_gids
(
args
[
:scanner_id
],
::
Vulnerabilities
::
Scanner
)
if
args
[
:scanner_id
]
vulnerabilities
(
args
)
.
with_findings_scanner_and_identifiers
.
with_created_issue_links_and_issues
...
...
@@ -53,6 +55,12 @@ module Resolvers
private
def
resolve_gids
(
gids
,
gid_class
)
gids
.
map
do
|
gid
|
Types
::
GlobalIDType
[
gid_class
].
coerce_isolated_input
(
gid
).
model_id
end
end
def
vulnerabilities
(
params
)
Security
::
VulnerabilitiesFinder
.
new
(
vulnerable
,
params
).
execute
end
...
...
ee/changelogs/unreleased/293843-expand-filtering-functionality-of-vulnerabilities-scanner-gid.yml
0 → 100644
View file @
a5d11593
---
title
:
Change vulnerabilities GraphQL query to use GlobalID for scanner IDs
merge_request
:
59305
author
:
type
:
changed
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