Commit Graph

4054 Commits

Author SHA1 Message Date
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
Brian Simpson
5637618379 CommentBuilder: cleanup logic for selecting candidate comments. 2014-02-12 14:51:13 -08:00
Brian Simpson
a4874c5a96 CommentBuilder: delete debug_dict. 2014-02-12 14:51:13 -08:00
Brian Simpson
5515aa7f07 CommentBuilder: separate comment and children handling. 2014-02-12 14:51:13 -08:00
Brian Simpson
633c250490 VOrAdminSecret: don't check modhash on GET requests. 2014-02-12 14:51:13 -08:00
Brian Simpson
e8318400e4 terminate_campaign: immediately update promote status to finished. 2014-02-12 14:51:13 -08:00
Brian Simpson
9ac361323e CommentBuilder: add timers. 2014-02-12 14:51:13 -08:00
Keith Mitchell
c32c63661c Missing RequirementException import 2014-02-12 14:51:12 -08:00
Neil Williams
347fb8bc5f SRMember: Start dual-writing to a dedicated cache pool.
This is one of the most heavily hit rels currently and the hope is that
pulling it out to its own pool will make the main cache more effective
for everything else.  It may make sense to move SRMember to a different
model such as a C* DenormalizedRelation in the future.
2014-02-12 14:51:12 -08:00
Neil Williams
264f872ca4 media: Make hooks for adding scrapers into the mix. 2014-02-12 14:51:12 -08:00
Roger Ostrander
342709da38 POST_submit: add hook for when banned domain submitted. 2014-02-12 14:51:12 -08:00
Brian Simpson
4ba1a10c6d CommentTreeStorageV1.add_comments: write parents first.
When assembling a comment tree it's necessary that all comments
are present in parents. Writing parents first ensures this.
2014-02-12 14:51:12 -08:00
Brian Simpson
cc7c23c8f3 Set default geotargeting country correctly. 2014-02-12 14:51:12 -08:00
Brian Simpson
e6744c880a terminate_campaign: pass location to edit_campaign. 2014-02-12 14:51:12 -08:00
Jason Harvey
f23025edf6 memcache: Reduce compression threshold for rendercache. 2014-02-12 14:51:12 -08:00
Jason Harvey
dfdc5600c4 Pass fullname on deleted things if we're admin. 2014-02-12 14:51:12 -08:00
Andre D
1ecb6c6a61 wiki: Remove recursion and fix wiki page list filtering. 2014-02-12 14:47:44 -08:00
Neil Williams
47a677aba1 /tb/: Check permissions before redirecting.
When the user is not logged in or has the toolbar disabled, the toolbar
endpoint will turn a link ID36 into a redirect to the submission on
reddit.  This redirect includes the slugified title of the post as well
as the subreddit it's in which could lead to a leak of information from
a private subreddit.

This fixes an information disclosure vulnerability reported by Jordan
Milne (/u/largenocream).
2014-02-12 14:28:07 -08:00
Neil Williams
497751dc96 /api/generate_payment_blob: Check comment viewing permissions.
This is not strictly necessary as /gold/creditgild is where the
information leak actually occurs, but checking here should help prevent
future leaks of the same type.

This fixes an information disclosure vulnerability reported by Jordan
Milne (/u/largenocream).
2014-02-12 14:28:07 -08:00
Neil Williams
4d9e6b29b3 /gold/creditgild: Check comment viewing permissions.
Previously, it was possible to generate a payment blob for a comment the
user does not have permission to view (in a private subreddit or
deleted) and then use the creditgild form to see the author and content
of the comment.  This adds a check to creditgild to ensure correct
permissions at display time.

This fixes an information disclosure vulnerability reported by Jordan
Milne (/u/largenocream).
2014-02-12 14:28:07 -08:00
Chad Birch
510aafede7 User lists: highlight row on hover 2014-02-11 17:30:10 -07:00
Chad Birch
441ce8fe19 Flair list: restrict access to mods (flair perms) 2014-02-11 17:30:04 -07:00
Keith Mitchell
fadfbb6a82 Allow "script" apps grant_type=password
Only application devs will be permitted to use password grants,
to discourage widespread use. Password grants are intended
to be a convenience for bots & personal scripts, to encourage
use of OAuth tokens and ease transition to OAuth2.

For more info on password grants, see:
http://tools.ietf.org/html/rfc6749#section-4.3
2014-02-10 15:42:12 -08:00
Keith Mitchell
3c49e94f97 Add app 'type' field to app create form
This will allow for differing handling of permissions based
on application type.

* Web app: Web-hosted application. Can keep a client_secret

* Installed app: e.g., android app. Client secret is not so secret
See also: https://developers.google.com/accounts/docs/OAuth2InstalledApp

* Script: For simple scripts and bots. Client secret is assumed secret.
2014-02-10 15:42:05 -08:00
Neil Williams
58c66fbbcf V*OrAdminSecret: check modhash if secret token not used.
It is necessary to do this check in V*OrAdminSecret as we cannot (and
should not) require a modhash when the secret token is being used
because this would break API compatibility and isn't necessary.

This fixes two XSRF vulnerabilities reported by Jordan Milne
(/u/largenocream).
2014-02-10 10:58:20 -08:00
Neil Williams
94d69f59ab Remove obsolete /api/frame and /api/noframe endpoints.
These endpoints don't appear to have been used since
reddit/reddit@a07c576d1a and I have
verified via haproxy logs that they are not ever being called.

This fixes two XSRF vulnerabilities reported by Jordan Milne
(/u/largenocream).
2014-02-10 10:58:20 -08:00
Neil Williams
1cbc59a1c5 Add some missing VModhash checks.
This fixes nine XSRF vulnerabilities reported by Jordan Milne
(/u/largenocream).
2014-02-10 10:58:20 -08:00
Brian Simpson
e27f7d3285 paypal subscription: cleanly exit on duplicate transactions. 2014-02-05 12:27:27 -05:00
Brian Simpson
0feb71228a Delete update_promos_q.
A cron job is sufficient because promote.make_daily_promotions()
is all that needs to be run.
2014-02-05 12:27:27 -05:00
Brian Simpson
9dff58335d Delete unused Link _saved and _hidden methods. 2014-02-05 12:27:27 -05:00