remote_billing: Rename the _billing_entry and _finalize_login functions.

These names were picked when I still thought these endpoints would serve
both the RemoteRealm and RemoteZulipServer based flows. Now that it's
known these are RemoteRealm-only endpoints, the _server in the names no
longer makes sense.
This commit is contained in:
Mateusz Mandera 2023-12-04 00:20:53 +01:00 committed by Tim Abbott
parent ebee57813c
commit c23339f295
3 changed files with 7 additions and 9 deletions

View File

@ -31,8 +31,8 @@ from corporate.views.portico import (
)
from corporate.views.remote_billing_page import (
remote_billing_legacy_server_login,
remote_realm_billing_finalize_login,
remote_realm_plans_page,
remote_server_billing_finalize_login,
remote_server_plans_page,
)
from corporate.views.session import (
@ -183,9 +183,7 @@ i18n_urlpatterns += landing_page_urls
urlpatterns = list(i18n_urlpatterns)
urlpatterns += [
path(
"remote-billing-login/<signed_billing_access_token>/", remote_server_billing_finalize_login
),
path("remote-billing-login/<signed_billing_access_token>", remote_realm_billing_finalize_login),
# Remote server billing endpoints.
path("realm/<realm_uuid>/plans/", remote_realm_plans_page, name="remote_realm_plans_page"),
path(

View File

@ -41,7 +41,7 @@ VALID_NEXT_PAGES_TYPE = Literal[None, "sponsorship", "upgrade", "billing", "plan
@csrf_exempt
@typed_endpoint
def remote_server_billing_entry(
def remote_realm_billing_entry(
request: HttpRequest,
remote_server: RemoteZulipServer,
*,
@ -75,13 +75,13 @@ def remote_server_billing_entry(
billing_access_url = (
f"{settings.EXTERNAL_URI_SCHEME}{settings.SELF_HOSTING_MANAGEMENT_SUBDOMAIN}.{settings.EXTERNAL_HOST}"
+ reverse(remote_server_billing_finalize_login, args=[signed_identity_dict])
+ reverse(remote_realm_billing_finalize_login, args=[signed_identity_dict])
)
return json_success(request, data={"billing_access_url": billing_access_url})
@self_hosting_management_endpoint
def remote_server_billing_finalize_login(
def remote_realm_billing_finalize_login(
request: HttpRequest,
signed_billing_access_token: str,
) -> HttpResponse:

View File

@ -3,7 +3,7 @@ from typing import Any
from django.conf.urls import include
from django.urls import path
from corporate.views.remote_billing_page import remote_server_billing_entry
from corporate.views.remote_billing_page import remote_realm_billing_entry
from zilencer.auth import remote_server_path
from zilencer.views import (
deactivate_remote_server,
@ -34,7 +34,7 @@ push_bouncer_patterns = [
remote_server_path("remotes/server/analytics/status", GET=remote_server_check_analytics),
]
billing_patterns = [remote_server_path("remotes/server/billing", POST=remote_server_billing_entry)]
billing_patterns = [remote_server_path("remotes/server/billing", POST=remote_realm_billing_entry)]
urlpatterns = [
path("api/v1/", include(push_bouncer_patterns)),