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
9cf652fe
Commit
9cf652fe
authored
Nov 22, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unmask scope and state in url masking
parent
e3b07c65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
app/helpers/routing/pseudonymization_helper.rb
app/helpers/routing/pseudonymization_helper.rb
+4
-1
spec/helpers/routing/pseudonymization_helper_spec.rb
spec/helpers/routing/pseudonymization_helper_spec.rb
+2
-2
No files found.
app/helpers/routing/pseudonymization_helper.rb
View file @
9cf652fe
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
module
Routing
module
Routing
module
PseudonymizationHelper
module
PseudonymizationHelper
class
MaskHelper
class
MaskHelper
QUERY_PARAMS_TO_NOT_MASK
=
%w[]
.
freeze
QUERY_PARAMS_TO_NOT_MASK
=
%w[
scope
state
]
.
freeze
def
initialize
(
request_object
,
group
,
project
)
def
initialize
(
request_object
,
group
,
project
)
@request
=
request_object
@request
=
request_object
...
...
spec/helpers/routing/pseudonymization_helper_spec.rb
View file @
9cf652fe
...
@@ -160,7 +160,7 @@ RSpec.describe ::Routing::PseudonymizationHelper do
...
@@ -160,7 +160,7 @@ RSpec.describe ::Routing::PseudonymizationHelper do
end
end
context
'when author_username is present'
do
context
'when author_username is present'
do
let
(
:masked_url
)
{
"http://localhost/dashboard/issues?author_username=masked_author_username&scope=
masked_scope&state=masked_state
"
}
let
(
:masked_url
)
{
"http://localhost/dashboard/issues?author_username=masked_author_username&scope=
all&state=opened
"
}
let
(
:request
)
do
let
(
:request
)
do
double
(
:Request
,
double
(
:Request
,
path_parameters:
{
path_parameters:
{
...
@@ -201,7 +201,7 @@ RSpec.describe ::Routing::PseudonymizationHelper do
...
@@ -201,7 +201,7 @@ RSpec.describe ::Routing::PseudonymizationHelper do
end
end
context
'when query string has keys with the same names as path params'
do
context
'when query string has keys with the same names as path params'
do
let
(
:masked_url
)
{
"http://localhost/dashboard/issues?action=masked_action&scope=
masked_scope&state=masked_state
"
}
let
(
:masked_url
)
{
"http://localhost/dashboard/issues?action=masked_action&scope=
all&state=opened
"
}
let
(
:request
)
do
let
(
:request
)
do
double
(
:Request
,
double
(
:Request
,
path_parameters:
{
path_parameters:
{
...
...
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