api/internal/gamification/game_url_policy library

Classes

GameRewardsPagePolicy
The rewards page: https only, and navigation stays pinned to the page's own origin (the rewards backend), so a reward link can never drive the page elsewhere. Pure logic, no web view.
GameURLPolicy
Folder allow-list for one pinned bundle. Top-level navigation stays inside the skin version's folder; subresources may additionally load https images, fonts and audio from any host. Everything else is cancelled by the web view host. Pure logic, no web view, so unit tests drive it directly.

Functions

allowedBundleOrigin(String url, {String? apiBaseUrl}) → String
The normalized origin (scheme://host[:port]) of url when a skin bundle may load from it, else "". A bundle is allowed over https, or over http only when its origin equals the origin of apiBaseUrl (the Test Kit mock serves skins from its own origin). Scheme and host compare case-insensitively; a default port is dropped. Never throws. Port of Android allowedBundleOrigin.