shopify_app 14.4.2 → 16.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +5 -0
- data/.github/workflows/build.yml +38 -0
- data/.github/workflows/rubocop.yml +1 -7
- data/.gitignore +0 -2
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +252 -0
- data/README.md +4 -4
- data/app/assets/images/storage_access.svg +1 -2
- data/app/controllers/shopify_app/callback_controller.rb +48 -21
- data/app/views/shopify_app/partials/_button_styles.html.erb +41 -36
- data/app/views/shopify_app/partials/_card_styles.html.erb +3 -3
- data/app/views/shopify_app/partials/_empty_state_styles.html.erb +28 -59
- data/app/views/shopify_app/partials/_form_styles.html.erb +56 -0
- data/app/views/shopify_app/partials/_layout_styles.html.erb +16 -1
- data/app/views/shopify_app/partials/_typography_styles.html.erb +6 -6
- data/app/views/shopify_app/sessions/enable_cookies.html.erb +1 -1
- data/app/views/shopify_app/sessions/new.html.erb +38 -110
- data/app/views/shopify_app/sessions/request_storage_access.html.erb +1 -1
- data/app/views/shopify_app/sessions/top_level_interaction.html.erb +20 -15
- data/docs/Releasing.md +5 -4
- data/lib/generators/shopify_app/controllers/controllers_generator.rb +1 -1
- data/lib/generators/shopify_app/install/install_generator.rb +1 -1
- data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +2 -2
- data/lib/generators/shopify_app/views/views_generator.rb +1 -1
- data/lib/shopify_app/controller_concerns/login_protection.rb +1 -1
- data/lib/shopify_app/engine.rb +21 -0
- data/lib/shopify_app/session/jwt.rb +3 -1
- data/lib/shopify_app/version.rb +1 -1
- data/package.json +1 -1
- metadata +5 -3
- data/.travis.yml +0 -27
@@ -49,7 +49,7 @@
|
|
49
49
|
</div>
|
50
50
|
</div>
|
51
51
|
<div class="Polaris-Stack__Item">
|
52
|
-
<div class="Polaris-Stack Polaris-Stack--distributionTrailing">
|
52
|
+
<div class="Polaris-Stack Polaris-Stack--distributionTrailing Polaris-Stack--distributionTrailingCustomSpacing">
|
53
53
|
<div class="Polaris-Stack__Item">
|
54
54
|
<button type="button" class="Polaris-Button Polaris-Button--primary" id="TriggerAllowCookiesPrompt">
|
55
55
|
<span class="Polaris-Button__Content"><span><%= I18n.t('request_storage_access_action') %></span></span>
|
@@ -5,6 +5,7 @@
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
6
|
<base target="_top">
|
7
7
|
<title>Redirecting…</title>
|
8
|
+
<%= render 'shopify_app/partials/card_styles' %>
|
8
9
|
<%= render 'shopify_app/partials/layout_styles' %>
|
9
10
|
<%= render 'shopify_app/partials/typography_styles' %>
|
10
11
|
<%= render 'shopify_app/partials/button_styles' %>
|
@@ -25,26 +26,30 @@
|
|
25
26
|
<div class="Polaris-Layout__Section">
|
26
27
|
<div class="Polaris-Stack Polaris-Stack--vertical">
|
27
28
|
<div class="Polaris-Stack__Item">
|
28
|
-
<div class="Polaris-
|
29
|
-
<div class="Polaris-
|
30
|
-
<div class="Polaris-
|
31
|
-
<div class="Polaris-
|
32
|
-
<div class="Polaris-
|
33
|
-
<
|
34
|
-
|
35
|
-
|
29
|
+
<div class="Polaris-Card">
|
30
|
+
<div class="Polaris-Card__Section">
|
31
|
+
<div class="Polaris-EmptyState">
|
32
|
+
<div class="Polaris-EmptyState__Section">
|
33
|
+
<div class="Polaris-EmptyState__DetailsContainer">
|
34
|
+
<div class="Polaris-EmptyState__Details">
|
35
|
+
<div class="Polaris-TextContainer">
|
36
|
+
<h1 class="Polaris-DisplayText Polaris-DisplayText--sizeSmall"><%= I18n.t('top_level_interaction_heading', app: ShopifyApp.configuration.application_name) %></h1>
|
37
|
+
<div class="Polaris-EmptyState__Content">
|
38
|
+
<p><%= I18n.t('top_level_interaction_body', app: ShopifyApp.configuration.application_name) %></p>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div class="Polaris-EmptyState__Actions">
|
42
|
+
<div class="Polaris-Stack Polaris-Stack--alignmentCenter">
|
43
|
+
<div class="Polaris-Stack__Item"><button type="button" id="TopLevelInteractionButton" class="Polaris-Button Polaris-Button--primary Polaris-Button--sizeLarge"><span class="Polaris-Button__Content"><span class="Polaris-Button__Icon"></span><span><%= I18n.t('top_level_interaction_action') %></span></span></button></div>
|
44
|
+
</div>
|
45
|
+
</div>
|
36
46
|
</div>
|
37
47
|
</div>
|
38
|
-
<div class="Polaris-
|
39
|
-
|
40
|
-
<div class="Polaris-Stack__Item"><button type="button" id="TopLevelInteractionButton" class="Polaris-Button Polaris-Button--primary Polaris-Button--sizeLarge"><span class="Polaris-Button__Content"><span class="Polaris-Button__Icon"></span><span><%= I18n.t('top_level_interaction_action') %></span></span></button></div>
|
41
|
-
</div>
|
48
|
+
<div class="Polaris-EmptyState__ImageContainer">
|
49
|
+
<%= image_tag 'storage_access.svg', role: "presentation", alt: "", class: "Polaris-EmptyState__Image" %>
|
42
50
|
</div>
|
43
51
|
</div>
|
44
52
|
</div>
|
45
|
-
<div class="Polaris-EmptyState__ImageContainer">
|
46
|
-
<%= image_tag 'storage_access.svg', role: "presentation", alt: "", class: "Polaris-EmptyState__Image" %>
|
47
|
-
</div>
|
48
53
|
</div>
|
49
54
|
</div>
|
50
55
|
</div>
|
data/docs/Releasing.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
Releasing ShopifyApp
|
1
|
+
# Releasing ShopifyApp
|
2
2
|
|
3
|
-
1.
|
3
|
+
1. Make the code changes in a separate PR that doesn't modify the version.
|
4
|
+
1. After that is merged, check the Semantic Versioning page for info on how to version the new release: http://semver.org
|
4
5
|
1. Create a pull request with the following changes:
|
5
6
|
- Update the version of ShopifyApp in lib/shopify_app/version.rb
|
6
7
|
- Update the version of shopify_app in package.json
|
@@ -8,11 +9,11 @@ Releasing ShopifyApp
|
|
8
9
|
- Change the title of the PR to something like: "Packaging for release X.Y.Z"
|
9
10
|
1. Merge your pull request
|
10
11
|
1. Checkout and pull from master so you have the latest version of the shopify_app
|
11
|
-
1. Tag the HEAD with the version
|
12
|
+
1. Tag the HEAD with the version
|
12
13
|
```bash
|
13
14
|
$ git tag -f vX.Y.Z && git push --tags --force
|
14
15
|
```
|
15
16
|
1. Use Shipit to build and push the gem
|
16
17
|
|
17
|
-
If you see an error like 'You need to create the vX.Y.X tag first', clear
|
18
|
+
If you see an error like 'You need to create the vX.Y.X tag first', clear git
|
18
19
|
cache in Shipit settings
|
@@ -64,7 +64,7 @@ module ShopifyApp
|
|
64
64
|
def insert_hosts_into_development_config
|
65
65
|
inject_into_file(
|
66
66
|
'config/environments/development.rb',
|
67
|
-
" config.hosts = (config.hosts rescue []) << /\\
|
67
|
+
" config.hosts = (config.hosts rescue []) << /\\w+\\.ngrok\\.io/\n",
|
68
68
|
after: "Rails.application.configure do\n"
|
69
69
|
)
|
70
70
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
ShopifyApp.configure do |config|
|
2
2
|
config.application_name = "<%= @application_name %>"
|
3
|
-
config.api_key = ENV
|
4
|
-
config.secret = ENV
|
3
|
+
config.api_key = ENV.fetch('SHOPIFY_API_KEY', '').presence || raise('Missing SHOPIFY_API_KEY')
|
4
|
+
config.secret = ENV.fetch('SHOPIFY_API_SECRET', '').presence || raise('Missing SHOPIFY_API_SECRET')
|
5
5
|
config.old_secret = "<%= @old_secret %>"
|
6
6
|
config.scope = "<%= @scope %>" # Consult this page for more scope options:
|
7
7
|
# https://help.shopify.com/en/api/getting-started/authentication/oauth/scopes
|
data/lib/shopify_app/engine.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module ShopifyApp
|
3
|
+
module RedactJobParams
|
4
|
+
private
|
5
|
+
|
6
|
+
def args_info(job)
|
7
|
+
log_disabled_classes = %w(ShopifyApp::ScripttagsManagerJob ShopifyApp::WebhooksManagerJob)
|
8
|
+
return "" if log_disabled_classes.include?(job.class.name)
|
9
|
+
super
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
3
13
|
class Engine < Rails::Engine
|
4
14
|
engine_name 'shopify_app'
|
5
15
|
isolate_namespace ShopifyApp
|
@@ -21,5 +31,16 @@ module ShopifyApp
|
|
21
31
|
app.config.middleware.insert_after(ShopifyApp::SameSiteCookieMiddleware, ShopifyApp::JWTMiddleware)
|
22
32
|
end
|
23
33
|
end
|
34
|
+
|
35
|
+
initializer "shopify_app.redact_job_params" do
|
36
|
+
ActiveSupport.on_load(:active_job) do
|
37
|
+
if ActiveJob::Base.respond_to?(:log_arguments?)
|
38
|
+
WebhooksManagerJob.log_arguments = false
|
39
|
+
ScripttagsManagerJob.log_arguments = false
|
40
|
+
elsif ActiveJob::Logging::LogSubscriber.private_method_defined?(:args_info)
|
41
|
+
ActiveJob::Logging::LogSubscriber.prepend(RedactJobParams)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
24
45
|
end
|
25
46
|
end
|
@@ -2,7 +2,9 @@
|
|
2
2
|
module ShopifyApp
|
3
3
|
class JWT
|
4
4
|
class InvalidDestinationError < StandardError; end
|
5
|
+
|
5
6
|
class MismatchedHostsError < StandardError; end
|
7
|
+
|
6
8
|
class InvalidAudienceError < StandardError; end
|
7
9
|
|
8
10
|
WARN_EXCEPTIONS = [
|
@@ -25,7 +27,7 @@ module ShopifyApp
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def shopify_user_id
|
28
|
-
@payload && @payload['sub']
|
30
|
+
@payload['sub'].to_i if @payload && @payload['sub']
|
29
31
|
end
|
30
32
|
|
31
33
|
private
|
data/lib/shopify_app/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 16.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: browser_sniffer
|
@@ -245,14 +245,15 @@ files:
|
|
245
245
|
- ".github/ISSUE_TEMPLATE.md"
|
246
246
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
247
247
|
- ".github/probots.yml"
|
248
|
+
- ".github/workflows/build.yml"
|
248
249
|
- ".github/workflows/rubocop.yml"
|
249
250
|
- ".gitignore"
|
250
251
|
- ".nvmrc"
|
251
252
|
- ".rubocop.yml"
|
252
253
|
- ".ruby-version"
|
253
|
-
- ".travis.yml"
|
254
254
|
- CHANGELOG.md
|
255
255
|
- Gemfile
|
256
|
+
- Gemfile.lock
|
256
257
|
- LICENSE
|
257
258
|
- README.md
|
258
259
|
- Rakefile
|
@@ -277,6 +278,7 @@ files:
|
|
277
278
|
- app/views/shopify_app/partials/_button_styles.html.erb
|
278
279
|
- app/views/shopify_app/partials/_card_styles.html.erb
|
279
280
|
- app/views/shopify_app/partials/_empty_state_styles.html.erb
|
281
|
+
- app/views/shopify_app/partials/_form_styles.html.erb
|
280
282
|
- app/views/shopify_app/partials/_layout_styles.html.erb
|
281
283
|
- app/views/shopify_app/partials/_typography_styles.html.erb
|
282
284
|
- app/views/shopify_app/sessions/enable_cookies.html.erb
|
data/.travis.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
sudo: required
|
2
|
-
dist: trusty
|
3
|
-
addons:
|
4
|
-
chrome: stable
|
5
|
-
before_script:
|
6
|
-
- "sudo chown root /opt/google/chrome/chrome-sandbox"
|
7
|
-
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
|
8
|
-
language: ruby
|
9
|
-
cache:
|
10
|
-
bundler: true
|
11
|
-
directories:
|
12
|
-
- node_modules
|
13
|
-
yarn: true
|
14
|
-
|
15
|
-
rvm:
|
16
|
-
- 2.5
|
17
|
-
- 2.6
|
18
|
-
- 2.7
|
19
|
-
|
20
|
-
install:
|
21
|
-
- bundle install
|
22
|
-
- nvm install node
|
23
|
-
- yarn
|
24
|
-
|
25
|
-
script:
|
26
|
-
- yarn test
|
27
|
-
- bundle exec rake test
|