active_hashcash 0.1.0 → 0.1.1

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: 47a914f25827b270ed0e1bb2f0fc222316846b48232cf5dceb255c99725f1467
4
- data.tar.gz: f5aaf27f5d578cfc271624c4ddd3746365e81424247cd50ed43744cb534ea893
3
+ metadata.gz: 2a52910cc5af45ca4b31ce6af112ce45a4ec401e584d80076aa50247f9dfc154
4
+ data.tar.gz: 03ca632ff343a29d9841cb950684c693b4d7684b1bd42251731fea8f8f1c36c8
5
5
  SHA512:
6
- metadata.gz: 9799788e77f0f6d8415d0e69a153a8b88715e34d5742794ed64a0db3a30a41bd619bc54d9c840b1d4d37eff4f0f9cf90ec9bc4c552656aad8f086068997685e0
7
- data.tar.gz: f439c8fb6265ae1a2999b6fe3995871762e09b8ab05b38a776dc4e0eafd4fe67d431396323425118f55d596c2f2270ff5160733ccc94fe7f1d47df0eba38ce9f
6
+ metadata.gz: b2758deaf12537653c08a27a988aa18e13449975caaf73e854a39ad5011eca63430ac1eb019d9dc5bb66d415a0d8975a0908c833056d0422fdf8a1b192d3316e
7
+ data.tar.gz: 579afe8ab7e448ffd550882fad8b4c8e724be3ec5ab043aac57c49463097a738cf66fd9700193d4f418a01f6ffb03d29510d5593b4800c659548abce968f81fc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2022-07-08
4
+
5
+ - Fix when hashcash param is nil
6
+
3
7
  ## [0.1.0] - 2022-07-01
4
8
 
5
9
  - Initial release
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <img align="right" width="200px" src="logo.png" alt="Active Hashcash logo"/>
4
4
 
5
- ActiveHashcash protects your Rails application against DoS and bots.
5
+ ActiveHashcash protects your Rails application against brute force attacks, DoS and bots.
6
6
 
7
7
  Hashcash is proof-of-work algorithm, invented by Adam Back in 1997, to protect systems against denial of service attacks.
8
8
  ActiveHashcash is an easy way to protect any Rails application against brute force attacks and some bots.
@@ -16,7 +16,7 @@ The user submits the form, and the stamp is verified by the controller in a befo
16
16
 
17
17
  It blocks bots that do not interpret JavaScript since the proof of work is not computed. For the more sophisticated bots, we are happy to slow them down.
18
18
 
19
- Here is a [demo on a login form](https://www.rorvswild.com/session) :
19
+ Here is a [demo on a registration form](https://www.rorvswild.com/account/new) :
20
20
 
21
21
  ![Active Hashcash GIF preview](demo.gif)
22
22
 
@@ -73,8 +73,8 @@ module ActiveHashcash
73
73
  end
74
74
 
75
75
  def hashcash_stamp_is_valid?
76
- stamp = Stamp.parse(hashcash_param)
77
- stamp.valid? && stamp.bits >= hashcash_bits && stamp.parse_date >= Date.yesterday
76
+ stamp = hashcash_param && Stamp.parse(hashcash_param)
77
+ stamp && stamp.valid? && stamp.bits >= hashcash_bits && stamp.parse_date >= Date.yesterday
78
78
  end
79
79
 
80
80
  def hashcash_stamp_spent?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_hashcash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-01 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -38,7 +38,8 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 5.2.0
41
- description: Potect your Rails application against DoS and bots.
41
+ description: ActiveHashcash protects your Rails application against brute force attacks,
42
+ DoS and bots.
42
43
  email:
43
44
  - alexis@basesecrete.com
44
45
  executables: []
@@ -75,5 +76,6 @@ requirements: []
75
76
  rubygems_version: 3.2.22
76
77
  signing_key:
77
78
  specification_version: 4
78
- summary: Potect your Rails application against DoS and bots.
79
+ summary: ActiveHashcash protects your Rails application against brute force attacks,
80
+ DoS and bots.
79
81
  test_files: []