Skip to content

Commit c613dd2

Browse files
committed
feat(cells): Remove legacy non-org-scoped accept invite API route
The /api/0/accept-invite/{member_id}/{token}/ endpoint required no organization context, relying on a cell mapping lookup to determine the org. The org-scoped /api/0/accept-invite/{organization_id_or_slug}/{member_id}/{token}/ is now the only supported cell-safe route. This PR removes the legacy API route and any references to it: - Remove the URL pattern from api/urls.py - Remove the legacy pattern from controlsiloUrlPatterns.ts (regenerated) - Remove the legacy type from knownSentryApiUrls.generated.ts (regenerated) - Remove entries from the apidocs ownership and publish status allowlists Removing this route is harmless as the web UI has been updated to always use the new url in #112634. This is not a public URL that requires a formal deprecation process.
1 parent e04da93 commit c613dd2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/sentry/api/endpoints/accept_organization_invite.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@ def handle_empty_organization_id_or_slug(
7171

7272
def get_invite_state(
7373
member_id: int,
74-
organization_id_or_slug: int | str | None,
74+
# TODO(cells): Remove None once AcceptOrganizationInviteRedirectView is deleted
75+
organization_id_or_slug: str | None,
7576
user_id: int | None,
7677
request: HttpRequest,
7778
) -> RpcUserInviteContext | None:
7879
if organization_id_or_slug is None:
7980
return handle_empty_organization_id_or_slug(member_id, user_id, request)
8081

8182
else:
82-
if str(organization_id_or_slug).isdecimal():
83+
if organization_id_or_slug.isdecimal():
8384
invite_context = organization_service.get_invite_by_id(
8485
organization_id=organization_id_or_slug,
8586
organization_member_id=member_id,
@@ -107,9 +108,9 @@ class AcceptOrganizationInvite(Endpoint):
107108
def convert_args(
108109
self,
109110
request: Request,
110-
member_id: int,
111+
member_id: str,
111112
token: str,
112-
organization_id_or_slug: int | str | None = None,
113+
organization_id_or_slug: str,
113114
*args,
114115
**kwargs,
115116
):
@@ -143,7 +144,7 @@ def get_helper(
143144
def get(
144145
self,
145146
request: Request,
146-
member_id: int,
147+
member_id: str,
147148
token: str,
148149
invite_context: RpcUserInviteContext,
149150
**kwargs,
@@ -267,7 +268,7 @@ def post(
267268
response = Response(
268269
status=status.HTTP_400_BAD_REQUEST, data={"details": "member already exists"}
269270
)
270-
elif not request.user.is_authenticated or not helper.valid_request:
271+
elif not helper.valid_request:
271272
return Response(
272273
status=status.HTTP_400_BAD_REQUEST,
273274
data={"details": "unable to accept organization invite"},

0 commit comments

Comments
 (0)