zero-captcha 0.0.6 → 0.0.7
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 +4 -4
- data/VERSION +1 -1
- data/lib/zero-captcha.rb +3 -5
- data/zero-captcha.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c8207dccb726c1677a67358f9d84371e0db01e85a8071d94068783a1b7c1776
|
|
4
|
+
data.tar.gz: 985ea7aea1f40c53ed731f880741cc16f5917607ead7cbc89be3cd0411ab0eb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 363ca039ddce4a72f4c5cd532f2408ee06b93cfb1956526dd4566f8de7f5a1db31851659b791a7f634632b59fd7d2c501da19e594ca57504ae6c64e0484f6125
|
|
7
|
+
data.tar.gz: 017b55baf20ba439f45dfe83b24dd504928788cd08faeafa3f7ee0e8deb0c16de10021f03196620c72e7b2200c50febb26367477aa6e3b067ca60aefd8e9619b
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.7
|
data/lib/zero-captcha.rb
CHANGED
|
@@ -8,7 +8,7 @@ module ZeroCaptcha
|
|
|
8
8
|
timestamp = Time.current.to_i
|
|
9
9
|
return {
|
|
10
10
|
:_zc_field => OpenSSL::HMAC.hexdigest('sha256', Rails.application.secret_key_base, "#{timestamp}"),
|
|
11
|
-
:
|
|
11
|
+
:_zc_timestamp => timestamp
|
|
12
12
|
}
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -16,10 +16,8 @@ module ZeroCaptcha
|
|
|
16
16
|
# to force forms to feed through specific values
|
|
17
17
|
def protect_from_spam_with_zero_captcha
|
|
18
18
|
if request.post?
|
|
19
|
-
head :ok if
|
|
20
|
-
head :ok if
|
|
21
|
-
head :ok if Time.at(params[:_timestamp].to_i) < 20.minutes.ago
|
|
22
|
-
head :ok if params[:_zc_field] != OpenSSL::HMAC.hexdigest('sha256', Rails.application.secret_key_base, "#{params[:_timestamp]}")
|
|
19
|
+
head :ok if params[:_zc_timestamp].present? && Time.at(params[:_zc_timestamp].to_i) < 20.minutes.ago
|
|
20
|
+
head :ok if params[:_zc_field].present? && params[:_zc_field] != OpenSSL::HMAC.hexdigest('sha256', Rails.application.secret_key_base, "#{params[:_zc_timestamp]}")
|
|
23
21
|
end
|
|
24
22
|
end
|
|
25
23
|
|
data/zero-captcha.gemspec
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
2
|
Gem::Specification.new do |s|
|
|
3
3
|
s.name = %q{zero-captcha}
|
|
4
|
-
s.version = "0.0.
|
|
4
|
+
s.version = "0.0.7"
|
|
5
5
|
|
|
6
6
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
7
7
|
s.authors = ['lunaru']
|
|
8
|
-
s.date = %q{
|
|
8
|
+
s.date = %q{2024-01-17}
|
|
9
9
|
s.description = %q{A simple way to add zero friction captchas to Rails forms}
|
|
10
10
|
s.extra_rdoc_files = [
|
|
11
11
|
"LICENSE",
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zero-captcha
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- lunaru
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A simple way to add zero friction captchas to Rails forms
|
|
14
14
|
email:
|