Commit Graph

4083 Commits

Author SHA1 Message Date
Chad Birch
ebae642bf2 Password reset email: update wording 2014-02-20 16:24:55 -07:00
Neil Williams
3393dc07a9 Add MessagesByAccount index.
Useful for quickly finding all messages ever created by an account.
2014-02-18 15:04:40 -08:00
Neil Williams
77fe0dfa3c Require credentials for private subreddit media embeds.
By knowing the ID36 of a link, it is possible to see its media embed
because the embed request is served off-domain and as a result can't
verify the user's cookie.  To fix this, we add an authentication code to
the iframe URL for media embeds and require its presence for all embeds
in private subreddits.

This makes required the credentials which were added in an earlier
patch.

This fixes an information disclosure vulnerability reported by Jordan
Milne (/u/largenocream).
2014-02-18 15:04:40 -08:00
Neil Williams
a6063c5843 Start adding credentials to media embed iframe URLs.
By knowing the ID36 of a link, it is possible to see its media embed
because the embed request is served off-domain and as a result can't
verify the user's cookie.  To fix this, we add an authentication code to
the iframe URL for media embeds and require its presence for all embeds
in private subreddits.

This starts appending credentials to private subreddit embeds such that
when the latter half of the fix is deployed all apps are already
generating appropriate embed URLs.

This is part of a fix for an information disclosure vulnerability
reported by Jordan Milne (/u/largenocream).
2014-02-18 15:04:39 -08:00
Neil Williams
45c663e18e Use HTML5 doctype for MediaEmbedBody. 2014-02-18 15:04:39 -08:00
Neil Williams
902288c9e3 GET_oldinfo: prevent info leak via redirect to permalink.
Given the ID36, it was possible to get the title-slug and subreddit of a
submission in a private subreddit.  This adds a missing permissions
check to fix that.

This fixes an information disclosure vulnerability reported by Jordan
Milne (/u/largenocream).
2014-02-18 15:04:39 -08:00
Neil Williams
240140ee59 /gold: Ensure user should be allowed to see a comment.
This fixes an information disclosure vulnerability reported by Jordan
Milne (/u/largenocream).
2014-02-18 15:04:39 -08:00
Neil Williams
f8bf988006 Move ip_hash to secret vault and rename it to "true_ip". 2014-02-18 15:04:39 -08:00
Brian Simpson
3aacf8dc05 CommentTree: stop storing num_children.
CommentTreeStorageV2 will continue to store num_children as the
column value, but it is not read.
2014-02-18 06:16:31 -05:00
Brian Simpson
4534e5e05e CommentTree migration: handle permacache entries without num_children. 2014-02-18 06:16:31 -05:00
Brian Simpson
29e11d7692 CommentTree migration: stop using tree.num_children. 2014-02-18 06:16:26 -05:00
Keith Mitchell
b21124432d OAuth2: Give /subreddits/search 'read' scope 2014-02-18 10:54:58 -08:00
Keith Mitchell
172163327c OAuth2: Don't lose redirect_uri query params 2014-02-18 10:54:53 -08:00
Keith Mitchell
b1e97e8bff Bring OAuth2 into the core controllers
This makes it easier to avoid issues with running pre()
functions multiple times (multiply subclassing was causing
problems) and makes it so all resources are blocked from oauth
access unless explicitly enabled (instead of randomly allowing
access as a "logged out user" to endpoints that aren't part of
an OAuth2ResourceController)

Conflicts:

	r2/r2/controllers/apiv1.py
	r2/r2/controllers/oauth2.py
2014-02-18 10:54:49 -08:00
Brian Simpson
d368e31cb4 Ignore 'mispaid' notifications from Coinbase. 2014-02-18 04:22:01 -05:00
Brian Simpson
8db9e76ab0 Fix link to gold subscription page in error message. 2014-02-18 04:22:01 -05:00
Chad Birch
ed1f165756 Gilding form: add reminder message for creddits 2014-02-18 04:21:56 -05:00
Neil Williams
3ed6a33ab8 Comment score hiding: allow users to see their own scores always.
It's just frustrating not to be able to see your own score and the
bandwagon effect isn't really relevant in this case.
2014-02-14 11:36:16 -08:00
Jason Harvey
0e7dee096f Trim the message tree when it reaches a certain size. 2014-02-14 11:36:16 -08:00
Jason Harvey
a06b9682d2 Pass fullname on deleted things if we can ban. 2014-02-14 11:34:21 -08:00
Ricky Ramirez
f66c9e7f0c Add missing commentvisitsbox.xml template. 2014-02-14 10:25:12 -08:00
Keith Mitchell
0e647695d3 /dev/api: Show /api/flairselector docs 2014-02-14 10:04:52 -08:00
powerlanguage
667a863faf Add jobs link to footer 2014-02-13 15:47:22 -08:00
Keith Mitchell
1a117fffbd Remove extra "is_mod" from AccountJsonTemplate
It's already in the IdentityJsonTemplate subclass
2014-02-13 15:26:54 -08:00
Keith Mitchell
a059ef106f OAuth: Include mail status in /api/v1/me
Will only be included if the current scope includes
"privatemessages".
2014-02-13 15:26:48 -08:00
Keith Mitchell
5cf4ee5535 OAuth: Add @extra_oauth2_scope decorator
When in an OAuth context, decorated functions
will only be run if the context includes the designated
scope.

When not in an OAuth context, the function is run normally.
2014-02-13 15:26:41 -08:00
Keith Mitchell
6e08b49780 apiv1.py: Fix whitespace issues 2014-02-13 15:26:36 -08:00
Keith Mitchell
b610af7438 OAuth: ApiV1Controller must check_for_bearer_token 2014-02-13 15:26:26 -08:00
Keith Mitchell
4258d1c036 OAuth2: /api/v1/access_token: Use proper user ID 2014-02-13 15:26:22 -08:00
Keith Mitchell
2de5f2d3ec OAuth2: Add personal "flair" scope
Allows token bearer to manipulate user flair, and
the flair of his submitted links

Give /api/setflairenabled "flair" scope
Give /api/flairselector "flair" scope
2014-02-13 15:26:00 -08:00
Keith Mitchell
4ae88aae40 OAuth2: Add 'report' scope (works for 'hide' too) 2014-02-13 15:25:52 -08:00
Keith Mitchell
6ae5866162 OAuth2: /user/<username>/about gets "read" scope 2014-02-13 15:25:47 -08:00
Keith Mitchell
d308e9f653 OAuth2: /api/submit_text get 'submit' scope 2014-02-13 15:25:43 -08:00
Neil Williams
3511b08110 Combine and generalize the time listing precomputer scripts.
Previously, the subreddit/domain and account precomputers were separate.
This merges the two and improves their portability in the process.
Because of the increased portability, the precomputer can now be added
to the install script by default.
2014-02-13 13:50:52 -08:00
Neil Williams
5fae84cbd0 Put media_domain warning on stderr to protect MR jobs.
For simple installs of reddit, g.domain == g.media_domain.  If this is
the case, the app will print a warning at startup.  However, this
warning was printed to stdout which meant that any jobs (such as the
mr_top stuff) using the output of a reddit process would get this
warning in their data streams. Bad times.
2014-02-13 13:50:52 -08:00
Keith Mitchell
fc33bd301b Parameterize g.domain in DomainSR title.
The domain is not "reddit.com" on other sites. This also fixes the issue
of doing concatenation of internationalized strings which is a bad idea.
Fixes reddit/reddit#968.
2014-02-13 13:50:52 -08:00
Brian Simpson
bfe526d13c PromoteLinkForm: update infotext with link to Mike's slideshare. 2014-02-13 16:17:01 -05:00
Brian Simpson
a3153d61dd Make advertisers and sponsors have same start date restrictions. 2014-02-13 16:17:01 -05:00
Brian Simpson
1f87b93e7f VDate: Use business_days argument. 2014-02-13 16:17:01 -05:00
Brian Simpson
470efd24c4 validate_blob: Add new 'code' goldtype. 2014-02-13 16:16:45 -05:00
Brian Simpson
93283123ad CommentBuilder: children of MoreRecursion are not used. 2014-02-12 14:51:13 -08:00
Brian Simpson
bcbf9c18ce CommentBuilder: cleanup MoreChildren building. 2014-02-12 14:51:13 -08:00
Brian Simpson
6734096d95 CommentBuilder: cleanup selecting comments to show. 2014-02-12 14:51:13 -08:00
Brian Simpson
1123b6ff6a CommentBuilder: clean up use of MoreRecursion. 2014-02-12 14:51:13 -08:00
Brian Simpson
83e5b38a82 CommentBuilder: use heapq to keep sorted list of candidate comments. 2014-02-12 14:51:13 -08:00
Brian Simpson
faa1404f46 CommentBuilder: calculate num_children on the fly. 2014-02-12 14:51:13 -08:00
Brian Simpson
a128c60a88 CommentBuilder: use better variable name wrapped_by_id. 2014-02-12 14:51:13 -08:00
Brian Simpson
7d0a71fd43 CommentBuilder: don't log when there's an empty candidates list. 2014-02-12 14:51:13 -08:00
Brian Simpson
0e5b1b7bd7 CommentBuilder: don't import TimeoutExpired. 2014-02-12 14:51:13 -08:00
Brian Simpson
e72a21d0f0 CommentBuilder: move sorting/updating candidates to its own method. 2014-02-12 14:51:13 -08:00