zulip/zerver
Mateusz Mandera 4102816240 upload: Pass the target realm to create_attachment.
The target realm was not being passed to create_attachment in
upload_message_file implementations. This was a bug in the edge-case of
cross-realm messages - in particular, causing a bug in the email
gateway:
When an email with an attachment is sent, the message is mirrored to
Zulip with Email Gateway Bot as the message sender and uploader of the
attachment. Due to the realm not being passed to create_attachment, the
Attachment would get created with .realm being the system bot realm,
making the attachment inaccessible under some conditions due to failing
the following condition check (that's expected to pass, provided that
the .realm is set correctly):
```
    if (
        attachment.is_realm_public
        and attachment.realm == user_profile.realm
        and user_profile.can_access_public_streams()
    ):
        # Any user in the realm can access realm-public files
        return True
```
2022-01-27 17:23:44 -08:00
..
data_import data_import: Ignore Rocket.Chat livechat streams/messages. 2021-11-07 09:50:55 -08:00
integration_fixtures/nagios tests: Add a test for fixtures for non-webhook integrations. 2021-04-28 08:16:51 -07:00
lib upload: Pass the target realm to create_attachment. 2022-01-27 17:23:44 -08:00
management python: Replace universal_newlines with text. 2022-01-23 22:16:01 -08:00
migrations migrations: Fix RealmAuditLog creation in migration 0374. 2022-01-25 17:20:13 -08:00
openapi api: Update `update_message` event required fields. 2022-01-26 13:11:26 -08:00
tests upload: Pass the target realm to create_attachment. 2022-01-27 17:23:44 -08:00
tornado python: Replace requests.packages.urllib3 alias with urllib3. 2022-01-23 22:14:17 -08:00
views python: Replace universal_newlines with text. 2022-01-23 22:16:01 -08:00
webhooks Remove Ubuntu 18.04 support. 2022-01-21 17:26:14 -08:00
worker queue_processors: Shut down background missedmessage_emails thread. 2021-11-23 10:45:49 -08:00
__init__.py django: Upgrade Zulip to Django 3.2 LTS. 2021-05-03 08:36:22 -07:00
apps.py caching: Make sender type optional for flush_cache. 2021-07-26 14:48:07 -07:00
context_processors.py portico: Use /help/ style pages for displaying policies. 2021-12-10 17:56:12 -08:00
decorator.py python: Replace IOError with OSError. 2022-01-23 22:17:02 -08:00
filters.py typing: Fix function signatures. 2021-08-20 05:54:19 -07:00
forms.py python: Replace deprecated jinja2.utils.Markup with markupsafe.Markup. 2022-01-13 14:22:48 -08:00
logging_handlers.py python: Replace universal_newlines with text. 2022-01-23 22:16:01 -08:00
middleware.py lint: Fix typos found by codespell. 2021-10-19 16:51:13 -07:00
models.py streams: Add notifications for permission policy changes. 2022-01-21 13:59:34 -08:00
signals.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00