2017-03-06 08:35:57 +01:00
|
|
|
from typing import Any
|
|
|
|
|
2020-04-28 15:45:25 +02:00
|
|
|
from django.conf.urls import include
|
|
|
|
from django.urls import path
|
2017-03-06 08:35:57 +01:00
|
|
|
|
2022-08-01 22:55:13 +02:00
|
|
|
from zilencer.auth import remote_server_path
|
2020-09-22 05:31:38 +02:00
|
|
|
from zilencer.views import (
|
2022-01-12 23:45:01 +01:00
|
|
|
deactivate_remote_server,
|
2020-09-22 05:31:38 +02:00
|
|
|
register_remote_push_device,
|
|
|
|
register_remote_server,
|
|
|
|
remote_server_check_analytics,
|
|
|
|
remote_server_notify_push,
|
|
|
|
remote_server_post_analytics,
|
|
|
|
unregister_all_remote_push_devices,
|
|
|
|
unregister_remote_push_device,
|
|
|
|
)
|
2016-04-27 06:33:37 +02:00
|
|
|
|
python: Convert assignment type annotations to Python 3.6 style.
This commit was split by tabbott; this piece covers the vast majority
of files in Zulip, but excludes scripts/, tools/, and puppet/ to help
ensure we at least show the right error messages for Xenial systems.
We can likely further refine the remaining pieces with some testing.
Generated by com2ann, with whitespace fixes and various manual fixes
for runtime issues:
- invoiced_through: Optional[LicenseLedger] = models.ForeignKey(
+ invoiced_through: Optional["LicenseLedger"] = models.ForeignKey(
-_apns_client: Optional[APNsClient] = None
+_apns_client: Optional["APNsClient"] = None
- notifications_stream: Optional[Stream] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
- signup_notifications_stream: Optional[Stream] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
+ notifications_stream: Optional["Stream"] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
+ signup_notifications_stream: Optional["Stream"] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
- author: Optional[UserProfile] = models.ForeignKey('UserProfile', blank=True, null=True, on_delete=CASCADE)
+ author: Optional["UserProfile"] = models.ForeignKey('UserProfile', blank=True, null=True, on_delete=CASCADE)
- bot_owner: Optional[UserProfile] = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
+ bot_owner: Optional["UserProfile"] = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
- default_sending_stream: Optional[Stream] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
- default_events_register_stream: Optional[Stream] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
+ default_sending_stream: Optional["Stream"] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
+ default_events_register_stream: Optional["Stream"] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
-descriptors_by_handler_id: Dict[int, ClientDescriptor] = {}
+descriptors_by_handler_id: Dict[int, "ClientDescriptor"] = {}
-worker_classes: Dict[str, Type[QueueProcessingWorker]] = {}
-queues: Dict[str, Dict[str, Type[QueueProcessingWorker]]] = {}
+worker_classes: Dict[str, Type["QueueProcessingWorker"]] = {}
+queues: Dict[str, Dict[str, Type["QueueProcessingWorker"]]] = {}
-AUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional[LDAPSearch] = None
+AUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional["LDAPSearch"] = None
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-22 01:09:50 +02:00
|
|
|
i18n_urlpatterns: Any = []
|
2016-04-27 06:33:37 +02:00
|
|
|
|
|
|
|
# Zilencer views following the REST API style
|
2023-09-21 18:12:00 +02:00
|
|
|
push_bouncer_patterns = [
|
2022-08-01 22:55:13 +02:00
|
|
|
remote_server_path("remotes/push/register", POST=register_remote_push_device),
|
|
|
|
remote_server_path("remotes/push/unregister", POST=unregister_remote_push_device),
|
|
|
|
remote_server_path("remotes/push/unregister/all", POST=unregister_all_remote_push_devices),
|
|
|
|
remote_server_path("remotes/push/notify", POST=remote_server_notify_push),
|
2018-05-04 01:40:46 +02:00
|
|
|
# Push signup doesn't use the REST API, since there's no auth.
|
2021-02-12 08:20:45 +01:00
|
|
|
path("remotes/server/register", register_remote_server),
|
2022-08-01 22:55:13 +02:00
|
|
|
remote_server_path("remotes/server/deactivate", POST=deactivate_remote_server),
|
2019-10-03 02:01:36 +02:00
|
|
|
# For receiving table data used in analytics and billing
|
2022-08-01 22:55:13 +02:00
|
|
|
remote_server_path("remotes/server/analytics", POST=remote_server_post_analytics),
|
|
|
|
remote_server_path("remotes/server/analytics/status", GET=remote_server_check_analytics),
|
2016-06-24 02:26:09 +02:00
|
|
|
]
|
2016-04-27 06:33:37 +02:00
|
|
|
|
2018-09-25 12:24:11 +02:00
|
|
|
urlpatterns = [
|
2023-09-21 18:12:00 +02:00
|
|
|
path("api/v1/", include(push_bouncer_patterns)),
|
2017-03-06 08:17:34 +01:00
|
|
|
]
|