recaptcha 5.15.0 → 5.17.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: addd45d783c834ffbc2253f3b7df793762ffb839617315d6cfd17e7d5abec519
4
- data.tar.gz: 1795b9d183326d23f408b5dd2b595531ff504885797012aa51953c6efc73a29d
3
+ metadata.gz: 52997b101110f7111f307af5bc5a66ce28d71cc74af339a267d55f8fe4bdeb1d
4
+ data.tar.gz: 5b62b2bf9740563b8f4e8edc9e3fdd90303daa4e8ea205cdb94e39a842dba770
5
5
  SHA512:
6
- metadata.gz: ddccc592d5d0ecdf7bae96d6a68ea29085dcdbfad9b346ae761a50d8b5b4c9f5337946e4e4374af4a1f74a2d8efd1e90e7a517f933f89f71a0cf3a1add44e701
7
- data.tar.gz: 9b3fc098f10c2a53798adaebca95b60a0e54b6188275dd388afd3fb160ff881caf7724e57c9063478c08d7b8e3f268e952aefc413bf2e3e2ab4bdf7c13a4b0a4
6
+ metadata.gz: 6fe87d18b768bcdd4bf50f6a8ba5248856bcf54d7dd5afb5c8f8f9da4003902f7078782c8f75c685874f4d1427deb1348c48d6fe001bd78aa733af0acf24060e
7
+ data.tar.gz: a0190cbff7d1e7f0d8b312ad2d6fc9e0a88336db8f8d2dea8ac9a7d678fd35faac9ec3ca7ba029f22b5b1d48614797caef9b56443e10837af1a2d5106fe7fccb
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
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
7
+
8
+ ## 5.16.0
9
+ * Allow usage of `options[:turbo]` as well as `options[:turbolinks]` for `recaptcha_v3`
2
10
 
3
11
  ## 5.15.0
4
12
  * Add 3.2 to the list of Ruby CI versions
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
@@ -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 %>
@@ -419,7 +431,7 @@ but only accepts the following options:
419
431
  | Option | Description |
420
432
  |---------------------|-------------|
421
433
  | `:site_key` | Override site API key |
422
- | `:action` | The name of the [reCAPTCHA action](https://developers.google.com/recaptcha/docs/v3#actions). Actions may only contain alphanumeric characters and slashes, and must not be user-specific. |
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
435
  | `:nonce` | Optional. Sets nonce attribute for script. Can be generated via `SecureRandom.base64(32)`. (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`) |
@@ -427,7 +439,8 @@ but only accepts the following options:
427
439
  | `:script` | Same as setting both `:inline_script` and `:external_script`. (default: `true`). |
428
440
  | `:inline_script` | If `true`, adds an inline script tag that calls `grecaptcha.execute` for the given `site_key` and `action` and calls the `callback` with the resulting response token. Pass `false` if you want to handle calling `grecaptcha.execute` yourself. (default: `true`) |
429
441
  | `:element` | The element to render, if any (default: `:input`)<br/>`:input`: Renders a hidden `<input type="hidden">` tag. The value of this will be set to the response token by the default `setInputWithRecaptchaResponseTokenFor{action}` callback.<br/>`false`: Doesn't render any tag. You'll have to add a custom callback that does something with the token. |
430
- | `:turbolinks` | If `true`, calls the js function which executes reCAPTCHA after all the dependencies have been loaded. This cannot be used with the js param `:onload`. This makes reCAPTCHAv3 usable with turbolinks. |
442
+ | `:turbo` | If `true`, calls the js function which executes reCAPTCHA after all the dependencies have been loaded. This cannot be used with the js param `:onload`. This makes reCAPTCHAv3 usable with turbo. |
443
+ | `:turbolinks` | Alias of `:turbo`. Will be deprecated soon. |
431
444
  | `:ignore_no_element` | If `true`, adds null element checker for forms that can be removed from the page by javascript like modals with forms. (default: true) |
432
445
 
433
446
  [JavaScript resource (api.js) parameters](https://developers.google.com/recaptcha/docs/invisible#js_param):
@@ -12,7 +12,7 @@ module Recaptcha
12
12
  action = options.delete(:action) || raise(Recaptcha::RecaptchaError, 'action is required')
13
13
  id = options.delete(:id) || "g-recaptcha-response-data-#{dasherize_action(action)}"
14
14
  name = options.delete(:name) || "g-recaptcha-response-data[#{action}]"
15
- turbolinks = options.delete(:turbolinks)
15
+ turbo = options.delete(:turbo) || options.delete(:turbolinks)
16
16
  options[:render] = site_key
17
17
  options[:script_async] ||= false
18
18
  options[:script_defer] ||= false
@@ -24,11 +24,11 @@ module Recaptcha
24
24
  end
25
25
  options[:class] = "g-recaptcha-response #{options[:class]}"
26
26
 
27
- if turbolinks
27
+ if turbo
28
28
  options[:onload] = recaptcha_v3_execute_function_name(action)
29
29
  end
30
30
  html, tag_attributes = components(options)
31
- if turbolinks
31
+ if turbo
32
32
  html << recaptcha_v3_onload_script(site_key, action, callback, id, options)
33
33
  elsif recaptcha_v3_inline_script?(options)
34
34
  html << recaptcha_v3_inline_script(site_key, action, callback, id, options)
@@ -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 id="g-recaptcha-response" name="g-recaptcha-response"
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;">
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.15.0'
4
+ VERSION = '5.17.0'
5
5
  end
@@ -0,0 +1,5 @@
1
+ de:
2
+ recaptcha:
3
+ errors:
4
+ verification_failed: Die reCAPTCHA-Überprüfung ist fehlgeschlagen, bitte versuchen Sie es erneut.
5
+ recaptcha_unreachable: Oops, wir konnten Ihre reCAPTCHA-Antwort nicht validieren. Bitte versuchen Sie es erneut.
@@ -0,0 +1,5 @@
1
+ es:
2
+ recaptcha:
3
+ errors:
4
+ verification_failed: La verificación de reCAPTCHA falló, por favor intente de nuevo.
5
+ recaptcha_unreachable: Ups, no pudimos validar su respuesta de reCAPTCHA. Por favor intente de nuevo.
@@ -0,0 +1,5 @@
1
+ it:
2
+ recaptcha:
3
+ errors:
4
+ verification_failed: La verifica reCAPTCHA non è riuscita, si prega di riprovare.
5
+ recaptcha_unreachable: Ops, non siamo riusciti a convalidare la tua risposta reCAPTCHA. Per favore riprova.
@@ -0,0 +1,5 @@
1
+ pt-BR:
2
+ recaptcha:
3
+ errors:
4
+ verification_failed: A verificação do reCAPTCHA falhou, por favor, tente novamente.
5
+ recaptcha_unreachable: Oops, não conseguimos validar sua resposta do reCAPTCHA. Por favor, tente novamente.
@@ -0,0 +1,5 @@
1
+ pt:
2
+ recaptcha:
3
+ errors:
4
+ verification_failed: A verificação do reCAPTCHA falhou, por favor, tente novamente.
5
+ recaptcha_unreachable: Oops, não conseguimos validar sua resposta do reCAPTCHA. Por favor, tente novamente.
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.15.0
4
+ version: 5.17.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: 2023-08-19 00:00:00.000000000 Z
11
+ date: 2024-06-09 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: 2.7.0
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.3.3
172
+ rubygems_version: 3.4.10
168
173
  signing_key:
169
174
  specification_version: 4
170
175
  summary: Helpers for the reCAPTCHA API