recaptcha 5.16.0 → 5.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +15 -3
- data/lib/recaptcha/helpers.rb +2 -1
- data/lib/recaptcha/version.rb +1 -1
- data/rails/locales/de.yml +5 -0
- data/rails/locales/es.yml +5 -0
- data/rails/locales/it.yml +5 -0
- data/rails/locales/pt-BR.yml +5 -0
- data/rails/locales/pt.yml +5 -0
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cd4e9e48bb155611d906ffd22546fc3e25feb07db13ed55a7c3209b53249cd4
|
4
|
+
data.tar.gz: 9417568b47cb0db8d1b8a87b6de59e9df9043c948acc662824e22b16c25bf3f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c3a5765b93cc36d87a91249a880a7d81f5a7c864295572e378f0f6c7e21624250f297b9ce139fa68f019e6ddb390f62f8c1615f8a69a8aacf8aae3587e2f0b6
|
7
|
+
data.tar.gz: 863775382a5b6c8f767ca09af046e94abbe697eb25201087c5ceb2a37e16a57c1ad56d2f8ae00f3bd79d0d686b656dd9eece95fc46b8c5d9a22403026da282f5
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
## Next
|
2
|
+
* Add key setup to v3 example in README
|
3
|
+
* 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
|
+
* Update to latest version of rubocop
|
5
|
+
* Drop support for Ruby 2.7; add Ruby 3.3
|
6
|
+
* Add i18n: de, es, it, pt, pt-BR
|
2
7
|
|
3
8
|
## 5.16.0
|
4
9
|
* Allow usage of `options[:turbo]` as well as `options[:turbolinks]` for `recaptcha_v3`
|
data/README.md
CHANGED
@@ -78,6 +78,10 @@ export RECAPTCHA_ENTERPRISE_API_KEY = 'AIzvFyE3TU-g4K_Kozr9F1smEzZSGBVOfLKyup
|
|
78
78
|
export RECAPTCHA_ENTERPRISE_PROJECT_ID = 'my-project'
|
79
79
|
```
|
80
80
|
|
81
|
+
_note:_ you'll still have to provide `RECAPTCHA_SITE_KEY`, which will hold the value of your enterprise recaptcha key id. You will not need to provide a `RECAPTCHA_SECRET_KEY`, however.
|
82
|
+
|
83
|
+
`RECAPTCHA_ENTERPRISE_API_KEY` is the enterprise key of your Google Cloud Project, which you can generate here: https://console.cloud.google.com/apis/credentials.
|
84
|
+
|
81
85
|
Add `recaptcha_tags` to the forms you want to protect:
|
82
86
|
|
83
87
|
```erb
|
@@ -126,7 +130,7 @@ The following options are available:
|
|
126
130
|
| `:site_key` | Override site API key from configuration |
|
127
131
|
| `:error` | Override the error code returned from the reCAPTCHA API (default: `nil`) |
|
128
132
|
| `:size` | Specify a size (default: `nil`) |
|
129
|
-
| `:nonce` | Optional. Sets nonce attribute for script. Can be generated via `SecureRandom.base64(32)`. (default: `nil`) |
|
133
|
+
| `:nonce` | Optional. Sets nonce attribute for script. Can be generated via `SecureRandom.base64(32)`. Use `content_security_policy_nonce` if you have `config.content_security_policy_nonce_generator` set in Rails. (default: `nil`) |
|
130
134
|
| `:id` | Specify an html id attribute (default: `nil`) |
|
131
135
|
| `:callback` | Optional. Name of success callback function, executed when the user submits a successful response |
|
132
136
|
| `:expired_callback` | Optional. Name of expiration callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. |
|
@@ -204,7 +208,7 @@ It also accepts most of the options that `recaptcha_tags` accepts, including the
|
|
204
208
|
| Option | Description |
|
205
209
|
|---------------------|-------------|
|
206
210
|
| `:site_key` | Override site API key from configuration |
|
207
|
-
| `:nonce` | Optional. Sets nonce attribute for script tag. Can be generated via `SecureRandom.base64(32)`. (default: `nil`) |
|
211
|
+
| `:nonce` | Optional. Sets nonce attribute for script tag. Can be generated via `SecureRandom.base64(32)`. Use `content_security_policy_nonce` if you have `config.content_security_policy_nonce_generator` set in Rails. (default: `nil`) |
|
208
212
|
| `:id` | Specify an html id attribute (default: `nil`) |
|
209
213
|
| `:script` | Same as setting both `:inline_script` and `:external_script`. If you only need one or the other, use `:inline_script` and `:external_script` instead. |
|
210
214
|
| `:callback` | Optional. Name of success callback function, executed when the user submits a successful response |
|
@@ -305,6 +309,14 @@ With v3, you can let all users log in without any intervention at all if their s
|
|
305
309
|
threshold, and only show a v2 checkbox recaptcha challenge (fall back to v2) if it is below the
|
306
310
|
threshold:
|
307
311
|
|
312
|
+
This example sets v2 keys through environment variables. For more information on how to set up keys, please refer to the [documentation here](#alternative-api-key-setup).
|
313
|
+
|
314
|
+
```bash
|
315
|
+
# .env
|
316
|
+
RECAPTCHA_SITE_KEY=6Lc6BAAAAAAAAChqRbQZcn_yyyyyyyyyyyyyyyyy
|
317
|
+
RECAPTCHA_SECRET_KEY=6Lc6BAAAAAAAAKN3DRm6VA_xxxxxxxxxxxxxxxxx
|
318
|
+
```
|
319
|
+
|
308
320
|
```erb
|
309
321
|
…
|
310
322
|
<% if @show_checkbox_recaptcha %>
|
@@ -420,7 +432,7 @@ but only accepts the following options:
|
|
420
432
|
|---------------------|-------------|
|
421
433
|
| `:site_key` | Override site API key |
|
422
434
|
| `:action` | The name of the [reCAPTCHA action](https://developers.google.com/recaptcha/docs/v3#actions). Actions are not case-sensitive and may only contain alphanumeric characters, slashes, and underscores, and must not be user-specific. |
|
423
|
-
| `:nonce` | Optional. Sets nonce attribute for script. Can be generated via `SecureRandom.base64(32)`. (default: `nil`) |
|
435
|
+
| `:nonce` | Optional. Sets nonce attribute for script. Can be generated via `SecureRandom.base64(32)`. Use `content_security_policy_nonce` if you have `config.content_security_policy_nonce_generator` set in Rails. (default: `nil`) |
|
424
436
|
| `:callback` | Name of callback function to call with the token. When `element` is `:input`, this defaults to a function named `setInputWithRecaptchaResponseTokenFor#{sanitize_action(action)}` that sets the value of the hidden input to the token. |
|
425
437
|
| `:id` | Specify a unique `id` attribute for the `<input>` element if using `element: :input`. (default: `"g-recaptcha-response-data-"` + `action`) |
|
426
438
|
| `:name` | Specify a unique `name` attribute for the `<input>` element if using `element: :input`. (default: `g-recaptcha-response-data[action]`) |
|
data/lib/recaptcha/helpers.rb
CHANGED
@@ -74,7 +74,7 @@ module Recaptcha
|
|
74
74
|
<div style="width: 300px; height: 60px; border-style: none;
|
75
75
|
bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px;
|
76
76
|
background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
|
77
|
-
<textarea
|
77
|
+
<textarea name="g-recaptcha-response"
|
78
78
|
class="g-recaptcha-response"
|
79
79
|
style="width: 250px; height: 40px; border: 1px solid #c1c1c1;
|
80
80
|
margin: 10px 25px; padding: 0px; resize: none;">
|
@@ -140,6 +140,7 @@ module Recaptcha
|
|
140
140
|
skip_script = (options.delete(:script) == false) || (options.delete(:external_script) == false)
|
141
141
|
ui = options.delete(:ui)
|
142
142
|
options.delete(:ignore_no_element)
|
143
|
+
options.delete(:inline_script)
|
143
144
|
|
144
145
|
data_attribute_keys = [:badge, :theme, :type, :callback, :expired_callback, :error_callback, :size]
|
145
146
|
data_attribute_keys << :tabindex unless ui == :button
|
data/lib/recaptcha/version.rb
CHANGED
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.
|
4
|
+
version: 5.17.1
|
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:
|
11
|
+
date: 2024-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mocha
|
@@ -140,10 +140,15 @@ files:
|
|
140
140
|
- lib/recaptcha/rails.rb
|
141
141
|
- lib/recaptcha/railtie.rb
|
142
142
|
- lib/recaptcha/version.rb
|
143
|
+
- rails/locales/de.yml
|
143
144
|
- rails/locales/en.yml
|
145
|
+
- rails/locales/es.yml
|
144
146
|
- rails/locales/fr.yml
|
147
|
+
- rails/locales/it.yml
|
145
148
|
- rails/locales/ja.yml
|
146
149
|
- rails/locales/nl.yml
|
150
|
+
- rails/locales/pt-BR.yml
|
151
|
+
- rails/locales/pt.yml
|
147
152
|
homepage: http://github.com/ambethia/recaptcha
|
148
153
|
licenses:
|
149
154
|
- MIT
|
@@ -157,14 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
162
|
requirements:
|
158
163
|
- - ">="
|
159
164
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
165
|
+
version: 3.0.0
|
161
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
167
|
requirements:
|
163
168
|
- - ">="
|
164
169
|
- !ruby/object:Gem::Version
|
165
170
|
version: '0'
|
166
171
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.4.10
|
168
173
|
signing_key:
|
169
174
|
specification_version: 4
|
170
175
|
summary: Helpers for the reCAPTCHA API
|