Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

api: Delete ancient fetch_google_client_id endpoint.

Tim Abbott1470dd910538
diff --git a/docs/subsystems/settings.md b/docs/subsystems/settings.md
index 7dfd96b2414..36ebe5da044 100644
--- a/docs/subsystems/settings.md
+++ b/docs/subsystems/settings.md
@@ -134,7 +134,7 @@ want those settings.
### Testing non-default settings
You can write tests for settings using e.g. `with
-self.settings(GOOGLE_CLIENT_ID=None)`. However, this only works for
+self.settings(TERMS_OF_SERVICE=None)`. However, this only works for
settings which are checked at runtime, not settings which are only
accessed in initialization of Django (or Zulip) internals
(e.g. `DATABASES`). See the [Django docs on overriding settings in
diff --git a/zerver/tests/test_openapi.py b/zerver/tests/test_openapi.py
index c3490c14117..e8ea44823bb 100644
--- a/zerver/tests/test_openapi.py
+++ b/zerver/tests/test_openapi.py
@@ -287,10 +287,7 @@ class OpenAPIArgumentsTest(ZulipTestCase):
"/realm/logo",
"/realm/deactivate",
"/realm/subdomain/{subdomain}",
- #### Other low value endpoints
- # Used for failed approach with dead Android app.
- "/fetch_google_client_id",
- # API for video calls we're planning to remove/replace.
+ # API for Zoom video calls. Unclear if this can support other apps.
"/calls/zoom/create",
#### The following are fake endpoints that live in our zulip.yaml
#### for tooling convenience reasons, and should eventually be moved.
diff --git a/zerver/tests/test_urls.py b/zerver/tests/test_urls.py
index df7c43b4f2c..df6d2324018 100644
--- a/zerver/tests/test_urls.py
+++ b/zerver/tests/test_urls.py
@@ -3,7 +3,6 @@ import os
from typing import List, Optional
import django.urls.resolvers
-import orjson
from django.test import Client
from zerver.lib.test_classes import ZulipTestCase
@@ -97,28 +96,6 @@ class PublicURLTest(ZulipTestCase):
for status_code, url_set in patch_urls.items():
self.fetch("client_patch", url_set, status_code)
- def test_get_gcid_when_not_configured(self) -> None:
- with self.settings(GOOGLE_CLIENT_ID=None):
- resp = self.client_get("/api/v1/fetch_google_client_id")
- self.assertEqual(
- 400,
- resp.status_code,
- msg=f"Expected 400, received {resp.status_code} for GET /api/v1/fetch_google_client_id",
- )
- self.assertEqual("error", resp.json()["result"])
-
- def test_get_gcid_when_configured(self) -> None:
- with self.settings(GOOGLE_CLIENT_ID="ABCD"):
- resp = self.client_get("/api/v1/fetch_google_client_id")
- self.assertEqual(
- 200,
- resp.status_code,
- msg=f"Expected 200, received {resp.status_code} for GET /api/v1/fetch_google_client_id",
- )
- data = orjson.loads(resp.content)
- self.assertEqual("success", data["result"])
- self.assertEqual("ABCD", data["google_client_id"])
-
def test_config_error_endpoints_dev_env(self) -> None:
"""
The content of these pages is tested separately.
diff --git a/zerver/views/auth.py b/zerver/views/auth.py
index 715e4b55279..70f37b4d8d0 100644
--- a/zerver/views/auth.py
+++ b/zerver/views/auth.py
@@ -1057,13 +1057,6 @@ def json_fetch_api_key(
return json_success({"api_key": api_key, "email": user_profile.delivery_email})
-@csrf_exempt
-def api_fetch_google_client_id(request: HttpRequest) -> HttpResponse:
- if not settings.GOOGLE_CLIENT_ID:
- return json_error(_("GOOGLE_CLIENT_ID is not configured"), status=400)
- return json_success({"google_client_id": settings.GOOGLE_CLIENT_ID})
-
-
@require_post
def logout_then_login(request: HttpRequest, **kwargs: Any) -> HttpResponse:
return django_logout_then_login(request, kwargs)
diff --git a/zproject/default_settings.py b/zproject/default_settings.py
index 4da7233c92a..541285558c5 100644
--- a/zproject/default_settings.py
+++ b/zproject/default_settings.py
@@ -243,9 +243,6 @@ SYSTEM_BOT_REALM = "zulipinternal"
# than a separate app.
EXTRA_INSTALLED_APPS = ["analytics"]
-# Default GOOGLE_CLIENT_ID to the value needed for Android auth to work
-GOOGLE_CLIENT_ID = "835904834568-77mtr5mtmpgspj9b051del9i9r5t4g4n.apps.googleusercontent.com"
-
# Used to construct URLs to point to the Zulip server. Since we
# only support HTTPS in production, this is just for development.
EXTERNAL_URI_SCHEME = "https://"
diff --git a/zproject/urls.py b/zproject/urls.py
index f55506ba450..cf66929cdbb 100644
--- a/zproject/urls.py
+++ b/zproject/urls.py
@@ -24,7 +24,6 @@ from zerver.views.auth import (
api_dev_fetch_api_key,
api_dev_list_users,
api_fetch_api_key,
- api_fetch_google_client_id,
api_get_server_settings,
dev_direct_login,
json_fetch_api_key,
@@ -723,8 +722,6 @@ v1_api_mobile_patterns = [
path("dev_fetch_api_key", api_dev_fetch_api_key),
# This is for fetching the emails of the admins and the users.
path("dev_list_users", api_dev_list_users),
- # Used to present the GOOGLE_CLIENT_ID to mobile apps
- path("fetch_google_client_id", api_fetch_google_client_id),
]
urls += [
path("api/v1/", include(v1_api_mobile_patterns)),