recaptcha 5.11.0 → 5.12.2

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: 38e036fb8f08d4dae667c9d96d9cd4a9c1ab9be5aa28da3536aa3dd8a5c7249e
4
- data.tar.gz: 37ba49dd5b14e0496f7ae75d09759af24b29375307bef681a458b67fbd3c6d65
3
+ metadata.gz: 6a8e985580ee7e6829b2b213403c7a7062167dac7f5184800b6585b0897cdaab
4
+ data.tar.gz: 9b7dd59495998217cdc96ec7436163f3faec7fccdc5c60ebd21611ccec1f9ad5
5
5
  SHA512:
6
- metadata.gz: 0be5f9597502c5f043753c20569c715591734c74ddf58187911fd37ec03e488e4deacb94f94c610810fd6cb995036f964da10816df0387ad5d80f3ef168cc669
7
- data.tar.gz: 46aea556958dade97ca173299245c991d3b558a4a14ee3c6696d6f2162208705a404678195957395f736e21d15cda118c4b69f162faf1b9495ea679940c75f33
6
+ metadata.gz: ce899e801c0679cfa3e4074826ef349d6142914fafbef12bfd69467811b3e7d4855638f53f13f469224f5500911f4481240c54d5f394bc767337a1a3f747b778
7
+ data.tar.gz: d4c7626d90d7423d446bb03178476c30e78db7a3834443f70bb395f3fe8380b7e5ae70cb8ab5a2931e9f82e1a0b5053ac59f1dad8ac6244f55bc9138e089b86c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Next
2
2
 
3
+ ## 5.12.2
4
+ * Fix minimum score for enterprise
5
+
6
+ ## 5.12.1
7
+ * Fix Japanese locale
8
+
9
+ ## 5.12.0
10
+ * Added Japanese locale
11
+
12
+ ## 5.11.0
3
13
  * Added Dutch locale
4
14
 
5
15
  ## 5.10.1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.11.0'
4
+ VERSION = '5.12.2'
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') || reply['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]
@@ -0,0 +1,5 @@
1
+ ja:
2
+ recaptcha:
3
+ errors:
4
+ verification_failed: reCAPTCHA認証に失敗しました。もう一度お試しください。
5
+ recaptcha_unreachable: 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.11.0
4
+ version: 5.12.2
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-25 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
@@ -156,6 +156,7 @@ files:
156
156
  - lib/recaptcha/version.rb
157
157
  - rails/locales/en.yml
158
158
  - rails/locales/fr.yml
159
+ - rails/locales/ja.yml
159
160
  - rails/locales/nl.yml
160
161
  homepage: http://github.com/ambethia/recaptcha
161
162
  licenses: