zilencer: Remove obsolete lookup_endpoints_for_user endpoint.

This endpoint was part of the same obsolete system as
desktop_sso_dispatch.
This commit is contained in:
Tim Abbott 2017-03-05 23:20:37 -08:00
parent 9e8023843a
commit 69061e6db4
3 changed files with 0 additions and 34 deletions

View File

@ -1,21 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import ujson
from django.test import TestCase
class EndpointDiscoveryTest(TestCase):
def test_staging_user(self):
# type: () -> None
response = self.client.get("/api/v1/deployments/endpoints", {"email": "lfaraone@zulip.com"})
data = ujson.loads(response.content)
self.assertEqual(data["result"]["base_site_url"], "https://zulip.com/")
self.assertEqual(data["result"]["base_api_url"], "https://zulip.com/api/")
def test_prod_user(self):
# type: () -> None
response = self.client.get("/api/v1/deployments/endpoints", {"email": "lfaraone@mit.edu"})
data = ujson.loads(response.content)
self.assertEqual(data["result"]["base_site_url"], "https://zulip.com/")
self.assertEqual(data["result"]["base_api_url"], "https://api.zulip.com/")

View File

@ -12,8 +12,6 @@ v1_api_and_json_patterns = [
{'POST': 'zilencer.views.submit_feedback'}),
url('^deployment/report_error$', rest_dispatch,
{'POST': 'zerver.views.report.report_error'}),
url('^deployment/endpoints$', zilencer.views.lookup_endpoints_for_user,
name='zilencer.views.lookup_endpoints_for_user'),
]
urlpatterns = [

View File

@ -2,7 +2,6 @@ from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.http import HttpResponse, HttpRequest
from django.views.decorators.csrf import csrf_exempt
from zilencer.models import Deployment
@ -94,13 +93,3 @@ def realm_for_email(email):
pass
return get_realm_by_email_domain(email)
# Requests made to this endpoint are UNAUTHENTICATED
@csrf_exempt
@has_request_variables
def lookup_endpoints_for_user(request, email=REQ()):
# type: (HttpRequest, str) -> HttpResponse
try:
return json_response(realm_for_email(email).deployment.endpoints)
except AttributeError:
return json_error(_("Cannot determine endpoint for user."), status=404)