Support authenticated upload URLs.

Trac #1734

This is implemented by bouncing uploaded file links through a view
that checks authentication and redirects to an expiring S3 URL.

This makes file uploads return a domain-relative URI. The client converts
this to an absolute URI when it's in the composebox, then back to relative
when it's submitted to the server.

We need the relative URI because the same message may be viewed across
{staging,www,zephyr}.zulip.com, which have different cookies.

(imported from commit 33acb2abaa3002325f389d5198fb20ee1b30f5fa)
This commit is contained in:
Kevin Mehall
2013-10-23 10:46:18 -04:00
parent 473a98d0a4
commit 0a3a22cb3d
6 changed files with 103 additions and 15 deletions

View File

@@ -41,6 +41,8 @@ urlpatterns = patterns('',
url(r'^activity$', 'zerver.views.get_activity'),
url(r'^user_uploads/(?P<realm_id>\d*)/(?P<filename>.*)', 'zerver.views.get_uploaded_file'),
# Registration views, require a confirmation ID.
url(r'^accounts/home/', 'zerver.views.accounts_home'),
url(r'^accounts/send_confirm/(?P<email>[\S]+)?',