zendesk_apps_support 4.33.0 → 4.34.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0358535696ec34c00e8eb9b6d2aa3c0575ddca2dec7df2f516e15099788f96c2'
4
- data.tar.gz: 178611fb26e2bd7552c8e6b82c520854f40455ef71b3fa685690f2666df8e1a9
3
+ metadata.gz: daadfd24b104643d1232b9d0806cccfd9019e73f3e124eb25eea78215deadebf
4
+ data.tar.gz: 101976ef21c36e7c07249ed91aac765861a57b7fa87fb02a57d00aaf353a57dd
5
5
  SHA512:
6
- metadata.gz: 6a2cfbba4f1726d72874e64d4e59612b43cfc429a0d2944896824e8751ea8445953bb52576b885967b4601a0faa5a6c727667b8768b13d0bf06b8fdee5a1e104
7
- data.tar.gz: dc364377373e42668dce9f13cb30abf30e64d360c18f2c0d7bd3401c4005c2b22c3774fdf56c77d26ab0e077416d2853562e7daed87e2f396faa74950b82e205
6
+ metadata.gz: d3535f5a0f2da21a3865a5891d4d2ad35d38876dd54ff6ece6c41933935f133681e7b45d95a8efe1abd5acc93421a37cac2150586e90d95c563f01894011d579
7
+ data.tar.gz: 9d15fa32361ce1979f4dccbd1eba7e630d337b929c85e54eafbddf4651d741babaa5f99bff06d657e3b6cd28dabafb1aea74e2dcd21acf95809785ad9d98bcea
@@ -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}\"."
@@ -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.33.0
4
+ version: 4.34.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-05-19 00:00:00.000000000 Z
14
+ date: 2022-05-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n