BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7d127840
Commit
7d127840
authored
Feb 16, 2017
by
Rémy Coutable
Committed by
DJ Mountney
Mar 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '28058-hide-emails-in-atom-feeds' into 'security'
Only show public emails in atom feeds See merge request !2066
parent
f5c282bc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
15 deletions
+25
-15
issuable.rb
app/models/concerns/issuable.rb
+2
-0
event.rb
app/models/event.rb
+1
-1
_event.atom.builder
app/views/events/_event.atom.builder
+1
-1
_issue.atom.builder
app/views/issues/_issue.atom.builder
+2
-2
28058-hide-emails-in-atom-feeds.yml
changelogs/unreleased/28058-hide-emails-in-atom-feeds.yml
+4
-0
dashboard_issues_spec.rb
spec/features/atom/dashboard_issues_spec.rb
+8
-7
issues_spec.rb
spec/features/atom/issues_spec.rb
+7
-4
No files found.
app/models/concerns/issuable.rb
View file @
7d127840
...
@@ -48,11 +48,13 @@ module Issuable
...
@@ -48,11 +48,13 @@ module Issuable
delegate
:name
,
delegate
:name
,
:email
,
:email
,
:public_email
,
to: :author
,
to: :author
,
prefix:
true
prefix:
true
delegate
:name
,
delegate
:name
,
:email
,
:email
,
:public_email
,
to: :assignee
,
to: :assignee
,
allow_nil:
true
,
allow_nil:
true
,
prefix:
true
prefix:
true
...
...
app/models/event.rb
View file @
7d127840
...
@@ -16,7 +16,7 @@ class Event < ActiveRecord::Base
...
@@ -16,7 +16,7 @@ class Event < ActiveRecord::Base
RESET_PROJECT_ACTIVITY_INTERVAL
=
1
.
hour
RESET_PROJECT_ACTIVITY_INTERVAL
=
1
.
hour
delegate
:name
,
:email
,
to: :author
,
prefix:
true
,
allow_nil:
true
delegate
:name
,
:email
,
:public_email
,
to: :author
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :issue
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :issue
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :merge_request
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :merge_request
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :note
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :note
,
prefix:
true
,
allow_nil:
true
...
...
app/views/events/_event.atom.builder
View file @
7d127840
...
@@ -9,7 +9,7 @@ xml.entry do
...
@@ -9,7 +9,7 @@ xml.entry do
xml.author do
xml.author do
xml.name event.author_name
xml.name event.author_name
xml.email event.author_email
xml.email event.author_
public_
email
end
end
xml.summary(type: "xhtml") do |summary|
xml.summary(type: "xhtml") do |summary|
...
...
app/views/issues/_issue.atom.builder
View file @
7d127840
...
@@ -7,7 +7,7 @@ xml.entry do
...
@@ -7,7 +7,7 @@ xml.entry do
xml.author do
xml.author do
xml.name issue.author_name
xml.name issue.author_name
xml.email issue.author_email
xml.email issue.author_
public_
email
end
end
xml.summary issue.title
xml.summary issue.title
...
@@ -26,7 +26,7 @@ xml.entry do
...
@@ -26,7 +26,7 @@ xml.entry do
if issue.assignee
if issue.assignee
xml.assignee do
xml.assignee do
xml.name issue.assignee.name
xml.name issue.assignee.name
xml.email issue.assignee
.
email
xml.email issue.assignee
_public_
email
end
end
end
end
end
end
changelogs/unreleased/28058-hide-emails-in-atom-feeds.yml
0 → 100644
View file @
7d127840
---
title
:
Only show public emails in atom feeds
merge_request
:
author
:
spec/features/atom/dashboard_issues_spec.rb
View file @
7d127840
...
@@ -2,7 +2,8 @@ require 'spec_helper'
...
@@ -2,7 +2,8 @@ require 'spec_helper'
describe
"Dashboard Issues Feed"
,
feature:
true
do
describe
"Dashboard Issues Feed"
,
feature:
true
do
describe
"GET /issues"
do
describe
"GET /issues"
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
,
email:
'private1@example.com'
,
public_email:
'public1@example.com'
)
}
let!
(
:assignee
)
{
create
(
:user
,
email:
'private2@example.com'
,
public_email:
'public2@example.com'
)
}
let!
(
:project1
)
{
create
(
:project
)
}
let!
(
:project1
)
{
create
(
:project
)
}
let!
(
:project2
)
{
create
(
:project
)
}
let!
(
:project2
)
{
create
(
:project
)
}
...
@@ -31,7 +32,7 @@ describe "Dashboard Issues Feed", feature: true do
...
@@ -31,7 +32,7 @@ describe "Dashboard Issues Feed", feature: true do
end
end
context
"issue with basic fields"
do
context
"issue with basic fields"
do
let!
(
:issue2
)
{
create
(
:issue
,
author:
user
,
assignee:
user
,
project:
project2
,
description:
'test desc'
)
}
let!
(
:issue2
)
{
create
(
:issue
,
author:
user
,
assignee:
assignee
,
project:
project2
,
description:
'test desc'
)
}
it
"renders issue fields"
do
it
"renders issue fields"
do
visit
issues_dashboard_path
(
:atom
,
private_token:
user
.
private_token
)
visit
issues_dashboard_path
(
:atom
,
private_token:
user
.
private_token
)
...
@@ -39,8 +40,8 @@ describe "Dashboard Issues Feed", feature: true do
...
@@ -39,8 +40,8 @@ describe "Dashboard Issues Feed", feature: true do
entry
=
find
(
:xpath
,
"//feed/entry[contains(summary/text(),'
#{
issue2
.
title
}
')]"
)
entry
=
find
(
:xpath
,
"//feed/entry[contains(summary/text(),'
#{
issue2
.
title
}
')]"
)
expect
(
entry
).
to
be_present
expect
(
entry
).
to
be_present
expect
(
entry
).
to
have_selector
(
'author email'
,
text:
issue2
.
author_email
)
expect
(
entry
).
to
have_selector
(
'author email'
,
text:
issue2
.
author_
public_
email
)
expect
(
entry
).
to
have_selector
(
'assignee email'
,
text:
issue2
.
a
uthor
_email
)
expect
(
entry
).
to
have_selector
(
'assignee email'
,
text:
issue2
.
a
ssignee_public
_email
)
expect
(
entry
).
not_to
have_selector
(
'labels'
)
expect
(
entry
).
not_to
have_selector
(
'labels'
)
expect
(
entry
).
not_to
have_selector
(
'milestone'
)
expect
(
entry
).
not_to
have_selector
(
'milestone'
)
expect
(
entry
).
to
have_selector
(
'description'
,
text:
issue2
.
description
)
expect
(
entry
).
to
have_selector
(
'description'
,
text:
issue2
.
description
)
...
@@ -50,7 +51,7 @@ describe "Dashboard Issues Feed", feature: true do
...
@@ -50,7 +51,7 @@ describe "Dashboard Issues Feed", feature: true do
context
"issue with label and milestone"
do
context
"issue with label and milestone"
do
let!
(
:milestone1
)
{
create
(
:milestone
,
project:
project1
,
title:
'v1'
)
}
let!
(
:milestone1
)
{
create
(
:milestone
,
project:
project1
,
title:
'v1'
)
}
let!
(
:label1
)
{
create
(
:label
,
project:
project1
,
title:
'label1'
)
}
let!
(
:label1
)
{
create
(
:label
,
project:
project1
,
title:
'label1'
)
}
let!
(
:issue1
)
{
create
(
:issue
,
author:
user
,
assignee:
user
,
project:
project1
,
milestone:
milestone1
)
}
let!
(
:issue1
)
{
create
(
:issue
,
author:
user
,
assignee:
assignee
,
project:
project1
,
milestone:
milestone1
)
}
before
do
before
do
issue1
.
labels
<<
label1
issue1
.
labels
<<
label1
...
@@ -62,8 +63,8 @@ describe "Dashboard Issues Feed", feature: true do
...
@@ -62,8 +63,8 @@ describe "Dashboard Issues Feed", feature: true do
entry
=
find
(
:xpath
,
"//feed/entry[contains(summary/text(),'
#{
issue1
.
title
}
')]"
)
entry
=
find
(
:xpath
,
"//feed/entry[contains(summary/text(),'
#{
issue1
.
title
}
')]"
)
expect
(
entry
).
to
be_present
expect
(
entry
).
to
be_present
expect
(
entry
).
to
have_selector
(
'author email'
,
text:
issue1
.
author_email
)
expect
(
entry
).
to
have_selector
(
'author email'
,
text:
issue1
.
author_
public_
email
)
expect
(
entry
).
to
have_selector
(
'assignee email'
,
text:
issue1
.
a
uthor
_email
)
expect
(
entry
).
to
have_selector
(
'assignee email'
,
text:
issue1
.
a
ssignee_public
_email
)
expect
(
entry
).
to
have_selector
(
'labels label'
,
text:
label1
.
title
)
expect
(
entry
).
to
have_selector
(
'labels label'
,
text:
label1
.
title
)
expect
(
entry
).
to
have_selector
(
'milestone'
,
text:
milestone1
.
title
)
expect
(
entry
).
to
have_selector
(
'milestone'
,
text:
milestone1
.
title
)
expect
(
entry
).
not_to
have_selector
(
'description'
)
expect
(
entry
).
not_to
have_selector
(
'description'
)
...
...
spec/features/atom/issues_spec.rb
View file @
7d127840
...
@@ -2,10 +2,11 @@ require 'spec_helper'
...
@@ -2,10 +2,11 @@ require 'spec_helper'
describe
'Issues Feed'
,
feature:
true
do
describe
'Issues Feed'
,
feature:
true
do
describe
'GET /issues'
do
describe
'GET /issues'
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
,
email:
'private1@example.com'
,
public_email:
'public1@example.com'
)
}
let!
(
:assignee
)
{
create
(
:user
,
email:
'private2@example.com'
,
public_email:
'public2@example.com'
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:issue
)
{
create
(
:issue
,
author:
user
,
project:
project
)
}
let!
(
:issue
)
{
create
(
:issue
,
author:
user
,
assignee:
assignee
,
project:
project
)
}
before
do
before
do
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
...
@@ -20,7 +21,8 @@ describe 'Issues Feed', feature: true do
...
@@ -20,7 +21,8 @@ describe 'Issues Feed', feature: true do
expect
(
response_headers
[
'Content-Type'
]).
expect
(
response_headers
[
'Content-Type'
]).
to
have_content
(
'application/atom+xml'
)
to
have_content
(
'application/atom+xml'
)
expect
(
body
).
to
have_selector
(
'title'
,
text:
"
#{
project
.
name
}
issues"
)
expect
(
body
).
to
have_selector
(
'title'
,
text:
"
#{
project
.
name
}
issues"
)
expect
(
body
).
to
have_selector
(
'author email'
,
text:
issue
.
author_email
)
expect
(
body
).
to
have_selector
(
'author email'
,
text:
issue
.
author_public_email
)
expect
(
body
).
to
have_selector
(
'assignee email'
,
text:
issue
.
author_public_email
)
expect
(
body
).
to
have_selector
(
'entry summary'
,
text:
issue
.
title
)
expect
(
body
).
to
have_selector
(
'entry summary'
,
text:
issue
.
title
)
end
end
end
end
...
@@ -33,7 +35,8 @@ describe 'Issues Feed', feature: true do
...
@@ -33,7 +35,8 @@ describe 'Issues Feed', feature: true do
expect
(
response_headers
[
'Content-Type'
]).
expect
(
response_headers
[
'Content-Type'
]).
to
have_content
(
'application/atom+xml'
)
to
have_content
(
'application/atom+xml'
)
expect
(
body
).
to
have_selector
(
'title'
,
text:
"
#{
project
.
name
}
issues"
)
expect
(
body
).
to
have_selector
(
'title'
,
text:
"
#{
project
.
name
}
issues"
)
expect
(
body
).
to
have_selector
(
'author email'
,
text:
issue
.
author_email
)
expect
(
body
).
to
have_selector
(
'author email'
,
text:
issue
.
author_public_email
)
expect
(
body
).
to
have_selector
(
'assignee email'
,
text:
issue
.
author_public_email
)
expect
(
body
).
to
have_selector
(
'entry summary'
,
text:
issue
.
title
)
expect
(
body
).
to
have_selector
(
'entry summary'
,
text:
issue
.
title
)
end
end
end
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