push_notifs: Check app ID has a plausible shape at bouncer.

This commit is contained in:
Greg Price
2023-11-07 14:13:39 -08:00
committed by Tim Abbott
parent 1b2178f558
commit be2a9a03d0
2 changed files with 13 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ from zerver.lib.validator import (
check_string_fixed_length,
check_union,
)
from zerver.views.push_notifications import validate_token
from zerver.views.push_notifications import check_app_id, validate_token
from zilencer.auth import InvalidZulipServerKeyError
from zilencer.models import (
RemoteInstallationCount,
@@ -162,7 +162,7 @@ def register_remote_push_device(
user_uuid: Optional[str] = REQ(default=None),
token: str = REQ(),
token_kind: int = REQ(json_validator=check_int),
ios_app_id: Optional[str] = REQ(default=None),
ios_app_id: Optional[str] = REQ(str_validator=check_app_id, default=None),
) -> HttpResponse:
validate_bouncer_token_request(token, token_kind)
if token_kind == RemotePushDeviceToken.APNS and ios_app_id is None: