Repository navigation
feat(shopify): run on shopify_api 1.0.0-rc.2 instead of a client of our own - #36
Merged
Merged
Conversation
…ur own Every exchange with Shopify now goes through `shopify_api`. OpenShop keeps what is its own: which shop may get a token, the `installations` table, and the checks it makes beyond a signature. - `graphql!` is `shopify_api`'s, re-exported. An app depends on `shopify_api`, pins `[package.metadata.shopify_api] api-version` (2026-10 in the templates) and commits `graphql/admin.schema.json`, which `openshop init` now writes. `openshop-graphql`, openshop's macro, `GraphqlOperation` and `openshop codegen` are removed. - `ShopifyClient` runs on `shopify_api::Shopify`: throttling, retries, 401 renewal, and `api()` for pagination, bulk operations and webhook subscriptions. - The client credentials grant, the token exchange and the OAuth code exchange are `shopify_api` requests. One shared client per app, shop and kind of grant serves concurrent callers; its `TokenStore` writes the installation row only where it still holds what was read, and a refused or failed grant falls back to the stored token as before. - Session tokens, launches, OAuth callbacks, app proxy requests and webhooks are verified by `shopify_api` (stricter: 10 s of JWT skew, exact `dest`/`iss`, 90 s for signed queries, JSON-object webhooks). - `shopify_api` runs without its HTTP client: `ReqwestTransport` gives it the reqwest and the TLS of the workspace (no redirection, 10 MiB cap, streamed bulk results). `MockTransport` implements the same trait. The breaking changes are listed in the CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p alone - openshop::graphql! passes `crate = ::openshop::shopify_api` to the macro of shopify_api, and openshop::shopify::input! does the same for input objects: an application no longer lists shopify_api in its Cargo.toml. The templates drop it, and openshop re-exports the crate as openshop::shopify_api. - A refusal of the token endpoint is read from the status and OAuth code that Error::Auth now carries, not parsed back from its message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every exchange with Shopify goes through
shopify_api1.0.0-rc.2. OpenShop keeps what is its own: which shop may get a token, theinstallationstable, and the checks it makes beyond a signature.What moved to
shopify_apigraphql!isshopify_api's, wrapped asopenshop::graphql!withcrate = ::openshop::shopify_api(andopenshop::shopify::input!for input objects), so an app depends onopenshopalone. It pins[package.metadata.shopify_api] api-version(2026-10 in the templates) and commitsgraphql/admin.schema.json, whichopenshop initnow writes. Removed:openshop-graphql, openshop's macro,GraphqlOperation,openshop codegen.ShopifyClientruns onshopify_api::Shopify(throttling, retries, 401 renewal;api()for pagination, bulk operations, webhook subscriptions). The client credentials grant, token exchange and OAuth code exchange areshopify_apirequests. One shared client per app, shop and kind of grant serves concurrent callers; itsTokenStorewrites the row only where it still holds what was read. A refused grant falls back to the stored token, as before.shopify_apiruns without its own HTTP client.ReqwestTransportgives it the workspace's reqwest 0.12 and TLS stack, so there is no second reqwest and no aws-lc-rs next to ring. It still follows no redirection, caps whole answers at 10 MiB, and streams bulk results.Behavior changes (stricter)
nbfhad 60 s.destandissmust be written exactly as Shopify writes them.401; it used to be served from the stored token.The full list is in the CHANGELOG.
Fixed in
shopify_apirc.2Found while porting, fixed in shopify_api and published as 1.0.0-rc.2 (0xtlt/shopify_api#33):
verify_app_proxysorted the signed pairs by key; Shopify sorts thekey=valuestrings. Requests with parameters likepage/page2were refused. Fixed.Error::Authnow carries the token endpoint's status and OAuth code. openshop reads those fields instead of parsing the message to choose the 1 h or 30 s hold-back.graphql!andinput!takecrate = path. openshop uses it, and the templates no longer listshopify_api.Checks
cargo test --workspace --all-features: 1,259 passed, 0 failed (PostgreSQL 17). One webhook test failed once and then passed 3 runs in a row; it doesn't touch this change.cargo clippy --workspace --all-targets -D warnings: clean.mdbook build docs: OK.openshop init --template=minimalbuilds with the shipped schema, depending onopenshopandserdeonly.🤖 Generated with Claude Code