feat(push): FCM sender + /push/fcm-token route for the Android client (A33)

Mirror src/push/apns.ts behind the same NotifyService seam (combineNotifyServices),
so held-gate/done hook events fan out to Android via data-only high-priority FCM with
zero new event paths. OAuth2 bearer via google-auth-library (R7); payload minimized to
sessionId/cls/token (never cwd/command/bytes); intentionally-loose FCM-token validator;
Origin-guarded + rate-limited POST/DELETE /push/fcm-token; FCM_* env all-or-disabled.

Cross-review fix: dropped validateStatus:()=>true so google-auth-library's built-in
401 refresh-and-retry actually fires. 60 new tests; full server suite green; tsc clean.
This commit is contained in:
Yaojia Wang
2026-07-10 16:40:43 +02:00
parent e7f3bd05f0
commit 542fde9580
5 changed files with 1798 additions and 2 deletions

1025
test/push-fcm.test.ts Normal file

File diff suppressed because it is too large Load Diff