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
b18345fa
Commit
b18345fa
authored
Oct 01, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter user sensitive data from discussions JSON
parent
e5d3a75a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
app/serializers/discussion_entity.rb
app/serializers/discussion_entity.rb
+1
-1
spec/fixtures/api/schemas/entities/note_user_entity.json
spec/fixtures/api/schemas/entities/note_user_entity.json
+21
-0
spec/serializers/discussion_entity_spec.rb
spec/serializers/discussion_entity_spec.rb
+7
-0
No files found.
app/serializers/discussion_entity.rb
View file @
b18345fa
...
...
@@ -27,7 +27,7 @@ class DiscussionEntity < Grape::Entity
expose
:resolved?
,
as: :resolved
expose
:resolved_by_push?
,
as: :resolved_by_push
expose
:resolved_by
expose
:resolved_by
,
using:
NoteUserEntity
expose
:resolved_at
expose
:resolve_path
,
if:
->
(
d
,
_
)
{
d
.
resolvable?
}
do
|
discussion
|
resolve_project_merge_request_discussion_path
(
discussion
.
project
,
discussion
.
noteable
,
discussion
.
id
)
...
...
spec/fixtures/api/schemas/entities/note_user_entity.json
0 → 100644
View file @
b18345fa
{
"type"
:
"object"
,
"required"
:
[
"id"
,
"state"
,
"avatar_url"
,
"path"
,
"name"
,
"username"
],
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"state"
:
{
"type"
:
"string"
},
"avatar_url"
:
{
"type"
:
"string"
},
"path"
:
{
"type"
:
"string"
},
"name"
:
{
"type"
:
"string"
},
"username"
:
{
"type"
:
"string"
},
"status_tooltip_html"
:
{
"$ref"
:
"../types/nullable_string.json"
}
},
"additionalProperties"
:
false
}
spec/serializers/discussion_entity_spec.rb
View file @
b18345fa
...
...
@@ -36,6 +36,13 @@ describe DiscussionEntity do
)
end
it
'resolved_by matches note_user_entity schema'
do
Notes
::
ResolveService
.
new
(
note
.
project
,
user
).
execute
(
note
)
expect
(
subject
[
:resolved_by
].
with_indifferent_access
)
.
to
match_schema
(
'entities/note_user_entity'
)
end
context
'when is LegacyDiffDiscussion'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
...
...
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