recaptcha 5.18.0 → 5.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41990aba0d4786ebf87da392ac025d8725d5ca5f30c9e1018b0cf2197f8efada
4
- data.tar.gz: 34b8d6b1dc5e34d9349c64f3a2d2c77f0cc67b2570077788e9e128d2a855a927
3
+ metadata.gz: 61fa7316f287cfcec8e2b06d36481f1fa596d1b629810a784fae509c55255b2f
4
+ data.tar.gz: 7cf82254973204d7ac47b6bba428ff394e24c9ec5dbbb5669657b4c10b30c16b
5
5
  SHA512:
6
- metadata.gz: b3d440a27b41351c81ca9ad94368ea5485d1a1bed05092c011bbfe358cb8c829e89bc295a52a0e323333fc1a3135384149bd3ec13f0cd4c6a8fcc09184a3d4d4
7
- data.tar.gz: f176ce1beb9764f342dedc8c36cbc40b248ae230c758f2df3053c891c5616b4898e435fde8251da03ff5e690b535bef64bdc7e2257aadc8755f7f0e4efbddbfd
6
+ metadata.gz: 572402b7af72a67f76a1952cb7e5739a7cf4073ba0b510f55f8f74bc59a6e6116bad1be5ece41e20a43cb2d3c36c7ab2bca072b8a4c27b5a1db16d1007846284
7
+ data.tar.gz: 021a0fa67e25aee448c66c43ae5fd3295d1472329bccdcfe4a5acf2c6fe90fd83c9cdcf8963db29816919fb6383d49c8303d41032e1af8abde3dcafbdeacc36a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  ## Next
2
+
3
+
4
+
5
+ ## 5.19.0
6
+ * require a minimum lenght of 100 for responses, configured via response_minimum
7
+
8
+ ## 5.18.0
2
9
  * Add key setup to v3 example in README
3
10
  * Remove unnecessary id from textarea - This was unused and may cause accessability concerns if there is more than one recaptcha on the page due to multiple elements with the same id
4
11
  * Update to latest version of rubocop
data/README.md CHANGED
@@ -589,6 +589,7 @@ Recaptcha.configure do |config|
589
589
  config.verify_url = 'https://hcaptcha.com/siteverify'
590
590
  config.api_server_url = 'https://hcaptcha.com/1/api.js'
591
591
  config.response_limit = 100000
592
+ config.response_minimum = 100
592
593
  end
593
594
  ```
594
595
 
@@ -37,8 +37,10 @@ module Recaptcha
37
37
  'enterprise_verify_url' => 'https://recaptchaenterprise.googleapis.com/v1/projects'
38
38
  }.freeze
39
39
 
40
- attr_accessor :default_env, :skip_verify_env, :proxy, :secret_key, :site_key, :handle_timeouts_gracefully,
41
- :hostname, :enterprise, :enterprise_api_key, :enterprise_project_id, :response_limit
40
+ attr_accessor(
41
+ :default_env, :skip_verify_env, :proxy, :secret_key, :site_key, :handle_timeouts_gracefully,
42
+ :hostname, :enterprise, :enterprise_api_key, :enterprise_project_id, :response_limit, :response_minimum
43
+ )
42
44
  attr_writer :api_server_url, :verify_url
43
45
 
44
46
  def initialize # :nodoc:
@@ -57,6 +59,7 @@ module Recaptcha
57
59
  @api_server_url = nil
58
60
 
59
61
  @response_limit = 4000
62
+ @response_minimum = 100
60
63
  end
61
64
 
62
65
  def secret_key!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.18.0'
4
+ VERSION = '5.19.0'
5
5
  end
data/lib/recaptcha.rb CHANGED
@@ -55,7 +55,7 @@ module Recaptcha
55
55
  end
56
56
 
57
57
  def self.invalid_response?(resp)
58
- resp.empty? || resp.length > configuration.response_limit
58
+ resp.empty? || resp.length > configuration.response_limit || resp.length < configuration.response_minimum
59
59
  end
60
60
 
61
61
  def self.verify_via_api_call(response, options)
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.18.0
4
+ version: 5.19.0
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: 2024-12-08 00:00:00.000000000 Z
11
+ date: 2025-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mocha