acts_as_textcaptcha 4.6.0 → 4.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -20
- data/config/textcaptcha.yml +34 -0
- data/lib/acts_as_textcaptcha/textcaptcha_api.rb +2 -5
- data/lib/acts_as_textcaptcha/version.rb +1 -1
- metadata +11 -100
- data/.gitignore +0 -12
- data/.rubocop.yml +0 -1165
- data/.simplecov +0 -11
- data/.travis.yml +0 -57
- data/Appraisals +0 -19
- data/CHANGELOG.md +0 -117
- data/CODE_OF_CONDUCT.md +0 -73
- data/CONTRIBUTING.md +0 -36
- data/Gemfile +0 -4
- data/PULL_REQUEST_TEMPLATE.md +0 -16
- data/Rakefile +0 -39
- data/acts_as_textcaptcha.gemspec +0 -62
- data/bin/console +0 -8
- data/bin/setup +0 -7
- data/gemfiles/rails_3.gemfile +0 -8
- data/gemfiles/rails_4.gemfile +0 -8
- data/gemfiles/rails_5.gemfile +0 -8
- data/gemfiles/rails_6.gemfile +0 -8
- data/gemfiles/rails_7.gemfile +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f1a973275365e17fdda4a90bbf9469abcbc818b81ed3f37c30b090cabff938f
|
4
|
+
data.tar.gz: 115dabb78d67d6d0edd548c10ede333ddeb24f859b7cd5726944fe0d8c4bf218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9846e9e86ae795b99f02891e5576defe6d126b9867439f70bfd6c03e4c271f8febb504516ad858ffe70281427afbdb255bc6377f3b2938d34566ed1363cf0291
|
7
|
+
data.tar.gz: 01c9936aad7214e93fff9f402bbd75437535626d6c39a87d0687a2d90c91a6153718bd179c1fc608ca29d0c49d0c2e4890479d6d6a72851bd60963c4060fae0b
|
data/README.md
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
## ActAsTextcaptcha
|
2
2
|
|
3
|
+
[![CI](https://img.shields.io/github/actions/workflow/status/matthutchinson/acts_as_textcaptcha/ci.yml?branch=main&style=flat)](https://github.com/matthutchinson/acts_as_textcaptcha/actions/workflows/ci.yml)
|
3
4
|
[![Gem](https://img.shields.io/gem/v/acts_as_textcaptcha.svg?style=flat)](http://rubygems.org/gems/acts_as_textcaptcha)
|
4
|
-
[![Travis](https://img.shields.io/travis/com/matthutchinson/acts_as_textcaptcha/master.svg?style=flat)](https://travis-ci.com/matthutchinson/acts_as_textcaptcha)
|
5
5
|
[![Depfu](https://img.shields.io/depfu/matthutchinson/acts_as_textcaptcha.svg?style=flat)](https://depfu.com/github/matthutchinson/acts_as_textcaptcha)
|
6
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/c67969dd7b921477bdcc/maintainability)](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/maintainability)
|
7
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/c67969dd7b921477bdcc/test_coverage)](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/test_coverage)
|
8
6
|
|
9
7
|
ActsAsTextcaptcha provides spam protection for Rails models with text-based
|
10
8
|
logic question captchas. Questions are fetched from [Rob
|
@@ -18,16 +16,13 @@ are a good idea visit [textcaptcha.com](https://textcaptcha.com).
|
|
18
16
|
|
19
17
|
## Requirements
|
20
18
|
|
21
|
-
* [Ruby](http://ruby-lang.org/) >=
|
22
|
-
* [Rails](http://github.com/rails/rails) >=
|
19
|
+
* [Ruby](http://ruby-lang.org/) >= 3.1
|
20
|
+
* [Rails](http://github.com/rails/rails) >= 6.1
|
23
21
|
* A valid [Rails.cache](http://guides.rubyonrails.org/caching_with_rails.html#cache-stores) (not `:null_store`)
|
24
22
|
|
25
23
|
## Demo
|
26
24
|
|
27
|
-
Try a [working demo here](https://acts-as-textcaptcha
|
28
|
-
Or one-click deploy your own [demo app](https://github.com/matthutchinson/acts_as_textcaptcha_demo) to Heroku.
|
29
|
-
|
30
|
-
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/matthutchinson/acts_as_textcaptcha_demo/tree/master)
|
25
|
+
Try a [working demo here](https://acts-as-textcaptcha.hiddenloop.dev)!
|
31
26
|
|
32
27
|
## Installation
|
33
28
|
|
@@ -210,8 +205,7 @@ The API may be unresponsive or return an unexpected response. If you've set
|
|
210
205
|
## Development
|
211
206
|
|
212
207
|
Check out this repo and run `bin/setup`, this will install gem dependencies and
|
213
|
-
generate docs. Use `bundle exec rake` to run tests
|
214
|
-
report.
|
208
|
+
generate docs. Use `bundle exec rake` to run tests.
|
215
209
|
|
216
210
|
You can also run `bin/console` for an interactive prompt to experiment with the
|
217
211
|
code.
|
@@ -245,9 +239,7 @@ remember to check it hasn't already been raised.
|
|
245
239
|
Bug [reports](https://github.com/matthutchinson/acts_as_textcaptcha/issues) and
|
246
240
|
[pull requests](https://github.com/matthutchinson/acts_as_textcaptcha/pulls) are
|
247
241
|
welcome on GitHub. When submitting pull requests, remember to add tests covering
|
248
|
-
any new behaviour, and ensure all tests are passing
|
249
|
-
[Travis](https://travis-ci.com/matthutchinson/acts_as_textcaptcha). Read the
|
250
|
-
[contributing
|
242
|
+
any new behaviour, and ensure all tests are passing. Read the [contributing
|
251
243
|
guidelines](https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CONTRIBUTING.md)
|
252
244
|
for more details.
|
253
245
|
|
@@ -257,10 +249,11 @@ Covenant](http://contributor-covenant.org) code of conduct. See
|
|
257
249
|
[here](https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CODE_OF_CONDUCT.md)
|
258
250
|
for more details.
|
259
251
|
|
260
|
-
##
|
252
|
+
## Ideas
|
261
253
|
|
254
|
+
* Check if AI models can beat this approach
|
262
255
|
* Allow translatable user supplied questions and answers in config
|
263
|
-
* Allow `Net::HTTP` to be swapped out for any
|
256
|
+
* Allow `Net::HTTP` to be swapped out for any HTTP client.
|
264
257
|
|
265
258
|
## License
|
266
259
|
|
@@ -274,10 +267,8 @@ The code is available as open source under the terms of
|
|
274
267
|
|
275
268
|
## Links
|
276
269
|
|
277
|
-
* [
|
278
|
-
* [
|
279
|
-
* [Maintainability](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/maintainability)
|
280
|
-
* [Test Coverage](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/test_coverage)
|
270
|
+
* [CI](https://github.com/matthutchinson/acts_as_textcaptcha/actions/workflows/ci.yml)
|
271
|
+
* [Demo](https://acts-as-textcaptcha.hiddenloop.dev)
|
281
272
|
* [RDoc](http://rdoc.info/projects/matthutchinson/acts_as_textcaptcha)
|
282
273
|
* [Wiki](http://wiki.github.com/matthutchinson/acts_as_textcaptcha/)
|
283
274
|
* [Issues](http://github.com/matthutchinson/acts_as_textcaptcha/issues)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
development: &common_settings
|
2
|
+
api_key: 'TEXTCAPTCHA_API_IDENT' # see https://textcaptcha.com for details
|
3
|
+
# api_endpoint: nil # Optional API URL to fetch questions and answers from
|
4
|
+
# raise_errors: false # Optional flag, if true errors will be raised if the API endpoint fails
|
5
|
+
# cache_expiry_minutes: 10 # Optional minutes for captcha answers to persist in the cache (default 10 minutes)
|
6
|
+
|
7
|
+
questions:
|
8
|
+
- question: 'Is ice hot or cold?'
|
9
|
+
answers: 'cold'
|
10
|
+
- question: 'what color is an orange?'
|
11
|
+
answers: 'orange'
|
12
|
+
- question: 'what is two plus 3?'
|
13
|
+
answers: '5,five'
|
14
|
+
- question: 'what is 5 times two?'
|
15
|
+
answers: '10,ten'
|
16
|
+
- question: 'How many colors in the list, green, brown, foot and blue?'
|
17
|
+
answers: '3,three'
|
18
|
+
- question: 'what is Georges name?'
|
19
|
+
answers: 'george'
|
20
|
+
- question: '11 minus 1?'
|
21
|
+
answers: '10,ten'
|
22
|
+
- question: 'is boiling water hot or cold?'
|
23
|
+
answers: 'hot'
|
24
|
+
- question: 'what color is my blue shirt today?'
|
25
|
+
answers: 'blue'
|
26
|
+
- question: 'what is 16 plus 4?'
|
27
|
+
answers: '20,twenty'
|
28
|
+
|
29
|
+
test:
|
30
|
+
<<: *common_settings
|
31
|
+
api_key: 'TEST_TEXTCAPTCHA_API_IDENT'
|
32
|
+
|
33
|
+
production:
|
34
|
+
<<: *common_settings
|
@@ -7,11 +7,8 @@ module ActsAsTextcaptcha
|
|
7
7
|
BASE_URL = "http://textcaptcha.com"
|
8
8
|
|
9
9
|
def initialize(api_key: nil, api_endpoint: nil, raise_errors: false)
|
10
|
-
self.uri =
|
11
|
-
|
12
|
-
else
|
13
|
-
URI("#{BASE_URL}/#{api_key}.json")
|
14
|
-
end
|
10
|
+
self.uri = URI(api_endpoint || "#{BASE_URL}/#{api_key}.json")
|
11
|
+
|
15
12
|
self.raise_errors = raise_errors || false
|
16
13
|
rescue URI::InvalidURIError => e
|
17
14
|
raise ApiKeyError.new(api_key, e)
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_textcaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Hutchinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pry-byebug
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: rake
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +24,6 @@ dependencies:
|
|
52
24
|
- - ">="
|
53
25
|
- !ruby/object:Gem::Version
|
54
26
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
27
|
- !ruby/object:Gem::Dependency
|
70
28
|
name: rdoc
|
71
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,19 +39,19 @@ dependencies:
|
|
81
39
|
- !ruby/object:Gem::Version
|
82
40
|
version: '0'
|
83
41
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
42
|
+
name: rails
|
85
43
|
requirement: !ruby/object:Gem::Requirement
|
86
44
|
requirements:
|
87
|
-
- - "
|
45
|
+
- - "~>"
|
88
46
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
47
|
+
version: 8.0.1
|
90
48
|
type: :development
|
91
49
|
prerelease: false
|
92
50
|
version_requirements: !ruby/object:Gem::Requirement
|
93
51
|
requirements:
|
94
|
-
- - "
|
52
|
+
- - "~>"
|
95
53
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
54
|
+
version: 8.0.1
|
97
55
|
- !ruby/object:Gem::Dependency
|
98
56
|
name: minitest
|
99
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,34 +66,6 @@ dependencies:
|
|
108
66
|
- - ">="
|
109
67
|
- !ruby/object:Gem::Version
|
110
68
|
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rails
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 7.0.2.2
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 7.0.2.2
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: simplecov
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 0.19.1
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 0.19.1
|
139
69
|
- !ruby/object:Gem::Dependency
|
140
70
|
name: sqlite3
|
141
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,27 +107,9 @@ extra_rdoc_files:
|
|
177
107
|
- README.md
|
178
108
|
- LICENSE
|
179
109
|
files:
|
180
|
-
- ".gitignore"
|
181
|
-
- ".rubocop.yml"
|
182
|
-
- ".simplecov"
|
183
|
-
- ".travis.yml"
|
184
|
-
- Appraisals
|
185
|
-
- CHANGELOG.md
|
186
|
-
- CODE_OF_CONDUCT.md
|
187
|
-
- CONTRIBUTING.md
|
188
|
-
- Gemfile
|
189
110
|
- LICENSE
|
190
|
-
- PULL_REQUEST_TEMPLATE.md
|
191
111
|
- README.md
|
192
|
-
-
|
193
|
-
- acts_as_textcaptcha.gemspec
|
194
|
-
- bin/console
|
195
|
-
- bin/setup
|
196
|
-
- gemfiles/rails_3.gemfile
|
197
|
-
- gemfiles/rails_4.gemfile
|
198
|
-
- gemfiles/rails_5.gemfile
|
199
|
-
- gemfiles/rails_6.gemfile
|
200
|
-
- gemfiles/rails_7.gemfile
|
112
|
+
- config/textcaptcha.yml
|
201
113
|
- lib/acts_as_textcaptcha.rb
|
202
114
|
- lib/acts_as_textcaptcha/errors.rb
|
203
115
|
- lib/acts_as_textcaptcha/framework/rails.rb
|
@@ -214,11 +126,10 @@ licenses:
|
|
214
126
|
- MIT
|
215
127
|
metadata:
|
216
128
|
homepage_uri: https://github.com/matthutchinson/acts_as_textcaptcha
|
129
|
+
documentation_uri: https://rubydoc.info/gems/acts_as_textcaptcha
|
217
130
|
changelog_uri: https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CHANGELOG.md
|
218
|
-
source_code_uri: https://github.com/matthutchinson/acts_as_textcaptcha
|
219
131
|
bug_tracker_uri: https://github.com/matthutchinson/acts_as_textcaptcha/issues
|
220
132
|
allowed_push_host: https://rubygems.org
|
221
|
-
rubygems_mfa_required: 'true'
|
222
133
|
post_install_message:
|
223
134
|
rdoc_options:
|
224
135
|
- "--title"
|
@@ -232,14 +143,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
143
|
requirements:
|
233
144
|
- - ">="
|
234
145
|
- !ruby/object:Gem::Version
|
235
|
-
version: '
|
146
|
+
version: '3.1'
|
236
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
148
|
requirements:
|
238
149
|
- - ">="
|
239
150
|
- !ruby/object:Gem::Version
|
240
151
|
version: '0'
|
241
152
|
requirements: []
|
242
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.5.22
|
243
154
|
signing_key:
|
244
155
|
specification_version: 4
|
245
156
|
summary: A text-based logic question captcha for Rails
|