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
733a4bdd
Commit
733a4bdd
authored
Oct 13, 2020
by
Dheeraj Joshi
Committed by
Kerri Miller
Oct 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix disabling options in scanner profile
This should fix updating DAST scanner profile with false values
parent
6285814e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
ee/app/services/dast_scanner_profiles/update_service.rb
ee/app/services/dast_scanner_profiles/update_service.rb
+2
-2
ee/changelogs/unreleased/dj-fix-dast-boolean.yml
ee/changelogs/unreleased/dj-fix-dast-boolean.yml
+5
-0
ee/spec/services/dast_scanner_profiles/update_service_spec.rb
...pec/services/dast_scanner_profiles/update_service_spec.rb
+18
-3
No files found.
ee/app/services/dast_scanner_profiles/update_service.rb
View file @
733a4bdd
...
...
@@ -16,8 +16,8 @@ module DastScannerProfiles
spider_timeout:
spider_timeout
}
update_args
[
:scan_type
]
=
scan_type
if
scan_type
update_args
[
:use_ajax_spider
]
=
use_ajax_spider
if
use_ajax_spider
update_args
[
:show_debug_messages
]
=
show_debug_messages
if
show_debug_messages
update_args
[
:use_ajax_spider
]
=
use_ajax_spider
unless
use_ajax_spider
.
nil?
update_args
[
:show_debug_messages
]
=
show_debug_messages
unless
show_debug_messages
.
nil?
if
dast_scanner_profile
.
update
(
update_args
)
ServiceResponse
.
success
(
payload:
dast_scanner_profile
)
...
...
ee/changelogs/unreleased/dj-fix-dast-boolean.yml
0 → 100644
View file @
733a4bdd
---
title
:
Fix disabling options in scanner profile
merge_request
:
44937
author
:
type
:
fixed
ee/spec/services/dast_scanner_profiles/update_service_spec.rb
View file @
733a4bdd
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
DastScannerProfiles
::
UpdateService
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:dast_scanner_profile
,
reload:
true
)
{
create
(
:dast_scanner_profile
,
target_timeout:
200
,
spider_timeout:
5000
)
}
let_it_be
(
:dast_scanner_profile_2
,
reload:
true
)
{
create
(
:dast_scanner_profile
,
target_timeout:
200
,
spider_timeout:
5000
)
}
let_it_be
(
:dast_scanner_profile_2
,
reload:
true
)
{
create
(
:dast_scanner_profile
)
}
let
(
:project
)
{
dast_scanner_profile
.
project
}
let
(
:project_2
)
{
dast_scanner_profile_2
.
project
}
...
...
@@ -13,8 +13,8 @@ RSpec.describe DastScannerProfiles::UpdateService do
let_it_be
(
:new_target_timeout
)
{
dast_scanner_profile
.
target_timeout
+
1
}
let_it_be
(
:new_spider_timeout
)
{
dast_scanner_profile
.
spider_timeout
+
1
}
let_it_be
(
:new_scan_type
)
{
(
DastScannerProfile
.
scan_types
.
keys
-
[
DastScannerProfile
.
last
.
scan_type
]).
first
}
let
_it_be
(
:new_use_ajax_spider
)
{
!
dast_scanner_profile
.
use_ajax_spider
}
let
_it_be
(
:new_show_debug_messages
)
{
!
dast_scanner_profile
.
show_debug_messages
}
let
(
:new_use_ajax_spider
)
{
!
dast_scanner_profile
.
use_ajax_spider
}
let
(
:new_show_debug_messages
)
{
!
dast_scanner_profile
.
show_debug_messages
}
before
do
stub_licensed_features
(
security_on_demand_scans:
true
)
...
...
@@ -118,6 +118,21 @@ RSpec.describe DastScannerProfiles::UpdateService do
end
end
context
'when setting properties to false'
do
let_it_be
(
:dast_scanner_profile
,
reload:
true
)
{
create
(
:dast_scanner_profile
,
target_timeout:
200
,
spider_timeout:
5000
,
use_ajax_spider:
true
,
show_debug_messages:
true
)
}
let
(
:new_use_ajax_spider
)
{
false
}
let
(
:new_show_debug_messages
)
{
false
}
it
'updates the dast_scanner_profile'
do
updated_dast_scanner_profile
=
payload
.
reload
aggregate_failures
do
expect
(
updated_dast_scanner_profile
.
use_ajax_spider
).
to
eq
(
new_use_ajax_spider
)
expect
(
updated_dast_scanner_profile
.
show_debug_messages
).
to
eq
(
new_show_debug_messages
)
end
end
end
it
'returns a dast_scanner_profile payload'
do
expect
(
payload
).
to
be_a
(
DastScannerProfile
)
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