No commit activity in last 3 years
No release in over 3 years
Adds a feature to whitelist certain shops to access your shopify_app installation
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.1.4
~> 0.7
~> 0.45
~> 0.12
~> 0.8

Runtime

~> 5.0
 Project Readme

shopify_app_whitelist

Build Status codecov Docs Gem Version

This Gem extends shopify_app to add a whitelist option so only defined shops can access your app for installation.

Compatibility

v2.0 up - Rails 5 and Shopify App 8 are supported.

v1.0 up - Rails 4 and Rails 5, Shopify App <7.1 are supported. Appraisal Gem is used to test against both versions of Rails.

Installation

Assuming shopify_app is already installed

  1. Add gem 'shopify_app_whitelist' to your Gemfile
  2. Run bundle install

Configuration

  1. Open your existing config/initializers/shopify_app.rb file
  2. Add whitelist and whitelist_redirect options

Example:

ShopifyApp.configure do |config|
  # ...
  config.whitelist          = %w(allowed.myshopify.com another-allowed-shop.myshopify.com)
  config.whitelist_redirect = '/404.html'
  # ...
end

Testing

This Gem is tested. See test/ or run bundle rake test after installing development dependencies.

How It Works

This Gem adds two configuration options to ShopifyApp::Configuration automatically. Using a Railite, it also automatically injects a controller concern into ActionController::Base.

The concern will check if the current controller is shopify_app/sessions_controller and that the action is one of new, create, or callback. If it is, it will check the shop's Shopify domain against the whitelist to see if the shop is allowed to access these methods.

License

This project is released under the MIT license.