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
3800b865
Commit
3800b865
authored
May 19, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose Group-level vulnerability export url
parent
42fce179
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
8 deletions
+35
-8
ee/app/helpers/groups/security_features_helper.rb
ee/app/helpers/groups/security_features_helper.rb
+14
-0
ee/app/views/groups/security/dashboard/show.html.haml
ee/app/views/groups/security/dashboard/show.html.haml
+1
-8
ee/spec/helpers/groups/security_features_helper_spec.rb
ee/spec/helpers/groups/security_features_helper_spec.rb
+20
-0
No files found.
ee/app/helpers/groups/security_features_helper.rb
View file @
3800b865
...
...
@@ -25,4 +25,18 @@ module Groups::SecurityFeaturesHelper
group_security_credentials_path
(
group
)
end
end
def
group_level_security_dashboard_data
(
group
)
{
vulnerabilities_endpoint:
group_security_vulnerability_findings_path
(
group
),
vulnerabilities_history_endpoint:
history_group_security_vulnerability_findings_path
(
group
),
projects_endpoint:
expose_url
(
api_v4_groups_projects_path
(
id:
group
.
id
)),
group_full_path:
group
.
full_path
,
vulnerability_feedback_help_path:
help_page_path
(
"user/application_security/index"
,
anchor:
"interacting-with-the-vulnerabilities"
),
empty_state_svg_path:
image_path
(
'illustrations/security-dashboard-empty-state.svg'
),
dashboard_documentation:
help_page_path
(
'user/application_security/security_dashboard/index'
),
vulnerable_projects_endpoint:
group_security_vulnerable_projects_path
(
group
),
vulnerabilities_export_endpoint:
expose_path
(
api_v4_security_groups_vulnerability_exports_path
(
id:
group
.
id
))
}
end
end
ee/app/views/groups/security/dashboard/show.html.haml
View file @
3800b865
-
breadcrumb_title
_
(
"Security Dashboard"
)
-
page_title
_
(
"Security Dashboard"
)
#js-group-security-dashboard
{
data:
{
vulnerabilities_endpoint:
group_security_vulnerability_findings_path
(
@group
),
vulnerabilities_history_endpoint:
history_group_security_vulnerability_findings_path
(
@group
),
projects_endpoint:
expose_url
(
api_v4_groups_projects_path
(
id:
@group
.
id
)),
group_full_path:
@group
.
full_path
,
vulnerability_feedback_help_path:
help_page_path
(
"user/application_security/index"
,
anchor:
"interacting-with-the-vulnerabilities"
),
empty_state_svg_path:
image_path
(
'illustrations/security-dashboard-empty-state.svg'
),
dashboard_documentation:
help_page_path
(
'user/application_security/security_dashboard/index'
),
vulnerable_projects_endpoint:
group_security_vulnerable_projects_path
(
@group
)
}
}
#js-group-security-dashboard
{
data:
group_level_security_dashboard_data
(
@group
)
}
ee/spec/helpers/groups/security_features_helper_spec.rb
View file @
3800b865
...
...
@@ -119,4 +119,24 @@ describe Groups::SecurityFeaturesHelper do
end
end
end
describe
'#group_level_security_dashboard_data'
do
let
(
:expected_data
)
do
{
vulnerabilities_endpoint:
"/groups/
#{
group
.
full_path
}
/-/security/vulnerability_findings"
,
vulnerabilities_history_endpoint:
"/groups/
#{
group
.
full_path
}
/-/security/vulnerability_findings/history"
,
projects_endpoint:
"http://localhost/api/v4/groups/
#{
group
.
id
}
/projects"
,
group_full_path:
group
.
full_path
,
vulnerability_feedback_help_path:
'/help/user/application_security/index#interacting-with-the-vulnerabilities'
,
empty_state_svg_path:
'/images/illustrations/security-dashboard-empty-state.svg'
,
dashboard_documentation:
'/help/user/application_security/security_dashboard/index'
,
vulnerable_projects_endpoint:
"/groups/
#{
group
.
full_path
}
/-/security/vulnerable_projects"
,
vulnerabilities_export_endpoint:
"/api/v4/security/groups/
#{
group
.
id
}
/vulnerability_exports"
}
end
subject
{
group_level_security_dashboard_data
(
group
)
}
it
{
is_expected
.
to
eq
(
expected_data
)
}
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