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
85608fe3
Commit
85608fe3
authored
Sep 08, 2021
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add traits for dast_site_profile_secret_variable
- Adds password and request_headers traits
parent
9bc09614
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
9 deletions
+17
-9
ee/spec/factories/dast/site_profile_secret_variables.rb
ee/spec/factories/dast/site_profile_secret_variables.rb
+8
-0
ee/spec/graphql/mutations/dast_site_profiles/update_spec.rb
ee/spec/graphql/mutations/dast_site_profiles/update_spec.rb
+2
-2
ee/spec/graphql/types/dast/site_profile_auth_type_spec.rb
ee/spec/graphql/types/dast/site_profile_auth_type_spec.rb
+1
-1
ee/spec/graphql/types/dast_site_profile_type_spec.rb
ee/spec/graphql/types/dast_site_profile_type_spec.rb
+1
-1
ee/spec/models/ci/build_spec.rb
ee/spec/models/ci/build_spec.rb
+1
-1
ee/spec/requests/projects/security/dast_site_profiles_controller_spec.rb
...s/projects/security/dast_site_profiles_controller_spec.rb
+2
-2
ee/spec/services/app_sec/dast/site_profiles/update_service_spec.rb
...ervices/app_sec/dast/site_profiles/update_service_spec.rb
+2
-2
No files found.
ee/spec/factories/dast/site_profile_secret_variables.rb
View file @
85608fe3
...
...
@@ -6,5 +6,13 @@ FactoryBot.define do
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
raw_value
{
'VARIABLE_VALUE'
}
trait
:password
do
key
{
Dast
::
SiteProfileSecretVariable
::
PASSWORD
}
end
trait
:request_headers
do
key
{
Dast
::
SiteProfileSecretVariable
::
REQUEST_HEADERS
}
end
end
end
ee/spec/graphql/mutations/dast_site_profiles/update_spec.rb
View file @
85608fe3
...
...
@@ -106,8 +106,8 @@ RSpec.describe Mutations::DastSiteProfiles::Update do
end
context
'when secret variables already exist'
do
let_it_be
(
:request_headers_variable
)
{
create
(
:dast_site_profile_secret_variable
,
key:
Dast
::
SiteProfileSecretVariable
::
REQUEST_HEADERS
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:password_variable
)
{
create
(
:dast_site_profile_secret_variable
,
key:
Dast
::
SiteProfileSecretVariable
::
PASSWORD
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:request_headers_variable
)
{
create
(
:dast_site_profile_secret_variable
,
:request_headers
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:password_variable
)
{
create
(
:dast_site_profile_secret_variable
,
:password
,
dast_site_profile:
dast_site_profile
)
}
context
'when the arguments are omitted'
do
subject
do
...
...
ee/spec/graphql/types/dast/site_profile_auth_type_spec.rb
View file @
85608fe3
...
...
@@ -58,7 +58,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfileAuth'] do
context
'when there an associated secret variable'
do
it
'is redacted'
do
create
(
:dast_site_profile_secret_variable
,
dast_site_profile:
object
,
key:
Dast
::
SiteProfileSecretVariable
::
PASSWORD
)
create
(
:dast_site_profile_secret_variable
,
:password
,
dast_site_profile:
object
)
expect
(
resolve_field
(
:password
,
object
,
current_user:
user
)).
to
eq
(
'••••••••'
)
end
...
...
ee/spec/graphql/types/dast_site_profile_type_spec.rb
View file @
85608fe3
...
...
@@ -75,7 +75,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
context
'when there an associated secret variable'
do
it
'is redacted'
do
create
(
:dast_site_profile_secret_variable
,
dast_site_profile:
object
,
key:
Dast
::
SiteProfileSecretVariable
::
REQUEST_HEADERS
)
create
(
:dast_site_profile_secret_variable
,
:request_headers
,
dast_site_profile:
object
)
expect
(
resolve_field
(
:request_headers
,
object
,
current_user:
user
)).
to
eq
(
'••••••••'
)
end
...
...
ee/spec/models/ci/build_spec.rb
View file @
85608fe3
...
...
@@ -122,7 +122,7 @@ RSpec.describe Ci::Build do
let_it_be
(
:user
)
{
create
(
:user
,
developer_projects:
[
project
])
}
let_it_be
(
:dast_site_profile
)
{
create
(
:dast_site_profile
,
project:
project
)
}
let_it_be
(
:dast_scanner_profile
)
{
create
(
:dast_scanner_profile
,
project:
project
)
}
let_it_be
(
:dast_site_profile_secret_variable
)
{
create
(
:dast_site_profile_secret_variable
,
key:
'DAST_PASSWORD_BASE64'
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:dast_site_profile_secret_variable
)
{
create
(
:dast_site_profile_secret_variable
,
:password
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:options
)
{
{
dast_configuration:
{
site_profile:
dast_site_profile
.
name
,
scanner_profile:
dast_scanner_profile
.
name
}
}
}
before
do
...
...
ee/spec/requests/projects/security/dast_site_profiles_controller_spec.rb
View file @
85608fe3
...
...
@@ -97,8 +97,8 @@ RSpec.describe Projects::Security::DastSiteProfilesController, type: :request do
context
'record exists'
do
before
do
create
(
:dast_site_profile_secret_variable
,
dast_site_profile:
dast_site_profile
,
key:
Dast
::
SiteProfileSecretVariable
::
PASSWORD
)
create
(
:dast_site_profile_secret_variable
,
dast_site_profile:
dast_site_profile
,
key:
Dast
::
SiteProfileSecretVariable
::
REQUEST_HEADERS
)
create
(
:dast_site_profile_secret_variable
,
:password
,
dast_site_profile:
dast_site_profile
)
create
(
:dast_site_profile_secret_variable
,
:request_headers
,
dast_site_profile:
dast_site_profile
)
end
it
'includes a serialized dast_profile in the response body'
do
...
...
ee/spec/services/app_sec/dast/site_profiles/update_service_spec.rb
View file @
85608fe3
...
...
@@ -8,8 +8,8 @@ RSpec.describe AppSec::Dast::SiteProfiles::UpdateService do
let_it_be
(
:dast_site_profile
)
{
create
(
:dast_site_profile
,
project:
project
)
}
let_it_be
(
:dast_site_profile_id
)
{
dast_site_profile
.
id
}
let_it_be
(
:request_headers_variable
)
{
create
(
:dast_site_profile_secret_variable
,
key:
Dast
::
SiteProfileSecretVariable
::
REQUEST_HEADERS
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:password_variable
)
{
create
(
:dast_site_profile_secret_variable
,
key:
Dast
::
SiteProfileSecretVariable
::
PASSWORD
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:request_headers_variable
)
{
create
(
:dast_site_profile_secret_variable
,
:request_headers
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:password_variable
)
{
create
(
:dast_site_profile_secret_variable
,
:password
,
dast_site_profile:
dast_site_profile
)
}
let_it_be
(
:new_profile_name
)
{
SecureRandom
.
hex
}
let_it_be
(
:new_target_url
)
{
generate
(
:url
)
}
...
...
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