The trust boundary#
- The page is untrusted. Anything from the browser can be changed by the user. Prices, totals, availability, ownership and status changes are decided by your server from its database; the page sends ids only.
- Secrets stay on the server. The client secret and your event-signing key never appear in the page, the bundle or the repository.
- Identity comes from the code exchange. Never trust a user id the page sends you. Use the
subyour server got fromexchangeCode. - Calls from SALOPHA are signed. Verify every
webhooks,actionsandobjects/*call before acting on it.
Your pages#
- Serve only over HTTPS, from an origin listed in
allowedOrigins. - Use a strict Content Security Policy without
unsafe-eval, and allow framing by SALOPHA:frame-ancestors 'self' https://web.salopha.com https://salopha.com. - Keep HTML free of personal data, especially with the
localruntime mode, which may serve pages from the device. Load personal data from your API under anetworkOnlyPathsprefix. - Never cache personal data beyond the user's session, and honour
platform.consent.revoked.v1at once. - Store uploads in folders derived from
sub, and serve private documents through short-lived signed links. - Answer other tenants' records with 404, not 403, so their existence isn't revealed.
What the bridge enforces#
- The bridge answers only your
allowedOrigins. - Every request is bound to the launch session with a fresh nonce; replays fail.
- There is no token API, and credential-looking parameters are refused.
- Only known methods can be sent; server-only scopes can't be requested.
See Security rules in the SDK reference.
Testing#
- In a browser:
devSimulator: trueanswers all 45 methods with mock data and asks consent withwindow.confirm(). Simulate a chat launch withdevSimulator: { launch: { source: "chat", … } }. - Against a local hub: run the SALOPHA backend locally, register your app with the registration file, sign in with a phone code and call your
/auth/salophawith a real launch code. - On a device: the production SALOPHA app opens only HTTPS origins from your manifest. Use a staging origin of your own until you go live.
- Web and desktop: check the page inside
web.salopha.comand at 1280 pixels wide. See Web and desktop.
Go-live checklist#
- Origin: HTTPS, a CSP without
unsafe-eval,frame-ancestorsallowing SALOPHA (see above). - Manifest: a 512 × 512 icon, logo, brand colours, as few scopes as possible, the runtime mode,
platforms,minHostVersion, a privacy policy URL. - Server:
SALOPHA_API_BASE,SALOPHA_APP_ID,SALOPHA_CLIENT_ID,SALOPHA_CLIENT_SECRETset; a sign-in route; a webhook route that checks signatures; users keyed bysub. - Release: created and published in the console. Open the app from the Services tab on a phone and check: splash then ready, sign-in, a notification round trip, a shared link, the home-screen shortcut.
- Chat actions (if any):
objects/searchandobjects/resolveanswer signed calls fast with public data only. From a chat: search and send a card; open an action, «Send to chat», and land back in the chat with the card. - Transactions (if any): events signed, retried from an outbox with the same
eventId, versions increasing, nothing sensitive indetails. - Web and desktop (if listed in
platforms): SDK 1.3, the frame allowed,not_in_hosthandled.
Conventions that help#
- Arabic first: every screen works right to left and at 1.6× text size; numbers and phone numbers are isolated left to right.
- Never write the platform's name in your copy; use
getAppInfo().hostName. - Status changes go through an explicit transition table and write an event row in the same database transaction, then publish from an outbox.
- Every user-visible change ships as a new release version.
Reporting a vulnerability#
Write to [email protected] with the details. Please don't test against other users' data.