Resolves the shop from a verified Shopify app-proxy request and makes it
available via Shopifex.Plug.current_shop/1.
App-proxy requests carry a signed shop param, but Shopifex.Plug.ValidateHmac
only verifies the signature — it does not load the shop. Run this plug after
ValidateHmac (the default :shopify_proxy pipeline does) so proxy controllers
can use Shopifex.Plug.current_shop(conn).
Shopify signs the app-proxy query params only, so this plug reads shop
from conn.query_params — the bytes ValidateHmac authenticated — not from
conn.params, whose value a POST body can shadow.
Options
:on_missing— what to do when the signedshopis absent or not found in the database::pass(default) — continue withcurrent_shop/1returningnil, so existing proxy endpoints that don't need the shop are unaffected.:halt— respond401and halt.
Example
pipeline :strict_proxy do
plug :fetch_session
plug Shopifex.Plug.FetchFlash
plug Shopifex.Plug.ValidateHmac
plug Shopifex.Plug.LoadProxyShop, on_missing: :halt
end