Files
opal-ios-studio/docs/connected-catalog.md

12 lines
2.0 KiB
Markdown

# Client catalog read-through
Studio can read the current Client workspace catalog through the configured trusted `STUDIO_CLIENT_CATALOG_URL`. `STUDIO_CLIENT_PUBLIC_ORIGIN` identifies the public Client origin for relative image references; neither setting is inferred from an arbitrary browser URL. Both are required by the service entrypoint before production startup.
The workspace resolver first verifies the active Auth identity and canonical Client membership. Its server-only catalog reader forwards the selected access cookie and canonical tenant to Client, then checks that the response's client UUID and tenant match the resolved workspace. Browser-supplied client IDs and unrelated cookies are not forwarded. Responses are bounded in size and time; redirects are rejected. Provider/database credentials remain in Client.
The connected catalog is a read-only store alongside imports. Studio does not copy it to the private import JSON file, change its prices, write products back, or remove it through the import deletion endpoint. Source zero/unknown prices and optional currency remain distinct. Products use the same-origin image route; another connected client identifier cannot select an image.
A bounded per-client cache keeps a successful connected read for 30 seconds. It is capped at 100 entries/64 MiB, coalesces simultaneous reads for one client, and allows at most two cold reads across clients. Every API/image request still resolves its authenticated workspace before looking at the cache. Expired/failed reads do not silently become an empty catalog or stale success. The source fetch timestamp is retained.
The candidate image passes 65 tests, including the prior catalog/import/image/frontend checks. Tests use explicit source fixtures and no network during execution. This is not a production merchant read or a released service. Client's matching gated catalog endpoint must be deployed first, after full build/startup/recovery checks. Persistent Studio configuration and post-release verification remain open. Meta 1-Click Connector is excluded.