Repository navigation
Relax dependencies, fix the SHOPLINE flow, and automate releases - #4
Merged
Merged
Conversation
Prepares the first push to RubyGems.org. Runtime dependencies become `omniauth >= 2.0, < 4` and `omniauth-oauth2 >= 1.8, < 3`. A plugin's ceiling becomes a ceiling in every application that installs it, so this allows the next major of both gems rather than blocking consumers on the day one ships. The floors are where OmniAuth 2 support actually begins -- omniauth-oauth2 1.8.0 is its first release to require `omniauth ~> 2.0` -- and a CI job runs the suite against those floors so the range is tested rather than assumed. The integration specs added here found the flow could not complete at all, so this also fixes, against SHOPLINE's docs and its official Go SDK: - `appKey` was always empty. The strategy read `options.app_key`, which the `client_id`/`client_secret` positional arguments never set, so the app secret used for signing was nil too. - The authorize URL put its query in front of the `#` fragment, because `OAuth2::Client#authorize_url` cannot build a URL for a hash-routed page. SHOPLINE's admin page never read those params. - The token request was signed with the sorted-parameter scheme SHOPLINE uses for GETs. A POST is signed over the request body concatenated with the millisecond timestamp. - Every callback failed `csrf_detected`. SHOPLINE has no `state` parameter, so the nonce now travels in `customField`, the documented pass-through, and the `sign` on the callback query is verified the way SHOPLINE's SDK verifies it. Both checks are opt-out. - `callback_url` doubled a mount prefix, since omniauth 2 moved SCRIPT_NAME into `callback_path` itself. - An error payload called `fail!` from inside `build_access_token` and handed the resulting Rack triple back as the access token. Packaging and tooling follow omniauth-fdc and omniauth-shipbob: MIT license declared in the gemspec, development scaffolding kept out of the built gem, GitHub Actions for CI and a weekly bundle-audit, and releases published from the GitHub Releases UI via RubyGems trusted publishing. Co-Authored-By: Claude Opus 5 (1M context) <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.
Prepares the first push of
omniauth-shoplineto RubyGems.org, following the same treatment as omniauth-fdc and omniauth-shipbob.Dependencies
A plugin's ceiling becomes a ceiling in every application that installs it, so this allows the next major of both gems rather than blocking consumers on the day one ships. Note
~> 1.6was already>= 1.6, < 2.0, so it never blocked a released version — permitting the next major is the only real loosening available.The floors are where OmniAuth 2 support actually begins (
omniauth-oauth21.8.0 is its first release to requireomniauth ~> 2.0), andgemfiles/floor.gemfileplus a CI job run the whole suite against them, so the range is tested rather than assumed.Strategy fixes
The integration specs added here found the flow could not complete at all. Fixed against SHOPLINE's docs and its official Go SDK:
appKeywas always empty. The strategy readoptions.app_key, which theclient_id/client_secretpositional arguments never set, so the app secret used for signing wasniltoo. Now read from the positional credentials, withapp_key:/app_secret:accepted as named options.OAuth2::Client#authorize_urlcannot build a URL for a hash-routed page — it produced/admin/oauth-web/?appKey=...#/oauth/authorize, with the query in front of the fragment where the admin page never reads it.csrf_detected. SHOPLINE has nostateparameter, so the nonce now travels incustomField(the documented pass-through) and is checked against the session. Thesignon the callback query is verified the way SHOPLINE's SDK verifies it. Both checks are opt-out viaverify_state: false/verify_signature: false.callback_urldoubled a mount prefix, since omniauth 2 movedSCRIPT_NAMEintocallback_pathitself.fail!from insidebuild_access_tokenand handed the resulting Rack triple back as the access token; it now raisesOAuth2::Error, which OmniAuth turns into aninvalid_credentialsfailure.Also:
scopereachesOAuth2::AccessTokenunder a string key (it was a symbol, soextra['scope']was alwaysnil), an explicitly configuredclient_options[:site]now survives, the nonce and signature are compared in constant time, and the unusedtoken_paramsdefault is gone.Packaging and tooling
LICENSE.txtdeclared in the gemspec, along withrequired_ruby_versionand the usual metadata; development scaffolding stays out of the built gem.bundle-audit, and a release workflow that publishes from the GitHub Releases UI via RubyGems trusted publishing (OIDC, no stored API key).callback_urloverrides.Before releasing
verify_signatureis the change most likely to need its escape hatch if a callback's parameter shape differs from the docs.uidis still unset (changing it would alter identity records in a consuming app;extra['handle']carries the store), andhandleis read once at build time, so multi-store means oneproviderentry per store. Both documented in the README.🤖 Generated with Claude Code