zendesk_apps_support 4.33.0 → 4.35.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/en.yml +1 -0
- data/config/locales/translations/zendesk_apps_support.yml +4 -0
- data/lib/zendesk_apps_support/assets/installed.js.erb +0 -4
- data/lib/zendesk_apps_support/installation.rb +1 -1
- data/lib/zendesk_apps_support/installed.rb +1 -2
- data/lib/zendesk_apps_support/validations/manifest.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80ecd480e751e33df50e0312c36d11b97e0ba71d9127767dd4f8aee6969dd1dc
|
4
|
+
data.tar.gz: ce00268cb0323d00494ad7683385357ec2130426bc6d2ebb6cdf4d3a776aeca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23697c4eb67b7222d4bd28dc64be9974f1517d034f669e08cd726d35e75a3f6ce91d9ba4706aedcfa569423ea2870ee12a3c84c43eec0e81894fe36448b00af6
|
7
|
+
data.tar.gz: 3614e2ab9ce99734803e64f9138001284ae43a7b9316d2805c5b8eaf3f7f475e96c4a8719d2a6bbf06b2dcf6fc780fb45d2dd15ffa7e6ea853018d4330f0f108
|
data/config/locales/en.yml
CHANGED
@@ -148,6 +148,7 @@ en:
|
|
148
148
|
other: "%{invalid_locations} are invalid locations in framework v1."
|
149
149
|
oauth_parameter_cannot_be_secure: oauth parameter cannot be set to be
|
150
150
|
secure.
|
151
|
+
invalid_url: '%{field} must be a valid URL, got "%{value}".'
|
151
152
|
warning:
|
152
153
|
app_build:
|
153
154
|
deprecated_version: You are targeting a deprecated version of the framework.
|
@@ -412,3 +412,7 @@ parts:
|
|
412
412
|
key: "txt.apps.admin.error.app_build.oauth_parameter_cannot_be_secure"
|
413
413
|
title: "oauth parameter cannot be set to be secure."
|
414
414
|
value: "oauth parameter cannot be set to be secure."
|
415
|
+
- translation:
|
416
|
+
key: "txt.apps.admin.error.app_build.invalid_url"
|
417
|
+
title: "App builder job: this value needs to be a valid URL, but something else was passed in. placeholder value is taken from user input. You can translate as: The value %{field} must be a valid URL... to avoid any gender issues."
|
418
|
+
value: "%{field} must be a valid URL, got \"%{value}\"."
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module ZendeskAppsSupport
|
4
4
|
class Installation
|
5
5
|
attr_accessor :id, :app_id, :app_name, :requirements, :settings, :enabled, :collapsible, :updated_at, :created_at
|
6
|
-
attr_accessor :plan
|
6
|
+
attr_accessor :plan, :stripe_subscription_id
|
7
7
|
|
8
8
|
def initialize(options)
|
9
9
|
options.each do |k, v|
|
@@ -16,8 +16,7 @@ module ZendeskAppsSupport
|
|
16
16
|
INSTALLED_TEMPLATE.result(
|
17
17
|
appsjs: @appsjs,
|
18
18
|
installations: @installations,
|
19
|
-
installation_orders: options.fetch(:installation_orders, {})
|
20
|
-
rollbar_zaf_access_token: options.fetch(:rollbar_zaf_access_token, '')
|
19
|
+
installation_orders: options.fetch(:installation_orders, {})
|
21
20
|
)
|
22
21
|
end
|
23
22
|
|
@@ -39,6 +39,7 @@ module ZendeskAppsSupport
|
|
39
39
|
type_checks(manifest),
|
40
40
|
oauth_error(manifest),
|
41
41
|
default_locale_error(manifest, package),
|
42
|
+
validate_urls(manifest),
|
42
43
|
validate_parameters(manifest),
|
43
44
|
if manifest.requirements_only? || manifest.marketing_only?
|
44
45
|
[ ban_location(manifest),
|
@@ -63,6 +64,20 @@ module ZendeskAppsSupport
|
|
63
64
|
]
|
64
65
|
end
|
65
66
|
|
67
|
+
def validate_urls(manifest)
|
68
|
+
errors = []
|
69
|
+
|
70
|
+
if manifest.terms_conditions_url && !valid_url?(manifest.terms_conditions_url)
|
71
|
+
errors << ValidationError.new(:invalid_url, field: 'terms_conditions_url', value: manifest.terms_conditions_url)
|
72
|
+
end
|
73
|
+
|
74
|
+
author = manifest.author
|
75
|
+
if author && author["url"] && !valid_url?(author["url"])
|
76
|
+
errors << ValidationError.new(:invalid_url, field: 'author url', value: author["url"])
|
77
|
+
end
|
78
|
+
errors
|
79
|
+
end
|
80
|
+
|
66
81
|
def validate_parameters(manifest)
|
67
82
|
if manifest.marketing_only?
|
68
83
|
marketing_only_errors(manifest)
|
@@ -416,6 +431,13 @@ module ZendeskAppsSupport
|
|
416
431
|
ValidationError.new(:invalid_no_template)
|
417
432
|
end
|
418
433
|
end
|
434
|
+
|
435
|
+
def valid_url?(value)
|
436
|
+
uri = URI.parse(value)
|
437
|
+
uri.is_a?(URI::HTTP) && !uri.host.nil?
|
438
|
+
rescue URI::InvalidURIError
|
439
|
+
false
|
440
|
+
end
|
419
441
|
end
|
420
442
|
end
|
421
443
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_apps_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.35.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Rosen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-06-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: i18n
|