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
eb53bce4
Commit
eb53bce4
authored
Jan 26, 2022
by
Thiago Figueiró
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove instance_security_dashboard feature flag
Changelog: removed
parent
5844f1b7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
74 deletions
+11
-74
ee/app/controllers/security/application_controller.rb
ee/app/controllers/security/application_controller.rb
+0
-6
ee/app/helpers/ee/dashboard_helper.rb
ee/app/helpers/ee/dashboard_helper.rb
+1
-2
ee/config/feature_flags/development/instance_security_dashboard.yml
...feature_flags/development/instance_security_dashboard.yml
+0
-8
ee/spec/controllers/security/projects_controller_spec.rb
ee/spec/controllers/security/projects_controller_spec.rb
+0
-10
ee/spec/helpers/ee/dashboard_helper_spec.rb
ee/spec/helpers/ee/dashboard_helper_spec.rb
+10
-28
ee/spec/support/shared_examples/controllers/security/application_controller_shared_examples.rb
...ollers/security/application_controller_shared_examples.rb
+0
-10
ee/spec/support/shared_examples/requests/security/security_dashboard_json_endpoint_shared_examples.rb
...urity/security_dashboard_json_endpoint_shared_examples.rb
+0
-10
No files found.
ee/app/controllers/security/application_controller.rb
View file @
eb53bce4
...
...
@@ -4,9 +4,7 @@ module Security
class
ApplicationController
<
::
ApplicationController
include
SecurityDashboardsPermissions
before_action
:check_feature_enabled!
before_action
do
push_frontend_feature_flag
(
:instance_security_dashboard
,
default_enabled:
true
)
push_frontend_feature_flag
(
:vulnerability_management_survey
,
type: :ops
,
default_enabled: :yaml
)
end
...
...
@@ -14,10 +12,6 @@ module Security
protected
def
check_feature_enabled!
render_404
unless
Feature
.
enabled?
(
:instance_security_dashboard
,
default_enabled:
true
)
end
def
vulnerable
@vulnerable
||=
InstanceSecurityDashboard
.
new
(
current_user
,
...
...
ee/app/helpers/ee/dashboard_helper.rb
View file @
eb53bce4
...
...
@@ -50,8 +50,7 @@ module EE
def
security_dashboard_available?
security_dashboard
=
InstanceSecurityDashboard
.
new
(
current_user
)
::
Feature
.
enabled?
(
:instance_security_dashboard
,
default_enabled:
true
)
&&
security_dashboard
.
feature_available?
(
:security_dashboard
)
&&
security_dashboard
.
feature_available?
(
:security_dashboard
)
&&
can?
(
current_user
,
:read_instance_security_dashboard
,
security_dashboard
)
end
end
...
...
ee/config/feature_flags/development/instance_security_dashboard.yml
deleted
100644 → 0
View file @
5844f1b7
---
name
:
instance_security_dashboard
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24505
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/259285
milestone
:
'
12.8'
type
:
development
group
:
group::threat insights
default_enabled
:
true
ee/spec/controllers/security/projects_controller_spec.rb
View file @
eb53bce4
...
...
@@ -153,16 +153,6 @@ RSpec.describe Security::ProjectsController do
end
end
context
'and the security dashboard feature is disabled'
do
it
'404s'
do
stub_feature_flags
(
instance_security_dashboard:
false
)
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
it
"removes the project from the current user's security dashboard"
do
subject
...
...
ee/spec/helpers/ee/dashboard_helper_spec.rb
View file @
eb53bce4
...
...
@@ -79,41 +79,24 @@ RSpec.describe DashboardHelper, type: :helper do
end
describe
'security dashboard link'
do
context
'
when the feature is enabled
'
do
context
'
and the feature is available on the license
'
do
before
do
stub_
feature_flags
(
instance_
security_dashboard:
true
)
stub_
licensed_features
(
security_dashboard:
true
)
end
context
'and the
feature is available on the license
'
do
context
'and the
user is authenticated
'
do
before
do
stub_licensed_features
(
security_dashboard:
true
)
end
context
'and the user is authenticated'
do
before
do
stub_user_permissions_for
(
:security
,
true
)
end
it
'is included in the nav'
do
expect
(
helper
.
dashboard_nav_links
).
to
include
(
:security
)
end
stub_user_permissions_for
(
:security
,
true
)
end
context
'and the user is not authenticated'
do
before
do
stub_user_permissions_for
(
:security
,
false
)
end
it
'is not included in the nav'
do
expect
(
helper
.
dashboard_nav_links
).
not_to
include
(
:security
)
end
it
'is included in the nav'
do
expect
(
helper
.
dashboard_nav_links
).
to
include
(
:security
)
end
end
context
'
when the feature is not available on the license
'
do
context
'
and the user is not authenticated
'
do
before
do
stub_licensed_features
(
security_dashboard:
false
)
stub_user_permissions_for
(
:security
,
true
)
stub_user_permissions_for
(
:security
,
false
)
end
it
'is not included in the nav'
do
...
...
@@ -122,10 +105,9 @@ RSpec.describe DashboardHelper, type: :helper do
end
end
context
'when the feature is not
enabled
'
do
context
'when the feature is not
available on the license
'
do
before
do
stub_feature_flags
(
instance_security_dashboard:
false
)
stub_licensed_features
(
security_dashboard:
true
)
stub_licensed_features
(
security_dashboard:
false
)
stub_user_permissions_for
(
:security
,
true
)
end
...
...
ee/spec/support/shared_examples/controllers/security/application_controller_shared_examples.rb
View file @
eb53bce4
...
...
@@ -24,16 +24,6 @@ RSpec.shared_examples Security::ApplicationController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'and the security dashboard feature is disabled'
do
it
'404s'
do
stub_feature_flags
(
instance_security_dashboard:
false
)
security_application_controller_child_action
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'when the user is not authenticated'
do
...
...
ee/spec/support/shared_examples/requests/security/security_dashboard_json_endpoint_shared_examples.rb
View file @
eb53bce4
...
...
@@ -25,16 +25,6 @@ RSpec.shared_examples 'security dashboard JSON endpoint' do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'and the security dashboard feature is disabled'
do
it
'404s'
do
stub_feature_flags
(
instance_security_dashboard:
false
)
security_dashboard_request
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'when the user is not authenticated'
do
...
...
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