recaptcha 5.12.0 → 5.12.3

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: 4696b1987122715318c6ea1ce3ce1930dfe1cf9aad40913e74617f746db4176b
4
- data.tar.gz: ab251d09e9ad5f9596dc8a8a0d70d9f108dbfbafaaff92fbfe72758877f84354
3
+ metadata.gz: 4052ca42cf536d84329b553a058de58f2c3579e0ac2ad1e08ba42fed8ce974b4
4
+ data.tar.gz: 90c873c15d0772690ca3da6cf2588669a05c159e4fbaa1d6bdf5d809ad05dfd0
5
5
  SHA512:
6
- metadata.gz: 764ffc3bad21f61f1b6d87212af60fcfa2533fe643de904a127f4ae47227aec45965a9d118429ea262e638e9021b62387716e8e96c3748ba71cb21cf96a7edc0
7
- data.tar.gz: 5a61522e047c0a2fe8da6a6facdd4228dbd322904144f15646bf5a8ea7adbff51fbf6ce7b880a406a01192fc3adf9128a875611307b352a19f2501d72ff309a9
6
+ metadata.gz: 403d9de96d890bb3f75cfb83c5907f01944d8e88233248ec199fe014e04f7f1386c13cd867c9020a232cd5501faada986f6d3413d3a2369e5d38d9c56a0704b9
7
+ data.tar.gz: ce0d965054455acff094e60ccad808fbf836992666f9bd1233684b172e766440ba922a0f8d030803575b3a538945e3273d0ae237ce2527f9e0983b7b76671328
data/CHANGELOG.md CHANGED
@@ -1,8 +1,21 @@
1
1
  ## Next
2
2
 
3
- * Added Dutch locale
3
+ ## 5.12.3
4
+ * Remove score fallback for enterprise
5
+ * Update enterprise tests to v1 assessment schema
6
+
7
+ ## 5.12.2
8
+ * Fix minimum score for enterprise
9
+
10
+ ## 5.12.1
11
+ * Fix Japanese locale
12
+
13
+ ## 5.12.0
4
14
  * Added Japanese locale
5
15
 
16
+ ## 5.11.0
17
+ * Added Dutch locale
18
+
6
19
  ## 5.10.1
7
20
  * Fix enterprise_verify_url #415
8
21
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.12.0'
4
+ VERSION = '5.12.3'
5
5
  end
data/lib/recaptcha.rb CHANGED
@@ -77,13 +77,14 @@ module Recaptcha
77
77
  body['event']['userIpAddress'] = options[:remote_ip] if options.key?(:remote_ip)
78
78
 
79
79
  reply = api_verification_enterprise(query_params, body, project_id, timeout: options[:timeout])
80
+ score = reply.dig('riskAnalysis', 'score')
80
81
  token_properties = reply['tokenProperties']
81
82
  success = !token_properties.nil? &&
82
83
  token_properties['valid'].to_s == 'true' &&
83
84
  hostname_valid?(token_properties['hostname'], options[:hostname]) &&
84
85
  action_valid?(token_properties['action'], options[:action]) &&
85
- score_above_threshold?(reply['score'], options[:minimum_score]) &&
86
- score_below_threshold?(reply['score'], options[:maximum_score])
86
+ score_above_threshold?(score, options[:minimum_score]) &&
87
+ score_below_threshold?(score, options[:maximum_score])
87
88
 
88
89
  if options[:with_reply] == true
89
90
  [success, reply]
data/rails/locales/ja.yml CHANGED
@@ -1,4 +1,4 @@
1
- en:
1
+ ja:
2
2
  recaptcha:
3
3
  errors:
4
4
  verification_failed: reCAPTCHA認証に失敗しました。もう一度お試しください。
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.12.0
4
+ version: 5.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason L Perry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-28 00:00:00.000000000 Z
11
+ date: 2022-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json